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:*
This is the name of your application
API Domain:*
This is the URL of your app's API domain, without any path.
Website Domain:*
This is the URL of your website, without any path.
Fill form to submit

3) Setup the login UI#

Do you use react-router-dom?
YesNo
Refresh the page to undo your selection

4) Add API interceptors for automatic session refreshing#

Do you use axios on your frontend?
YesNo
Refresh the page to undo your selection

5) Visit /auth to see the login UI (ReactJS only)#

At this stage, you've successfully integrated your website with SuperTokens. The next section will guide you through setting up your backend.