@amisi-mobile-starter/auth
@amisi-mobile-starter/auth provides an adapter registry and runtime initialization. The native entry point registers mock and attempts to register firebase; the web defaults register only mock.
Initialize auth
tenantId?, useEmulator?: { host: string; port: number }, and emailVerificationActionCodeSettings?: FirebaseAuthTypes.ActionCodeSettings. Use { adapter: 'mock' } for the built-in in-memory adapter.
getActiveAuthAdapter() returns the active AuthAdapter or undefined.
Adapter contract
AuthSignInParams supports:
{ type: 'email_password'; email: string; password: string }{ type: 'custom_token'; token: string }{ type: 'google_id_token'; idToken: string }{ type: 'apple_id_token'; idToken: string; nonce?: string }
AuthSignUpParams is { type: 'email_password'; email: string; password: string }.
Provider and hooks
AuthProvider accepts children and optional config. It initializes that config, subscribes to session changes, and exposes adapter, session, user, loading, isAuthenticated, signIn, signUp, signOut, sendPasswordResetEmail, sendEmailVerification, applyActionCode, reloadUser, getAccessToken, and refresh.
useAuth() delegates to useAuthContext() and must run inside AuthProvider. Both hooks and the provider are exported from the package entry point.
The Firebase adapter maps Firebase users to AuthUser, sends configured email-verification action settings, applies action codes, reloads the current user, and returns a Firebase ID token from getAccessToken().