Privy
Upgrade existing Privy wallets to Smart Wallets to enable gasless transactions (EVM & Solana), batching, token swaps, and more in under 10 minutes. Keep Privy for authentication, no wallet migration needed. Add our battle-tested transaction infrastructure using EIP-7702 to upgrade your wallets to Smart Wallets:
- #1 gas abstraction infrastructure on the market
- 370M+ sponsored transactions
- 99.9% SLAs
- Trusted by Worldcoin, JP Morgan, Gensyn, and more
- Solana gas sponsorship support
Don’t have social login or a wallet set up yet? Start with the Smart Wallet Quickstart to create one in minutes.
React
JavaScript
Setup
Follow these steps to integrate Privy with Smart Wallets.
Installation
Solana Support (Optional): To use useAlchemySolanaTransaction, install @solana/web3.js and import from @account-kit/privy-integration/solana. This dependency is optional—skip it if you only need EVM features.
Prerequisites: Get your keys (API key, Policy ID, Privy App ID)
- Alchemy API Key:
- Go to the Alchemy Dashboard
- Create or select an app and copy the API key
- Gas sponsorship Policy ID (Gas Manager):
- Create a gas sponsorship policy in the dashboard and copy its Policy ID
- Privy App ID:
- Go to the Privy Dashboard
- Create or select an app and copy the App ID
Both the Smart Wallets configuration and the gas sponsorship policy must be linked to the application behind your Alchemy API key for sponsorship to work.
1. Add AlchemyProvider
Props for AlchemyProvider:
apiKey|jwt|rpcUrl(pick a valid transport config)policyId(optional) for EVM gas sponsorshipsolanaPolicyId(optional) for Solana gas sponsorshipsolanaRpcUrl(optional) for Solana RPC URL (separate from EVM)disableSponsorship(optional) to opt-out per defaultaccountAuthMode(optional) -'eip7702'(default, recommended) or'owner'for a traditional smart account
2. Send Gasless Transactions
Control sponsorship per call:
3. Execute Token Swaps
4. Send Solana Transactions
Advanced: Access the Smart Wallet Client
Authorization Modes
The integration supports two modes via accountAuthMode:
'eip7702'(default, recommended): Uses EIP-7702 to delegate the Privy wallet to a smart account. No deployment needed, funds stay at the wallet address.'owner': Uses a traditional smart account with Privy wallet as owner. The smart account has a separate address. Use for environments without EIP-7702 support.
Getting the Smart Account Address (owner mode):
When using owner mode, access the smart account address (different from the Privy signer address):
Notes
- EVM: EIP-7702 (default) delegates your wallet to a smart account at send time. Alternatively, use
accountAuthMode="owner"for a traditional smart account. - Solana: Gas sponsorship via Alchemy’s fee payer service for Privy’s embedded Solana wallets.
- The hooks API mirrors Privy’s transaction hooks for easy migration.