Skip to main content

Recommended: JavaScript SDK with React Hooks

For new React apps, we recommend the JavaScript SDK with React Hooks (@dynamic-labs-sdk/react-hooks) instead of the legacy React SDK documented here. The JS SDK comes with many benefits such as a much smaller bundle size and other optimizations. Use the React quickstart (JavaScript SDK) to get started.

Summary

Hook for step-up authentication — requiring users to re-verify their identity before sensitive actions. Supports three usage patterns:
  • Automatic promptspromptStepUpAuth auto-selects MFA or re-auth and shows Dynamic’s UI. promptMfa and promptReauthenticate offer explicit path control.
  • Headless methodssendOtp, verifyOtp, verifyWallet, verifySocial, verifyPasskeyMfa, verifyTotpMfa, verifyRecoveryCode for building custom UIs.
After successful verification with requestedScopes, the elevated access token is stored in SDK state and automatically applied to subsequent API calls that require the scope. Must be used within a child of DynamicContextProvider.

Parameters

Return values

Prompt parameter types

Headless parameter types

Usage: automatic prompt

checkStepUpAuth is the recommended way to determine whether step-up is required. It performs a server-authoritative check and returns the available credentials, so you can route the user to the right verification method without extra API calls.

Usage: headless OTP

Last modified on June 25, 2026