From V0.19 to V1

This upgrade guide is specific to implementing the SDK itself, you can also find the features that ship with V1 here.

Breaking Changes

userWallets hooks

  • connectedWallets , secondaryWallets and linkedWallets all been removed in favor of userWallets hook. See here for more info.
import { useDynamicContext, getNetwork } from '@dynamic-labs/sdk-react-core';

const App = () => {
const { connectedWallets } = useDynamicContext();

useEffect(() => {
  connectedWallets.forEach(async ({ connector }) => {
  const network = await getNetwork(connector);
        ...
      });
}, [connectedWallets]);

...
}

EthereumSmartWalletConnectors -> ZeroDevSmartWalletConnectors

  • (v1 alpha -> v1) EthereumSmartWalletConnectors is now renamed to ZeroDevSmartWalletConnectors. You use this connector when you want to use AA wallets.
import {DynamicContextProvider} from "@dynamic-labs/sdk-react-core";
import { EthereumWalletConnectors } from '@dynamic-labs/ethereum';
import { ZeroDevSmartWalletConnectors } from '@dynamic-labs/ethereum-aa';

const App = () => (

  <DynamicContextProvider
    settings={{
      ...
      walletConnectors: [ EthereumWalletConnectors, ZeroDevSmartWalletConnectors ],
      ...
    }}>
    <DynamicWidget />
  </DynamicContextProvider>
);

export default App;

wallets -> walletConnectorOptions

  • Wallets property returned by useDynamicContext now renamed to walletConnectorOptions
import { useDynamicContext } from "@dynamic-labs/sdk-react-core";

const App = () => {
const { walletConnectorOptions } = useDynamicContext();
return (

<div>
  {walletConnectorOptions.map((wallet) => (
    <div>{wallet.name}</div>
  ))}
</div>
); };

export default App
;````

</Tab >

