Which frontend SDK do you use?
supertokens-auth-react
supertokens-web-js / mobile
1. Frontend Setup
Frontend guide. #
1) Finish theapiBasePath
in the appInfo
object #
2) Add To learn more about what these properties mean read here.
Your app's name:*

This is the name of your application
API Domain:*

This is the URL of your app's API server.
API Base Path:

SuperTokens will expose it's APIs scoped by this base API path.
Website Domain:*

This is the URL of your website.
Website Base Path:

The path where the login UI will be rendered
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 thewebsiteDomain
values will be the same. - An example of this
init
call can be seen here.