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
This hook provides a way for clients to prompt the user to authenticate with MFA via the Dynamic UI. It supports both the legacycreateMfaToken flow and the recommended requestedScopes flow for elevated access tokens.
The hook needs to be initialized within a child of DynamicContextProvider.
Parameters
| Property | Type | Description |
|---|---|---|
requestedScopes | TokenScope[] | Scopes to request an elevated access token for (recommended) |
createMfaToken | boolean | @deprecated — Create a single-use MFA token. Use requestedScopes instead. See migration guide. |