window.onClerkEvent. Configure first.
Successful sign-in flows emit:
status is complete when the session is established, otherwise a raw Clerk status (needs_first_factor, needs_second_factor, needs_new_password, needs_identifier, missing_requirements, abandoned) meaning the flow needs another step. The same applies to signUp, emailCode, phoneCode, secondFactor, resetPassword, and ticket events, when status is complete the payload carries userId and (if a primary email exists) emailAddress, the JWT refresher starts, and window.clerkJWT populates shortly after.
Multi-step flows (email code, phone code, password reset, MFA) hold one pending sign-in in memory at a time. Starting one cancels any other in flight, and calling a later step before the start step returns missing_state.
Auth Sheet
Clerk’s prebuilt sign-in sheet, native UI covering email/password, OAuth, magic links, MFA, password reset, and passkeys.On Android
mode is accepted but currently inert, the sheet always opens the combined sign-in-or-up screen. iOS honours all three modes. See Platform support.authview when the sheet closes:
status: "complete" fires when the sheet closes with a different user signed in than before, the payload carries userId and emailAddress (the latter only if the account has a primary email, a phone or username-only account omits it). This also covers switching accounts mid-sheet, an already-signed-in user who signs into a different account inside the sheet gets complete with the new userId. status: "dismissed" fires when the sheet closed without a user-identity change (swipe-down, cancel, or an already-signed-in user opening and closing the sheet without switching accounts).
complete the JWT refresher starts and populates window.clerkJWT a tick later, not in the same callback. If you need the token in the same handler, force a refresh with clerk://token:
window.clerkJWT on the next API call is enough, the refresher keeps it fresh thereafter.
Errors: not_configured, unsupported_os, sdk_not_linked.
Password
Manual password sign-in or sign-up. Sign-in accepts email, username, or phone as the identifier. Sign-up requires a password plus at least one of email, username, or phone.signIn or signUp. Errors: missing_params, auth_failed.
OAuth
System-browser OAuth viaASWebAuthenticationSession (iOS) or Chrome Custom Tabs (Android).
signIn or signUp depending on whether the external account is new.
Providers: google, github, microsoft, gitlab, discord, twitter (alias x), twitch, linkedin, linkedin_oidc, facebook, tiktok, dropbox, atlassian, bitbucket, notion, line, instagram, coinbase, spotify, xero, box, slack, linear, hubspot, huggingface, vercel. Anything else routes to Clerk’s custom provider handler.
Errors: missing_params, use_native_apple, oauth_failed.
On Android,
ephemeral=true is accepted but currently inert (Chrome Custom Tabs has no private-session option). Unrecognized provider values run as Clerk’s generic custom strategy rather than carrying the specific custom provider key. See Platform support.Apple Sign In
NativeASAuthorizationController sheet on iOS, Apple OAuth via Chrome Custom Tabs on Android. JS contract is identical.
signIn or signUp. Errors: apple_failed.
Email Code
Two-step email OTP for sign-in or sign-up. Verify must follow start in the same app session.emailCode with status: "code_sent" after start, then complete (or a needs_* status) after verify.
Errors: missing_params, missing_state (verify before start), unknown_action, email_code_failed.
Phone Code
Two-step SMS OTP. Verify must follow start in the same app session. Shares pending-flow state with Email Code, only one OTP flow runs at a time.phoneCode with status: "code_sent" after start, then complete (or a needs_* status) after verify.
Errors: missing_params, missing_state (verify before start), unknown_action, phone_code_failed.
Passkeys
Native passkey UI.signin uses an existing passkey, register adds one to the current signed-in user.
signin emits a normal signIn event. register emits:
not_signed_in, unknown_action, passkey_failed.
MFA
Continues a sign-in whose first-factor result came back withstatus: "needs_second_factor". Consumes the pending sign-in.
action=prepare first to send the code.
Emits secondFactor with status: "code_sent" after prepare, then complete (or another needs_* status) after verify.
Errors: missing_state (no pending sign-in to continue), missing_params, prepare_not_needed (called prepare on a strategy that doesn’t need one), second_factor_failed.
Enterprise SSO
SAML / OIDC enterprise sign-in. Routes the user to their organization’s identity provider based on their email domain.signIn or signUp depending on whether the user is new to the organization.
Errors emit with event: "enterpriseSSO": missing_params, enterprise_sso_failed.
On Android,
ephemeral=true is accepted but currently inert. See Platform support.Reset Password
Three-step password reset. The pending sign-in lives in memory across steps, all three must run in the same app session.resetPassword with status: "code_sent" → needs_new_password → complete.
Errors: missing_params, missing_state, unknown_action, reset_password_failed.
Magic Link Ticket
Native equivalent of an email magic link. Clerk’s mobile SDKs don’t include an email-link sign-in strategy, so the bridge takes a one-time ticket your backend mints through Clerk’s API. Your backend emails or pushes a deep link carrying the ticket, the app forwards the ticket to the bridge to complete sign-in.signIn event with the result status.
Errors emit with event: "ticket": missing_params, ticket_failed.
Resources
NPM Package
despia-native