+ |
This demo app shows how to integrate Osso in a Node and React app that uses SuperTokens for user authentication.
You'll need an Osso instance which you can self-host or purchase as a SaaS subscription. You can also utilize Osso's Demo Instance for testing - .env.example
includes variables for working with the Osso demo instance.
You'll also need a SuperTokens instance, which you can also self-host or purchase a SaaS subscription. If you've found this project we assume you are already familiar with SuperTokens. The demo app is configured to use the SuperTokens demo instance at try.supertokens.io
Use npm
to install the project dependencies:
npm install
Copy the .env.example
file. If you are using your own Osso instance, replace the relevant variables with the information for your instance and OAuth client.
cp .env.example .env
In your Osso instance, add an allowed redirect URI for each of your OAuth clients with the path /auth/callback/osso
.
For instance, if you are running this application locally, add http://localhost:3000/auth/callback/osso
to your Development OAuth Client.
This compiles and serves the React app and starts the backend API server on port 3001.
npm run dev
The app will start on http://localhost:3000
- The frontend code is located in the
src
folder. - The backend API is in the
api-server.js
file. - You can provide the following params to the
npm run
commands:REACT_APP_API_PORT
: To change the port for the API. The default is3001
REACT_APP_API_URL
: In case the API is not hosted onlocalhost
. This must contain the port as well.REACT_APP_WEBSITE_PORT
: To change the port of the website server. The default is3000
REACT_APP_WEBSITE_URL
: In case the website is not hosted onlocalhost
. This must contain the port as well.
npm run build
A live demo is available at https://supertokens-demo.ossoapp.com.
npm run prod
Created with ❤️ by the folks at SuperTokens.io, forked and updated by the folks at Ossoapp.com
This project is licensed under the Apache 2.0 license.