Skip to main content
A complete Next.js (App Router) project wiring Privy embedded wallets to Cloak. The step-by-step explanation is in the Privy guide; this page is the code. Built with next build against @privy-io/react-auth 3.52.1 and @cloak.dev/sdk 0.2.20.

Install

@stripe/stripe-js is a dependency of a Privy module that webpack resolves at build time. Without it, next build fails with Can't resolve '@stripe/stripe-js'.
.env.local
In the Privy dashboard, enable Solana embedded wallets and the login methods you use.

Files

privy/providers.tsx
privy/use-cloak.ts
privy/private-balance.tsx
app/page.tsx

What happens