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.This guide is currently React only.
Setup
- Register a Circle Developer account. In the Configurator section of the Circle Developer Console under Modular Wallets, grab your Client URL, and create a new Client Key.
- Register a Dynamic account. Grab your environment ID from the SDK & API keys page of the Dynamic Dashboard.
- In the Chains and Networks page of the Dynamic Dashboard, enable the EVM network(s) you want to use with Circle. In this example we use Polygon Amoy, so please make sure that’s enabled.
Code Implementation
For this guide, we’ll be using React and TypeScript. If you don’t already have an app created, check out our Quickstart guide.- You’ll need to install the Circle SDK dependency by running:
- Create a
.envfile in the project directory and add the following environment variables:
REACT_APP_ with NEXT_PUBLIC_ and for Vite, use VITE_.
-
In
src/App.js, replace the value for theenvironmentIdwith your own Dynamic environment ID. -
Navigate to
src/Main.js, and replace the current contents with the following:
- Run the app by executing:

- Add a valid address to send to, and an amount that is within your wallet’s balance plus a reasonable gas fee. Click on the “Send” button, and you should see the transaction hash in the UI!
Troubleshooting
Problem:Execution reverted for an unknown reason
Solution: This is most likely due to the account not having enough ETH to pay for the transfer, make sure your smart wallet is funded!