Native Clerk authentication for iOS and Android. The host app embeds Clerk’s native SDK, your web app drives it from JavaScript throughDocumentation Index
Fetch the complete documentation index at: https://setup.despia.com/llms.txt
Use this file to discover all available pages before exploring further.
despia() calls and two global hooks. Optional, for apps that need Keychain or Keystore backed sessions, native Sign in with Apple, offline cold-launch, or zero-config server-side auth. Web auth providers like Supabase, Firebase, NextAuth, Auth0, or Clerk’s own web SDK work in Despia out of the box without this.
Requires iOS 17 or Android API 24, and a publishable key from your Clerk Dashboard.
Installation
- Bundle
- CDN
How it works
The bridge exposes two globals onwindow. You define window.onClerkEvent to receive every event, the bridge writes window.clerkJWT with the current session token and auto-refreshes it every 50 seconds.
| Global | Type | Lifecycle | |
|---|---|---|---|
window.onClerkEvent | (payload) => void | You define. Receives every event. | |
window.clerkJWT | `string | null` | Bridge writes. Auto-refreshed every 50s. null when signed out. |
Configure
Initialize the bridge with your Clerk publishable key on every page load. Same-key calls re-emitready as a no-op. Different keys switch tenant and clear the secure session store.
status is configured, already_configured, or reconfigured. Errors emit with event: "configure": invalid_key, reconfigure_in_progress, reconfigure_failed, unsupported_os, sdk_not_linked.
Next
Auth Methods
Auth Sheet, password, OAuth, Apple, email code, phone code, passkeys, MFA, SSO.
Sessions
Read who’s signed in and the auto-refreshed JWT.
Backend
Next.js and TanStack authenticated on first paint.
Account
User Profile, sign-out, attribution, multi-tenant.
Reference
Events, status values, error codes, quirks.
Resources
NPM Package
despia-native