Skip to main content
Version: 7.2.X

Overriding Functions

Main interface#

interface RecipeInterface {    /*     * Called to get user info based on userId    *     * @params: userId    *     * @returns: user object if a user is found for the given userId, else undefined    */    getUserById(input: { userId: string }): Promise<User | undefined>;
    /*     * Called to get user info based on email    *     * @params: email    *     * @returns: array of user object    */    getUsersByEmail(input: { email: string }): Promise<User[]>;
    /*     * Called to get user info based on thirdparty info    *     * @params: thirdPartyId: third party provider id, e.g. "google"    *          thirdPartyUserId: userId that was given by the third party provider    *     * @returns: user object if a user is found for the given userId, else undefined    */    getUserByThirdPartyInfo(input: { thirdPartyId: string; thirdPartyUserId: string }): Promise<User | undefined>;
    /*     * Called to sign-up/sign-in a user    *     * @params: email: an object containing email id and boolean stating if email is verified or not    *          thirdPartyId: third party provider id, e.g. "google"    *          thirdPartyUserId: userId that was given by the third party provider    *     * @returns: "OK": on successfully signing up the user    *           "FIELD_ERROR": error in passing thridparty fields    */    signInUp(input: {        thirdPartyId: string;        thirdPartyUserId: string;        email: {            id: string;            isVerified: boolean;        };    }): Promise<        | { status: "OK"; createdNewUser: boolean; user: User }        | {              status: "FIELD_ERROR";              error: string;          }    >;}

Supporting Types#

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