Skip to main content

Overview

You're reading Identity & Access Management 7.2.0. The newest release is 7.3.0, and Cloud has the newest features. Go to the newest release

The WSO2 Identity Server Browser SDK (@asgardeo/browser) adds authentication to single-page applications built with plain JavaScript or any framework that runs in the browser. It handles the OpenID Connect authorization code flow with PKCE, stores the session in the browser, and lets you call protected APIs with the user's access token.

tip

If you build with React, Vue, Next.js or Nuxt, use the framework SDK instead. Each one is built on this SDK and adds components and hooks for that framework.

Installation​

Use one of the following options to install the WSO2 Identity Server Browser SDK.

npm install @asgardeo/browser

Getting started​

Try out the WSO2 Identity Server JavaScript quickstart guide.

APIs​

The SDK provides the following APIs.

AsgardeoSPAClient​

AsgardeoSPAClient is the entry point of the SDK. Get an instance with AsgardeoSPAClient.getInstance(), configure it with initialize(), and use it to sign users in and out, read tokens and user information, and call protected APIs.

  • AsgardeoSPAClient – Methods for authentication, tokens, user information, HTTP requests and event hooks.
  • Configuration – The options that initialize() accepts.

Utilities​

  • hasAuthParamsInUrl() – Returns true when the current URL carries an authorization code, which means WSO2 Identity Server has redirected the user back to your app after sign-in.

Guides​

Was this page helpful?