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 prompts —
promptStepUpAuthauto-selects MFA or re-auth and shows Dynamic’s UI.promptMfaandpromptReauthenticateoffer explicit path control. - Headless methods —
sendOtp,verifyOtp,verifyWallet,verifySocial,verifyPasskeyMfa,verifyTotpMfa,verifyRecoveryCodefor building custom UIs.
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
Usage: checkStepUpAuth (recommended)
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.