Skip to main content

1. Frontend Setup

1) Finish the Quick Setup > Frontend guide.#

2) Add apiBasePath in the appInfo object#

The value 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:

SuperTokens.init({    appInfo: {        appName: "YOUR APP NAME", // Example: "SuperTokens",        apiDomain: "YOUR API DOMAIN", // Example: "http://localhost:8080"        websiteDomain: "YOUR WEBSITE DOMAIN", // Example: "http://localhost:8080"        apiBasePath: "/.netlify/functions/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.