TypeScript SDK
Microapp authentication for any web app.
The TypeScript Auth SDK enables you to authenticate users without requiring a particular frontend framework.
Getting Started
1. Install the SDK
Install the SDK with your preferred package manager.
2. Import and Initialize the Auth SDK
To use the Auth SDK in your code, import it in any file where you need to use it.
For local development, we recommend using the sandbox
feature on the Auth
class to return mocked users:
The sandbox
prop should only be used for local development. Do not use it in production.
3. Check if the User is Authenticated
The isAuthenticated
method returns the user’s authentication status: true
if authenticated and false
if unauthenticated.
4. Get the User’s Profile Information
The getUser
method returns the user’s profile information.
3. Prompt the User to Log In
If the user is not authenticated, you can prompt them to authenticate by calling the requestLogin
method.
5. Get Notified when the User is Authenticated
You can get notified when the user authenticates using onUserAuthenticated
method.