npm / @supabase/auth-js
@supabase/auth-js
What changed in @supabase/auth-js 2, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.
3 breaking2 deprecations18 new APIs and options3 behavior and defaults60 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli init@supabase/auth-js 286 changes
Breaking changes 3
Node.js 20 support is dropped, so developers using this package need a different Node.js version.
Lowers the default lockAcquireTimeout to 5 seconds.
Node.js 20+ is required.
Deprecations 2
The experimental passkey opt-in is deprecated because the passkey API is enabled by default.
Warns when the deprecated lock option is used.
New APIs and options 18
signInWithPasskey forwards options.mediation to navigator.credentials.get.
Adds an API for MFA recovery codes.
Adds custom_claims_allowlist to the custom providers admin API.
Introduces dispose() alongside a commit guard as the navigator.locks-based mutex is removed.
Adds WebAuthn registration, authentication, and management for passkeys.
Adds admin CRUD methods for custom OIDC/OAuth providers.
Supports custom providers via the custom: prefix in the Provider type.
Adds token_endpoint_auth_method to OAuth client create and update.
Adds currentPassword to the UserAttributes type.
Add the skipAutoInitialize option to prevent constructor auto-init.
Adds an optional jwt parameter to getAuthenticatorAssuranceLevel.
A configurable lock acquisition timeout was added to prevent deadlocks.
The X OAuth 2.0 provider is now supported.
The detectSessionInUrl option now allows a custom predicate, letting developers customize session detection in the URL.
Adds endpoints for listing and revoking OAuth grants.
Errors can now be thrown instead of returned.
Adds API calls for managing OAuth 2.1 authorization consent.
Adds support for updating OAuth clients.
Behavior and default changes 3
The passkey API is enabled by default, so developers no longer need to opt in experimentally.
auth.resend() uses a consistent confirmation flow.
AMR claims now support string arrays.
Fixes and other changes 60
Fixes an empty object being miscast to
User.Global sign out no longer clears the local session when the server fails to log out.
Returns the stored session when a refresh loses to another tab.
Silences commit-guard-discarded refreshes during initial session handling.
An unverified factor is unenrolled after a failed registration.
Converts a stolen-lock AbortError when acquireTimeout is 0.
Prevents refresh rejections from going unhandled.
Preserves the error message for 5xx errors.
Accepts uppercase UUIDs when validating UUIDs.
PKCE verifiers are stored in per-flow slots so they survive overlapping flows.
Reduces console noise from stale refresh tokens.
Aborted and transient fetch failures are logged at warn instead of console.error.
Preserves the PKCE verifier.
Clears the local session when signout fails.
Init-time notifications are deferred until initializePromise resolves.
Preserves a valid session when refresh fails, including during cooldown repeat failures.
AuthApiError instances already returned through the contract are no longer also logged with console.error.
Returns AuthInvalidJwtError for expired JWTs.
Recognizes redirects containing ?error= in the implicit grant gate.
Reverts the change that encoded the client ID in OAuth requests.
Restores the user response from signup.
Client IDs are now encoded in OAuth requests.
For email_change single-confirmation verification, returns null user and session.
getItemAsync now returns null when JSON parsing fails.
Enum-like unions are widened with (string & {}) for forward compatibility.
WebAuthnError now has toJSON for correct JSON serialization.
PKCE recovery flows now emit the PASSWORD_RECOVERY event.
Includes Cloudflare error codes in the network error code list, affecting how these errors are classified.
Adds toJSON to AuthError for correct JSON serialization.
Missing-session logging now uses console.warn instead of console.error.
Guards navigator lock stealing against a cascade when another request steals the lock.
Recovers from orphaned navigator locks using a steal fallback.
Fixes the UserAttributes type.
Resolves Promise.then() security errors in locks when running in Firefox content scripts.
Corrected OAuth authorization types to match API responses.
Fixes fallback naming in auth; the notes do not specify the affected name or behavior.
Handles uncaught promise rejections during initialization.
Clears local storage on signOut when the session is already missing.
Restores SSR OAuth functionality that was broken in v2.91.0.
Defers subscriber notification to prevent deadlock during exchangeCodeForSession.
Clarifies that updateUserById applies changes directly, helping developers understand its behavior.
The user type now includes the banned_until property.
The factor type now includes the last_challenged_at property.
The session is preserved when a magic link is clicked twice.
Calling stopAutoRefresh now clears the initial setTimeout.
Adds a helpful error when the PKCE code verifier is missing.
Navigator locks are skipped when persistSession is false.
The code verifier remains in storage during edge cases.
The getSession warning is suppressed when getUser is called first.
Minor fixes to OAuth types may affect how developers type OAuth-related code.
Uses Symbols for callback IDs to resolve Next.js 16 compatibility.
Adds automatic browser redirect to signInWithSSO.
Registration and authentication use direct attestation.
The UserAppMetadata interface now includes the providers type.
The webauthn parameter is optional, and registration parameters move to webauthn.
TypeScript types were added for documented JWT claims fields.
A warning is now emitted only if multiple clients share a storage-key.
Moves the session warning proxy from the session object to the user object.
Removes redirection from getAuthorizationDetails.
Handles a 204 No Content response when deleting an OAuth client.