Skip to main content

Frontend Integration

important

For framework specific implementation (like Next.js), please skip this section and go directly to the section with the name of your framework.

An example implementation can be found here.#

1) Install#

npm i -s supertokens-auth-react

2) Call the init function#

Please fill the form below to see the code snippet (* = Required)
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
SuperTokens UI will be shown on this website route.
Submit form

3) Setup the login UI#

Please fill the form below to see the code snippet (* = Required)
Website Base Path:
Information about the question
SuperTokens UI will be shown on this website route.
Submit form

4) Add API interceptors for automatic session refreshing#

Do you use axios on your frontend?
YesNo

5) View the login UI (ReactJS only)#

Please fill the form below to see the code snippet (* = Required)
Website Base Path:
Information about the question
SuperTokens UI will be shown on this website route.
Submit form