OnzAuth JavaScript SDK v1.0.26 (latest) for passwordless authentication using Email Magic Link and WebAuthN. It provides a simple popup or iframe-based login flow with automatic token storage in localStorage (access_token, id_token, refresh_token, expiry). The SDK is ESM-only (no CommonJS support) and requires a client ID from OnzAuth. It emits events ('authenticated', 'error', 'closed') and is designed for quick integration. Key differentiators: no callback URLs to configure, built-in WebAuthN support, and no password management. It is a client-side only library with a small API surface, released irregularly with bug fixes.
npm install onz-authNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Initializes OnzAuth, listens for authentication events, triggers a login popup, and logs the tokens. Also demonstrates error handling and logout.
Use the 'authenticated' event to get tokens; avoid reading from localStorage directly.
Set isIframe: true to use an iframe instead, which requires a container element.
Log in to OnzAuth dashboard > project settings > enable WebAuthN.
Use import statements or switch to the UMD script tag for non-module environments.
Use default import: `import onz from 'onz-auth';` then `new onz.Auth(...)`.
Listen to the 'authenticated' event and use `authResult.accessToken` (camelCase).
Provide clientID: 'your-client-id' in the Auth constructor options.
Set isIframe: true to use an iframe, or allow popups for your site.
No dependency data recorded yet.