How authentication works
The components use a short-lived JWT for every API call. Your backend exchanges its Basic Auth credentials for a 10-minute JWT, then passes it to the component when it mounts. Basic Auth credentials are never sent to the browser.1
Install the package
v2.1.0-qa, is available for testing against staging.2
Store your Basic Auth credential securely
Keep the credential in a server-side store, such as AWS Secrets Manager, HashiCorp Vault, KMS, or a backend environment variable. It must never appear in front-end code or in any variable that ships to the browser.
3
Create a backend token endpoint
Your backend calls Expose the token to your front end through an internal endpoint:
POST /widget/session to exchange Basic Auth for a 10-minute JWT.4
Import the stylesheet
Add this once at your app entry point:
5
Mount a component
Choose the component that fits. See Choose a component.
Mount SuperManagementEmbed
No routing is needed. Fetch the token from your backend at session start, pass it inconfig.accessToken, and provide onTokenExpired so the token renews automatically.
SuperPage.jsx
Mount SuperApp
SuperApp requires React Router v6 or later.
First, add a catch-all route:
SuperRouteWrapper.jsx
Token expiry
The component manages the token lifecycle for you. It callsonTokenExpired 60 seconds before the token expires, so normal sessions never see a 401.
onTokenExpired must return the new token string. If it returns nothing or throws, the component shows a session-expired error. If several requests expire at once, your token endpoint is still only called once.
