Skip to main content
Dynamic provides embedded wallets with social login, email, MPC, and WebAuthn key custody. It exposes a viem WalletClient directly through primaryWallet.getWalletClient(), which slots straight into toStartaleSmartAccount as a signer.
Source: StartaleGroup/scs-aa-sdk. The flow below is the one used by the Startale super-app.

Install

1. Wrap the app in DynamicContextProvider

providers.tsx

2. Build the smart account from primaryWallet

Once the user is authenticated, useDynamicContext exposes primaryWallet. Guard the type with isEthereumWallet, then call getWalletClient() to get a viem WalletClient you can hand to the SDK.
useStartaleFromDynamic.ts

3. Send a sponsored UserOperation

The user does not need ETH; gas is sponsored by the paymaster you configured in the SCS Portal.

Common adjustments

Vary the index parameter passed to toStartaleSmartAccount. Each bigint value produces a different counterfactual address for the same signer.
Replace paymasterId with token in paymasterContext. See ERC-20 paymaster.
Dynamic ships server-only utilities through @dynamic-labs/sdk-react-core/server. Use those to derive the signer, then pass it to toStartaleSmartAccount exactly the same way.

Next steps

Privy integration

The same flow with Privy as the auth provider.

Smart account setup

Lift the smart account into a context provider.

Smart sessions

Reduce signature friction with scoped session keys.

Social recovery

Add guardian-based key rotation.