Scaffold
--template frontend.
Environment Setup
Get your App ID from dashboard.privy.io and set it infrontend/.env:
frontend/.env
Provider Setup
Privy wraps your app withPrivyProvider and Privy’s wagmi connector (@privy-io/wagmi), giving you email, social, and embedded-wallet login. The chain comes from activeChain in lib/network.ts, which follows NEXT_PUBLIC_NETWORK — no per-provider chain edits needed.
components/Providers.tsx
ThemeProvider → PrivyProvider → QueryClientProvider → WagmiProvider
Note the wagmi createConfig is imported from @privy-io/wagmi (not wagmi), so Privy’s embedded wallets connect through wagmi automatically.
Inco SDK Integration
The Inco SDK works with thewalletClient provided by wagmi (which Privy supplies). The network-aware client comes from lib/network.ts:
hooks/useConfLottery.ts
Dependencies
| Package | Purpose |
|---|---|
@privy-io/react-auth | Privy authentication & embedded wallets |
@privy-io/wagmi | Privy ↔ wagmi connector |
@inco/lightning-js | Inco encryption/decryption |
wagmi | EVM wallet hooks |
viem | Ethereum utilities |