loading
Preparing LoginRadius developer resources
Mission: Help enterprises accelerate digital transformation with our fully-managed Customer IAM technology.
Skip to main content

JS SDK Demos (npm)

Reference apps that consume @loginradius/loginradius-js via npm. The JS SDK is a single-bundle SDK that ships pre-built UI on top of the auth controller. Drop it into any frontend and call sdk.init('auth', { container: '#my-div' }).

Available Demos

DemoStackDefault dev port
playgroundVite + TypeScript5173
angularAngular 214200
nextNext.js 16 (App Router)3000
nuxtNuxt 4 + Nuxt UI3000
solidSolidJS + Vite5173
svelteSvelte 5 + Vite5173
vueVue 3 + Vite5173

What the JS SDK Gives You

  • A single LoginRadiusSDK class that wraps the core controller and ships pre-built UI
  • sdk.init('auth' | 'login' | 'register' | 'profileEditor' | 'workflow', options) to mount any flow into a DOM container
  • sdk.$hooks.call('mapValidationMessages' | 'mapErrorMessages', overrides) for customizing copy
  • sdk.controller.* for raw access to the underlying auth methods

Use this SDK when you want a fast integration and don't need React-specific hooks or components.

Quick Start

cd loginradius-js/vue # or next, nuxt, svelte, solid, angular, playground
pnpm install
cp .env.example .env.local # see Configuration below
pnpm dev

Configuration

DemoVar prefixFile
playground, solid, svelte, vueVITE_LOGINRADIUS_*.env.local
nextNEXT_PUBLIC_LOGINRADIUS_*.env.local
nuxtNUXT_PUBLIC_LOGINRADIUS_*.env
angularn/asrc/environments/environment.ts
VITE_LOGINRADIUS_API_KEY=your-api-key
VITE_LOGINRADIUS_SOTT=your-sott

Common Snippet

import { LoginRadiusSDK } from '@loginradius/loginradius-js';

const sdk = new LoginRadiusSDK({
apiKey: import.meta.env.VITE_LOGINRADIUS_API_KEY,
sott: import.meta.env.VITE_LOGINRADIUS_SOTT,
callbackUrl: window.location.origin,
});

sdk.init('auth', {
container: 'lr-auth',
onSuccess: (res) => console.log('auth success', res),
onError: (err) => console.error('auth error', err),
});