Skip to main content
Version: 6.0.X

Overriding Functions

Main interface#

interface RecipeInterface {    /*     * Called to generate email verification token    *     * @params: email    *          userId    *     * @returns: "OK": if token is successfully generated    *           "EMAIL_ALREADY_VERIFIED_ERROR": if email is already verified    */    createEmailVerificationToken(input: {        userId: string;        email: string;    }): Promise<        | {              status: "OK";              token: string;          }        | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }    >;
    /*     * Called to the verify email verification token    *     * @params: token    *     * @returns: "OK": on successfully verifying the token    *           "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR": if verification token is invalid    */    verifyEmailUsingToken(input: {        token: string;    }): Promise<{ status: "OK"; user: User } | { status: "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" }>;
    /*     * Called to check whether the email is verified or not    *     * @params: userId    *          email    *     * @returns: "OK" and a boolean stating whether the email is verified or not    */    isEmailVerified(input: { userId: string; email: string }): Promise<boolean>;}

Supporting Types#

interface User {    id: string;    email: string;}
Which frontend SDK do you use?
supertokens-web-js / mobile
supertokens-auth-react