This is the main provider for the Dynamic SDK. It is used to initialize the SDK and pass in settings. Learn how to install the SDK and add the context provider here.

Below we provide the complete list of props that can be passed to the DynamicContextProvider component. It’s a lot! Don’t worry though, we reference each prop in the respective tutorials, so you’ll learn about them in context as you complete different guides.

Settings

Passed in using the “settings” prop, available when you first initialize DynamicContextProvider in your App.

MethodDescription
accessDeniedMessagePrimary?: string;Custom main error message used when a wallet attempts to authenticate via Dynamic and is rejected because it does not have access. Defaults to “Access denied”
accessDeniedMessageSecondary?: string;Custom secondary error message used when a wallet attempts to authenticate via Dynamic and is rejected because it does not have access. Defaults to “We couldn’t find your wallet address on our access list of customers.”
accessDeniedButton?: AccessDeniedCustomButton;Custom secondary error button text and action when a wallet attempts to authenticate via Dynamic and is rejected because it does not have access. Defaults to “Try another method” and allow user to choose another login option. Please see: AccessDeniedCustomButton
coinbaseWalletPreference?: ‘all’ | ‘smartWalletOnly’ | ‘eoaOnly’;Determines which connection options users will see. Defaults to all. Please see: https://www.smartwallet.dev/sdk/makeWeb3Provider#options-optional
cssOverrides?: string | JSX.Element;Allows for custom CSS overrides via ShadowDom. Please see: Custom CSS
debugError?: boolean;When enabled, errors caught during the authentication step and their stack trace will be set in a state and displayed in the front end.
deepLinkPreference?: ‘native’ | ‘universal’;Used to control the type of deep link used when connecting a mobile wallet. Defaults to ‘native’. This is useful for example if your app is running in a webview of a native mobile app, and you want to be able to link out to any wallet without having to modify your iOS build config. In this case, you can set this to ‘universal’.
displaySiweStatement?: boolean;When enabled, this will show a message on terms of service and privacy policy in the signing message on the authentication step.
enableVisitTrackingOnConnectOnly?: boolean;When the Dynamic SDK is being used with auth mode = connect-only, we require this to be set to “true” to track visits of connected wallets in this environment.
environmentId: string;You will need to specify your app’s environment ID, which refers to a unique environment and its settings in Dynamic. To get your environment ID, go to dashboard’s API tab
eventsCallbacks?: DynamicEventsCallbacks;This prop allows custom event callbacks after important events during the authentication flows for Dynamic’s React SDK. For more information, please see the main SDK reference
evmNetworks?: []EvmNetworkAn array of EvmNetwork, more details in the custom networks guide.
initialAuthenticationMode?: AuthModeType;Sets the initial SDK authentication mode to either connect-only or connect-and-sign. connect-only does not require users to authenticate to prove ownership of their wallet. connect-and-sign will require an additional step for users to prove ownership of their wallet. Defaults to connect-and-sign. See also the setAuthMode method, which allows you to toggle this after the app has loaded.
logLevel?: keyof typeof LogLevel;The log level to use for client side logging with our SDK. Defaults to WARN
mobileExperience?: ‘in-app-browser’ | ‘redirect’Available from SDK V1.1. Controls the mobile user experience of connecting to native app wallets. Defaults to ‘in-app-browser’, meaning that we will deep link into the native wallet’s in-app browser. Set to ‘redirect’ for an experience where the user accepts prompts in the native wallet and is redirected back to the mobile browser. This is currently applicable to Phantom.
networkValidationMode?: ‘always’ | ‘sign-in’ | ‘never’Note: Supported only in connect-only. Defines how the Dynamic SDK will enforce the wallet network.
- always - requires the wallet to be on an enabled network while connecting and while the session is active
- sign-in - will only enforce the network on connect
- never - completely turn off the network validation. Defaults to sign-in.
newToWeb3WalletChainMap?: ChainToWalletMap;When provided, this is used in the Get your first wallet view in the wallet list modal. This can be helpful to steer initial customers who do not have a wallet to download and use a specific chain and wallet.
onboardingImageUrl?: string;When provided, this image will be shown during the customer information capture step after a wallet successfully authenticates with Dynamic and the environment requires additional information from the user.
policiesConsentInnerComponent?: ReactNode | ReactNode[];For environments with the username setting enabled, you will need to pass in a value for this prop to show a custom prompt or label for the policies contest checkboxes displayed during customer information capture after signing.
privacyPolicyUrl?: string;When provided, this will display a privacy policy URL on the signing step. This should be set to a URL of your organization’s privacy policy web page.
recommendedWallets: RecommendedWallet[];Available from V1.2 only. An array of wallet keys that will be recommended to the user. See more in our section on recommending wallets.
shadowDOMEnabled?: boolean;Shadow DOM allows the SDK to look as intended wherever it is hosted and it plays nicely with your existing styling system. For more information, please see: Custom CSS
signWithEmailWalletName?: string;Wallet key to set a custodial wallet as a sign in with email button
siweStatement?: string;When provided, this custom message will be shown on the message to sign for the wallet signing step.
termsOfServiceUrl?: string;When provided, this will display a terms of service URL on the signing step. This should be set to a URL of your organization’s terms of service web page.
walletConnectors?: walletConnector[]When provided, will enable whatever connectors you pass so that your end user can signup/login using those wallets. For the list of available connectors, see the walletConnectors section below.
walletConnectorExtensions?: []WalletConnectorExtensionCurrently only used to enable Ethers instead of Viem which is the default, for example see examples section below. For more info on Ethers instead of viem please see here
walletConnectPreferredChainsRelevant to Wallet Connect only, used to determine which chains to establish a connection with first. The value must be an array containing CAIP-2 chain ID’s. The format for this is {namespace-goes-here}:{reference-goes-here}. Currently we only support Ethereum, so it will always be eip155:{reference-goes-here}. For example, Ethereum mainnet being [‘eip155:1’]
walletsFilter?: (options: WalletOption[]) => WalletOption[];When specified, this is a custom function that allows clients of Dynamic SDK to filter out wallet options based on a function on the wallet options. For example: walletsFilter: (wallets) => wallets.filter((w) => w.key !== “walletx”) will exclude walletx from showing up on the wallet list.
bridgeChains?: bridgeChains(Only use with bridging) Which chains should be used for bridging.
socialProvidersFilter?: (providers: SocialOAuthProvider[]) => SocialOAuthProvider[];When specified, this is a custom function that allows clients of Dynamic SDK using social auth to filter or modify the order of the social options displayed to the user. For example, we can only show github oauth option: socialProvidersFilter: (providers) => ([‘github’]).
overrides: {views: SdkView[]}Used only for passing in Views right now. You can find examples in the view page previously mentioned or a more complete example here.
enableConnectOnlyFallback?: booleanWhen true, enables the SDK to fallback to wallet connect-only auth mode if a connection to our servers is not possible. Available in version 1.1 and above.