Dynamic provides embedded wallets with social login, email, MPC, and WebAuthn key custody. It exposes a viemDocumentation Index
Fetch the complete documentation index at: https://docs.startale.com/llms.txt
Use this file to discover all available pages before exploring further.
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
| Package | Why |
|---|---|
@startale-scs/aa-sdk | The AA SDK itself. |
viem | Chain and transport utilities. |
@dynamic-labs/sdk-react-core | Dynamic React provider and hooks. |
@dynamic-labs/ethereum | EVM connectors and the isEthereumWallet type guard. |
1. Wrap the app in DynamicContextProvider
providers.tsx
| Symbol | Source | Role |
|---|---|---|
DynamicContextProvider | @dynamic-labs/sdk-react-core | Top-level provider that exposes the user’s wallet, session, and login state. |
EthereumWalletConnectors | @dynamic-labs/ethereum | Enables EVM wallets (embedded and external) inside Dynamic. |
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
| Symbol | Source | Role |
|---|---|---|
useDynamicContext | @dynamic-labs/sdk-react-core | Hook exposing primaryWallet, session, and auth state. |
isEthereumWallet | @dynamic-labs/ethereum | Type guard ensuring primaryWallet exposes EVM methods. |
primaryWallet.getWalletClient() | Dynamic | Returns a viem WalletClient over the user’s embedded or external wallet. |
toStartaleSmartAccount | @startale-scs/aa-sdk | Builds the smart account from the wallet client. |
createSmartAccountClient | @startale-scs/aa-sdk | Wraps the account with bundler and paymaster for sending UserOperations. |
3. Send a sponsored UserOperation
Common adjustments
Multiple smart accounts per signer
Multiple smart accounts per signer
Vary the
index parameter passed to toStartaleSmartAccount. Each bigint value produces a different counterfactual address for the same signer.Pay gas in tokens instead of sponsoring
Pay gas in tokens instead of sponsoring
Replace
paymasterId with token in paymasterContext. See ERC-20 paymaster.Use Dynamic in non-React environments
Use Dynamic in non-React environments
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.