This SDK documentation is outdated. Please do not refer to it, and instead visit the User Guides section.

Skip to main content
Version: Next


In your index.js, you need to call the Supertokens.init function to initialise SuperTokens. You can provide it the following config:

import supertokens from "supertokens-node";

framework?: string,
supertokens?: {
connectionURI: string,
apiKey?: string
appInfo: {
appName: string,
apiDomain: string,
websiteDomain: string,
apiBasePath?: string,
websiteBasePath?: string,
apiGatewayPath?: string
recipeList: RecipeListFunction[],
isInServerlessEnv?: boolean


framework (Optional)#

  • Pass the value of framework this library is used in. For next.js, use express. Currently supported values are:
    • express
    • koa
    • hapi
    • fastify
    • loopback
    • awsLambda
  • Default: express


  • connectionURI
    • The url link to supertokens core. If you are using Supertokens Saas service, you can find the connectionURI on your app's dashboard.
  • apiKey (Optional)
    • Use this to authenticate the backend APIs with the supertokens core
    • Default: undefined


  • You can learn more about the appInfo object in the recipe guides.


  • Pass true if you are using this library in a serverless environment as it will help to optimise the performance.
  • Default: false


  • List of Recipes you want to use. You need to pass atleast one Recipe to ths array. For more info on Recipes, checkout this link) or the other sections in this docs.
Looking for older versions of the documentation?
Which UI do you use?
Custom UI
Pre built UI