Before you begin
Before you begin, ensure that you’ve:- Created a Circle Console account and a client key for the modular wallets SDK: Console → Keys → Create a key → Client Key.
- Created a Dynamic Dashboard account and obtained your Environment ID.
- Enabled email login and embedded wallets (WaaS) in your Dynamic environment, and added Arc Testnet as a supported network. The examples below target Arc Testnet.
- Installed Node.js 22+ and the modular wallets Web SDK.
Steps
Configure environment variables
Make your Circle client key, modular wallets backend URL, and Dynamic
environment ID available to your app. The backend URL is the same for every app:
https://modular-sdk.circle.com/v1/rpc/w3s/buidl.Web SDK (TypeScript)
Install the Dynamic headless SDK packages
Dynamic’s headless SDK (
@dynamic-labs-sdk/client) works with any web
framework. Install it alongside the Circle modular wallets SDK and viem.Initialize the Dynamic client
Create a Dynamic client, register the EVM extension, and wait for initialization
before reading wallet accounts. If Dynamic’s network data for Arc Testnet omits
RPC URLs, supply them in a
networkData transformer.Web SDK (TypeScript)
Authenticate the user
Sign the user in with any Dynamic-supported auth flow. The snippet below uses
email OTP; social login and external wallet connection work the same way once
Dynamic reports an authenticated session.After authentication, create an embedded EVM wallet on your target chain if the
user does not have one yet.
Web SDK (TypeScript)
Create a transport
The modular transport routes user operations through Circle’s bundler and
paymaster for the blockchain you target. The example below uses Arc Testnet.
Web SDK (TypeScript)
Create the bundler client and smart account
Switch the Dynamic wallet to your target network, convert it to a viem local
account, and pass it as the
owner to toCircleSmartAccount. The bundler
client submits user operations through the MSCA; every operation is signed by
the Dynamic-managed EOA automatically.Web SDK (TypeScript)
Next steps
- Transfer tokens from the wallet.
- Sign and verify messages for Sign-In With Ethereum (SIWE) or EIP-712 typed data.
- Batch and parallel user operations for multi-call patterns.