Skip to main content

Doing operations post email verification

To perform any task like analytics, sending a user a welcome email, notifying an internal dashboard, post email verification, you'll need to override the emailVerificationFeature > verifyEmailPOST API.

SuperTokens.init({    appInfo: {...},    recipeList: [        EmailPassword.init({            emailVerificationFeature: {                override: {                    emailVerificationFeature: {                        apis: (originalImplementation) => {                            return {                                ...originalImplementation,                                verifyEmailPOST: async (input) => {                                     // First we call the original implementation                                    let response = await originalImplementation.verifyEmailPOST(input);                                                                        // Then we check if it was successfully completed                                    if (response.status === "OK") {                                        let { id, email } = response.user;                                        // TODO: post email verification logic                                    }                                    return response;                                }                            }                        }                    }                }            }        }),
        Session.init()    ]});