Skip to main content

Manually generating a link

You can use our backend SDK to generate the email verification link as shown below:

import EmailVerification from "supertokens-node/recipe/emailverification";

async function createEmailVerificationEmail(userId: string, email: string) {
try {
// Create an email verification link for the user
const linkResponse = await EmailVerification.createEmailVerificationLink(userId, email);

if (linkResponse.status === "OK") {
console.log(linkResponse.link);
} else {
// user's email is already verified
}
} catch (err) {
console.error(err);
}
}
Multi Tenancy

For a multi tenant setup, you can pass in the user's tenantId to the createEmailVerificationLink function as well. The generated link will use the configured websiteDomain, however, you can change the domain of the generated link to match that of the tenant ID.

Which UI do you use?
Custom UI
Pre built UI