https://supertokens.com/ logo
#general
Title
# general
r

rajivharlalka

02/25/2022, 5:23 AM
Copy code
const initSupertokens = () => {
    supertokens.init({
        framework: "express",
        supertokens: {
            // These are the connection details of the app you created on supertokens.io
            connectionURI: config.supertokens.url,
            apiKey: config.supertokens.api_key,
        },
        appInfo: {
            // learn more about this on https://supertokens.io/docs/session/appinfo
            appName: "griffin",
            apiDomain: config.urls.backend,
            websiteDomain: config.urls.frontend,
            apiBasePath: "/api",
            websiteBasePath: "/auth",
        },
        recipeList: [
            Passwordless.init({
                flowType: "USER_INPUT_CODE",
                contactMethod: "EMAIL_OR_PHONE",
                createAndSendCustomEmail: async function (input) {
                    sendEmailOtp(input.email, input.userInputCode);
                },
                createAndSendCustomTextMessage: async (input, context) => {
                    /* See next step */
                },
            }),
            ,
            Session.init(),
        ],
    });
    Logger.info("Supertokens connected.");
};
And this is the SuperTokens Init function