Expo and mobile
Preserve the application binding through send, verify and session refresh. Keep credentials out of distributed apps.
Client-bound OTP
Use the existing shared Expo adapter inside this monorepo. The client ID must belong to your application's public client. Preserve app, client ID and delivery channel across both calls.
Expo · typescript
import { createAuthClient } from "@py-mono/auth";
const auth = createAuthClient("https://auth.example.com");
const binding = { app: "your-app", client_id: "your-mobile-client",
channel: "sms" as const };
await auth.sendOtp({ ...binding, phone: "+15550000123" });
const tokens = await auth.verifyOtp({ ...binding,
phone: "+15550000123", otp: enteredCode });
// Persist with the shared runtime / native SecureStore adapter.Use the system browser for OAuth
The OIDC adapter validates discovered issuer and protocol URLs, supports resource indicators on authorization, exchange and refresh, and rejects confidential secrets. Save the transaction's verifier and state and validate the returned issuer, state and registered callback before exchange.
Native storage uses SecureStore. The legacy web storage adapter uses localStorage; prefer a backend cookie session for web applications. The removed OAuth password grant fails before transport. Existing direct password login is a separate, explicitly client-bound compatibility path.