Skip to main content
Which frontend SDK do you use?
supertokens-web-js / mobile
supertokens-auth-react

1. Frontend Setup

1) Finish the Frontend guide. #

2) Add apiBasePath in the appInfo object #

Your app's name:*
Information about the question
This is the name of your application
API Domain:*
Information about the question
This is the URL of your app's API server.
API Base Path:
Information about the question
SuperTokens will expose it's APIs scoped by this base API path.
Website Domain:*
Information about the question
This is the URL of your website.
Website Base Path:
Information about the question
The path where the login UI will be rendered
Submit form

The value of apiBasePath should be "/.netlify/functions/auth". This is because Netlify exposes the serverless functions via /.netlify/functions/* and we further scope the auth related APIs by adding a /auth, resulting in the above full path.

So the init function call should look like:

import SuperTokens from "supertokens-auth-react";
SuperTokens.init({    appInfo: {        appName: "<YOUR_APP_NAME>",        apiDomain: "<YOUR_API_DOMAIN>",        websiteDomain: "<YOUR_WEBSITE_DOMAIN>",        apiBasePath: "/.netlify/functions/auth",        websiteBasePath: "/auth"    },    recipeList: []});
  • If you are hosting the frontend via Netlify as well, then the apiDomain and the websiteDomain values will be the same.
  • An example of this init call can be seen here.
Which frontend SDK do you use?
supertokens-web-js / mobile
supertokens-auth-react