Go to developer

Web SDK

Browser SDK for OAuth Verify (popup / redirect / PKCE). Uses publishable client id only.

On this page

Installation

Package @keyra/web-sdk · version 0.1.0 (from package metadata).

Bash
npm install git+https://github.com/Ciright-Inc/keyra-web-sdk.git

Runtime

BROWSER

Products supported

Method groups

Client Setup

  • createKeyraAuth() — Creates the browser OAuth Verify client. Uses publishable clientId and calls POST /oauth/authorize/init internally.

PKCE

  • generatePkce() — Asynchronously generates PKCE S256 material using Web Crypto.

Authorization

  • handleRedirectCallback() — Resumes redirect flow on redirectUri: validates state, exchanges code, clears transient storage.
  • verify() — Starts verification. mode auto picks popup on desktop and redirect on mobile UA.
  • verifyWithPopup() — Opens hosted KEYRA UI in a popup and completes token exchange in the opener.
  • verifyWithRedirect() — Full-page redirect to hosted UI. Persists PKCE verifier in sessionStorage, then navigates away.