<Tab title="Before">
```jsx
import { useDynamicContext } from "@dynamic-labs/sdk-react-core";

const App = () => {
const { wallets } = useDynamicContext();
return (

<div>
  {wallets.map((wallet) => (
    <div>{wallet.name}</div>
  ))}
</div>
); };

export default App;

walletsByChain -> bridgeChains

  • walletsByChain has been renamed to bridgeChains
import { DynamicContextProvider } from "@dynamic-labs/sdk-react-core";

const App = () => {
return (

<DynamicContextProvider
  settings={{
    environmentId: 'ENV_ID',
    bridgeChains: [
      {
        chain: 'EVM',
      },
    ],
  }}
>
  <DynamicWidget />
</DynamicContextProvider>
); };

export default App;

Non Breaking Changes

  • Turnkey wallets are now created as Turnkey HD wallets.

New Features

  • eip6963 is now fully supported without any need for changes on your end!

  • Listening to changes in wallet connectors is now supported via a hook called useWalletConnectorEvent. See here for more info.

  • You can now trigger the onramp flow programmatically using the useFunding hook. See here for more info.

  • Support for account recovery via a hook has been added. See here for more info.

  • We now generate HD wallets by default, there is nothing you need to do to take advantage of this.

  • You can now generate AA wallets (SCWs) using our AA integrations. See here for more info.

  • All of the copy which is used in the UI from the SDK is now completely editable. See here for more info.

  • You can control what kind of signup/login options are shown in your UI on a programmatic basis regardless of what is enabled in the dashboard. See here for more info.

  • Embedded wallets has been split up into the generation step and the claim step which means you can now give a user a wallet but without them adding a passkey until they make their first transaction. See here for more info.

  • Along the same lines as above, you can also pregenerate a wallet for a user without any interaction from them by using our API directly. See here for more info.

  • Webhooks are now offered out of the box! You do not need to make any SDK changes to take advantage of this. See here for more info.

From V0.18 to V0.19

Summary

This upgrade guide is specific to implementing the SDK itself, you can also find the features that ship with V19 here.

There are a number of breaking changes in v0.19, mainly to the way the SDK is structured. To upgrade you should follow three steps, which are outlined in the breaking changes section below.

1

Switch to sdk-react-core

Uninstall sdk-react (if used) and install the latest sdk-react-core.

3

Viem as default

If you’re happy for Viem to be the default instead of Ethers, do nothing. Otherwise, use the Ethers extension.

Breaking Changes

sdk-react -> sdk-react-core

Previously you could use the SDK in two ways. The first was by installing sdk-react which came with all of the possible WalletConnectors pre-bundled. The second was by installing sdk-react-core and then adding WalletConnectors yourself alongside it.

While the first was helpful in getting started, the general feedback was that the bundle size was too large. So we’ve decided to remove the sdk-react package and make sdk-react-core the main way of installing the SDK.

To get started in this way, you should uninstall sdk-react and install sdk-react-core instead. If you’re already using sdk-react-core, it’s worth upgrading it to the latest version.

npm uninstall @dynamic-labs/sdk-react

npm install @dynamic-labs/sdk-react-core

WalletConnectors

As mentioned above, sdk-react-core doesn’t come with any WalletConnectors pre-bundled.

There are also no more all packages available.

You should install them according to the table below.

Package NameChainWalletConnector to include
@dynamic-labs/ethereumEVMEthereumWalletConnectors
@dynamic-labs/algorandALGOAlgorandWalletConnectors
@dynamic-labs/solanaSOLSolanaWalletConnectors
@dynamic-labs/flowFLOWFlowWalletConnectors
@dynamic-labs/starknetSTARKStarknetWalletConnectors
@dynamic-labs/cosmosCOSMOSCosmosWalletConnectors
EVM Addon Wallets
Package NameWhich WalletsWalletConnector to include
@dynamic-labs/magicmagicMagicWalletConnectors
@dynamic-labs/blocto-evmbloctoBloctoEvmWalletConnectors

Magic and Blocto were previously available via the ethereum-all package which is now deprecated, please note that you will no longer get Magic & Blocto with the ethereum package - use the above packages instead.

Here’s an example for Ethereum & Flow:

npm install @dynamic-labs/ethereum @dynamic-labs/flow

Using WalletConnectors

Using WalletConnectors looks like the following (ethereum and flow example):

import { EthereumWalletConnectors } from "@dynamic-labs/ethereum";
import { FlowWalletConnectors } from "@dynamic-labs/flow";


const App = () => (
  <DynamicContextProvider
     settings={{
       ...
       walletConnectors: [ EthereumWalletConnectors, FlowWalletConnectors ],
  		 ...
    }}>
    <DynamicWidget />
  </DynamicContextProvider>
);

export default App;

Ethers -> Viem

We’ve also changed the way we interact with the BlockChain RPC and the Wallet. Previously we used Ethers.js by default and gave you a Viem version if you needed, but with Viem now rising further in popularity and functionality, we’ve now moved to Viem as the default library.

Please not that since Viem is now a peer dependancy of the SDK, it will be installed even if you use Ethers.

If you’re happy to use Viem, this should not have much of an effect on you. If you would still like to use Ethers or do not want to migrate your own application to using Viem, we have provided an extension for accessing Ethers within our Connectors:

npm i @dynamic-labs/ethers-v5
import { EthersExtension } from '@dynamic-labs/ethers-v5'

return (
  <DynamicContextProvider
    settings={{
      environmentId: 'XXXXX',
      walletConnectorExtensions: [EthersExtension],
    }}
  >
    <App />
  </DynamicContextProvider>
)

You can then access the signer like so:

const signer = await primaryWallet.connector.ethers?.getSigner()

If you want to use Ethers V6 instead of V5, it’s as simple as using @dynamic-labs/ethers-v6 instead of @dynamic-labs/ethers-v5.

WalletConnector methods naming

Since the move to Viem, we have also updated the method names on the WalletConnector as they previously used Ethers Terminology.

V0.18V0.19
getWeb3Provider()getPublicClient()
getRpcProvider()getWalletClient()

onConnectSuccess -> onConnect

We’ve also renamed the onConnectSuccess callback to onConnect.

WalletIcon

V0.18V0.19
<WalletIcon walletName={normalizeWalletName(walletConnector.name)}<WalletIcon walletKey={walletConnector.key}
npm i @dynamic-labs/wallet-book
import { useDynamicContext } from '@dynamic-labs/sdk-react-core'
import { WalletIcon } from '@dynamic-labs/wallet-book'

const { primaryWallet } = useDynamicContext()

return <WalletIcon walletKey={primaryWallet.connector.key} />

Non-breaking changes

New Callbacks added

  • onSignedMessage

  • onEmailVerificationSuccess (since replaced with “onotpverificationresult”)

  • onEmailVerificationFailure (since replaced with “onotpverificationresult”)

New Hooks added

From V0.17 to V0.18

Summary

There are no major breaking changes in V0.18. There are a few minor changes in V0.18.x, which you can find below.

You can also find the features that ship with V0.18 here.

Updates to API URIs

Our api is served now from www.dynamicauth.com instead of www.dynamic.xyz, which should reduce issues for end users behind specific firewall providers.. Please update any rules and validations that you might have on the dynamic.xyz URIs.

Changes to ​​DynamicContextProvider

Prop rename from: displayTermsOfService to: displaySiweStatement.

This affects DynamicContextProvider. If you’re passing displayTermsOfService to DynamicContextProvider, you should update your code like so:


Multiwallet prop has been removed.

If you have multiwallet enabled please enable it in your dashboard:

Changes to DynamicContext

ConnectedWallets

connectedWallets now represents all the wallets that are actually connected

const { connectedWallets } = useDynamicContext()
LinkedWallets

Used to be called ConnectedWallets now only represents that wallets that are linked to the account (only relevant to connect-and-auth flow)

const { linkedWallets } = useDynamicContext()

Updates to Walletbook

If you have a dependancy on @dynamic-labs/walletbook < v0.19, please remove it from your dependancies as it should now be included by default alongside the sdk-react package.

From V0.16 to V0.17

Breaking Changes

  • In favor of supporting MagicLink Wallets we removed the support for Fortmatic.

  • chainName on EvmNetwork is deprecated in favor of name. If you’re passing evmNetworks to DynamicContextProvider or DynamicWagmiConnector, you should update your code like so:

<DynamicContextProvider
  settings={{
    environmentId: 'YOUR_ENV_ID',
    evmNetworks: [
      {
        blockExplorerUrls: [],
        chainId: 1,
        iconUrls: [],
     -  chainName: 'Ethereum',
     +  name: 'Ethereum',
        nativeCurrency: {
          decimals: 18,
          name: 'Ether',
          symbol: 'ETH',
        },
        networkId: 1,
        rpcUrls: [],
      },
    ],
  }}
>
  <HomePage />
</DynamicContextProvider>

chainName is a deprecated field on the EVMchain (and will be removed on v18), but if you pass a custom EVM network you will need to change to name.

  • the multiWallet prop on DynamicContextProvider is deprecated in favor of the Dashboard settings. See here for more info.

From V0.15 to V0.16

Breaking Change

  • With the introduction of email login and social verification we moved to verifiedCredentials instead of blockchainAccounts. blockChainAccounts was removed from the user’s object.

From V0.14 to V0.15

Breaking Change

  • Based on your feedback, our team has been hard at work to completely redesign our SDK UI and move it to ShadowDom. Now in addition, to the default customizations that we provide in the our admin dashboard, you have full control and ability to customize any element in the Dynamic’s SDK to your liking. If you previously used any CSS Classes to override our previous SDK modal you will need to update them to the current CSS classes. For more info see: Custom CSS.

  • As we introduced more callbacks, we now require all the callbacks to be nested under events. See Callbacks for more info.

  • We removed user.walletPublicKey, instead please use primaryWallet.address, which you can access from useDynamicContext.