Quickstart — Vanilla JS
Plain `new AuthClient(...)` for non-React frontends.
For Vue, Angular, Svelte, plain HTML, React Native, or anywhere else.
1. Install
No React, no NestJS dependencies. Works in browsers, Node, React Native, Cloudflare Workers, Deno, Bun.
2. Construct the client
3. Sign up / log in
The client persists tokens to local storage (per the adapter you picked) and starts the auto-refresh loop.
4. Make authenticated requests
For your own backend calls, just attach the access token:
Or share the same httpAdapter across the auth client and your app:
5. Subscribe to events
6. Vue example
7. React Native
Replace the storage adapter with one wrapping AsyncStorage:
Everything else (login, refresh, MFA flows) is identical.
What's next
AuthClient— every method.- Storage adapters.
- HTTP adapters.