Viem Integration
Replace local private keys with Emblem remote signing for viem/wagmi applications.
📖 Related Documentation
Before (Local Private Key)
TY
before.tsLoading...
After (Emblem Remote Signer)
TY
after.tsLoading...
React/Next.js Usage
When using @emblemvault/emblem-auth-react, access the authenticated SDK via the useEmblemAuth() hook:
TS
SignMessage.tsxLoading...
Supported Operations
The account returned by toViemAccount() supports all standard viem account operations:
Message Signing
TY
sign-message.tsLoading...
Typed Data Signing (EIP-712)
TY
sign-typed-data.tsLoading...
Transaction Sending
TY
send-transaction.tsLoading...
Complete Example
TY
complete-example.tsLoading...
Account Interface
The returned account object implements viem's LocalAccount interface:
address: Hex
type: 'local'
source: 'custom'
signMessage(message): Promise<Hex>
signTypedData(typedData): Promise<Hex>
signTransaction(tx, opts?): Promise<Hex>
Benefits of Emblem Integration
- • No private key exposure - Keys stay secure in Emblem Vault
- • Multi-chain support - Use the same vault across EVM chains
- • Drop-in replacement - Works with existing viem/wagmi code
- • Compatible with wagmi - Can be used as a custom connector
- • TypeScript native - Full type safety and IntelliSense