promptStepUpAuth— One call that automatically picks the right verification method and shows Dynamic’s built-in UI. Recommended for most use cases.promptMfa/promptReauthenticate— Dynamic’s built-in UI with explicit control over which verification path is used.- Individual verify methods — Full headless control for building your own UI.
Prerequisites
DynamicContextProviderconfigured with your environment ID- At least one verification method enabled in your dashboard security settings
- Step-up authentication enabled for your environment
Approach 1: Automatic prompt (recommended)
promptStepUpAuth checks whether the user has MFA methods and automatically routes to the correct UI — passkey/TOTP for MFA users, OTP/wallet for non-MFA users.
How promptStepUpAuth routes
| User state | Verification method | UI shown |
|---|---|---|
| Has passkey + TOTP | Most recently created MFA method | Passkey prompt or TOTP input |
| Has passkey only | Passkey | Browser passkey prompt |
| Has TOTP only | TOTP | Dynamic’s TOTP code input |
| No MFA, has email | Email OTP | Dynamic’s re-auth method selection |
| No MFA, has SMS | SMS OTP | Dynamic’s re-auth method selection |
| No MFA, has wallet | Wallet signature | Dynamic’s re-auth method selection |
| No MFA, has social | Social OAuth | Dynamic’s re-auth method selection |
| Multiple non-MFA methods | User selects | Dynamic’s method chooser |
Approach 2: Dynamic’s built-in UI (explicit path)
UsepromptMfa or promptReauthenticate when you want to control which verification path is used while still using Dynamic’s UI:
- MFA prompt
- Re-auth prompt
Shows Dynamic’s MFA verification UI (passkey or TOTP). Only works when the user has registered MFA methods.
Approach 3: Headless (custom UI)
For full control over the UI, use the individual verify methods. You build the UI — the hook handles verification and token storage.Checking if step-up is required
checkStepUpAuth (recommended)
checkStepUpAuth is the recommended approach. It performs a server-authoritative check and returns both whether step-up is required and the available credentials, so you can route the user to the right verification method without extra API calls.
{ isRequired: false } without an API call), then calls the backend. On failure, it defaults to { isRequired: true } for safety.
isStepUpRequired (simple boolean)
Use isStepUpRequired if you only need a boolean and don’t need the available credentials:
true when step-up auth is enabled for the environment and no valid elevated token exists for the scope. Returns false if the token already exists or step-up is not enabled.
Email / SMS OTP
credentialId at call time or when initializing the hook:
Wallet signature (external wallets only)
Wallet-based step-up verification is only available for external wallets. Embedded wallets cannot be used for step-up authentication.Passkey MFA
TOTP MFA
Social (OAuth)
Recovery code
Error handling
All methods update the sharedstate object and throw on failure:
Full example: headless credential linking
Hook reference
See the fulluseStepUpAuthentication reference for all return values and parameter types.
External auth (Bring Your Own Auth)
If you use external auth (BYOA), your backend can issue elevated access tokens directly using theuseExternalAuth hook — no user interaction required. See the External Auth Step-Up guide.
Related
- Step-Up Authentication Overview — Concepts, scopes, token lifecycle
- External Auth Step-Up — Backend-issued elevated tokens for BYOA
- Action-Based MFA
- MFA Overview