https://github.com/supertokens/prebuiltui
This is a repo that's built on top of supertokens-auth-react that provides a bundle that can be injected into your app to provide the pre built experience of supertokens
https://github.com/supertokens/prebuiltui
Last synced: 3 months ago
JSON representation
This is a repo that's built on top of supertokens-auth-react that provides a bundle that can be injected into your app to provide the pre built experience of supertokens
- Host: GitHub
- URL: https://github.com/supertokens/prebuiltui
- Owner: supertokens
- License: mit
- Created: 2024-07-27T06:10:51.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-03-25T08:37:17.000Z (3 months ago)
- Last Synced: 2025-03-26T00:41:29.552Z (3 months ago)
- Language: TypeScript
- Size: 3.77 MB
- Stars: 3
- Watchers: 7
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Pre built UI bundle for SuperTokens
To integrate it with your project, you will need to add the following script tags to the HEAD of your HTML (on the `/auth/*` route of your application), and also modify the body to add a `
`:```html
window.addEventListener('supertokensScriptLoaded', (e) => {
window.supertokensUIInit('supertokensui', {
appInfo: {
websiteDomain: 'http://localhost:3000',
apiDomain: 'http://localhost:3001',
appName: 'My Demo App',
websiteBasePath: "/auth"
},
recipeList: [
window.supertokensUIEmailPassword.init(),
window.supertokensUIThirdParty.init({
signInAndUpFeature: {
providers: [
window.supertokensUIThirdParty.Github.init(),
window.supertokensUIThirdParty.Google.init(),
]
}
}),
window.supertokensUISession.init(),
],
});
});
```
The above initialization code is for a pre-built UI bundle for SuperTokens:
- We assume that you are serving this HTML on `/auth` and `/auth/*` routes on `http://localhost:3000` in the above config, but if not, please feel free to change the contents of the `appInfo` config.
- The above also assumes that you are running your API (that integrates with our backend SDK) on `http://localhost:3001`.
- We init the email password, the third party recipe (with google and github login), and the session recipe, but you have several other options too. For more information, please visit the [SuperTokens website](https://supertokens.com/docs/guides).