Initialisation
API Reference
The init function:import SuperTokensRequest from 'supertokens-website';
SuperTokensRequest.init({
refreshTokenUrl: "https://api.example.com/api/refresh"
});
supertokens.fetch.init({
refreshTokenUrl: "https://api.example.com/api/refresh"
});
- To be called at least once before any http request is made to any of your APIs that require authentication.
- You only need to call this once in your SPA app or on page load.
- Please see the API reference link above to understand the meaning of the various parameters.