Browser-based SDK for Asgardeo
# Using npm
npm install @asgardeo/browser
# or using pnpm
pnpm add @asgardeo/browser
# or using yarn
yarn add @asgardeo/browser
import { AsgardeoAuthClient } from "@asgardeo/browser";
// Initialize the auth client
const authClient = new AsgardeoAuthClient({
signInRedirectURL: "https://localhost:3000",
clientID: "<your_client_id>",
baseUrl: "https://api.asgardeo.io/t/<org_name>"
});
// Sign in
authClient.signIn();
// Get user info after authentication
const userInfo = await authClient.getBasicUserInfo();
// Sign out
authClient.signOut();
Apache-2.0