Skip to main content

Provide SMTP configuration

Using this method, you can:

  • Send emails using your own domain
  • Optionally customise the default email templates and subject.
import supertokens from "supertokens-node";import ThirdPartyEmailPassword from "supertokens-node/recipe/thirdpartyemailpassword";import Session from "supertokens-node/recipe/session";import { STMPService } from "supertokens-node/recipe/thirdpartyemailpassword/emaildelivery";
supertokens.init({    appInfo: {        apiDomain: "...",        appName: "...",        websiteDomain: "..."    },    recipeList: [        ThirdPartyEmailPassword.init({            emailDelivery: {                service: new STMPService({                    smtpSettings: {                        host: "...",                        password: "...",                        port: 465,                        from: {                            name: "...",                            email: "...",                        },                        secure: true                    },                })            },        }),        Session.init()    ]});

To learn about how to customise the default email templates or the subject, please see the next section.