Connect Session
An NPM package to simplify OAuth with Reapit Connect
Basic Browser Usage
import { ReapitConnectBrowserSession } from '@reapit/connect-session'
// You should instantiate the class once only as a singleton as the module manages it's own state
export const reapitConnectBrowserSession = new ReapitConnectBrowserSession({
// The client id of your application, obtained from Reapit Developer Portal
connectClientId: 'SOME_CLIENT_ID',
// The url to the Reapit Connect instance. While in beta this is the below URL but will need to be context aware in full prod/
connectOAuthUrl: 'https://connect.reapit.cloud',
// OAuth UserPoolId - refer to the foundations documentation to obtain this for the correct environment
connectUserPoolId: 'SOME_USER_POOL_ID',
// The relative path you want to re-direct in your application after a successful login. You will have supplied this when you registered your app.
// Defaults to '' or the root of your project if not supplied
connectLoginRedirectPath: '/some-redirect-path',
// The relative path you want to re-direct in your application after a successful logout. You will have supplied this when you registered your app.
// Defaults to '/login' if not supplied
connectLogoutRedirectPath: '/some-login-path',
// The time in ms before your session times out when a user is inactive.
// Defaults to 10800000 - 3hrs
connectApplicationTimeout: 10800000
})React Usage
Sign In With Reapit Button
Node Usage
Last updated