chore: upgrade @privy-io/react-auth v1.88.4 → v3.31.0

Merged
SW
5mo ago
+1567-1379

Why

Phase 1a of recoupable/chat#1801 — the prerequisite for cross-subdomain auth. chat was two majors behind marketing (^3.31.0); HttpOnly cookie sessions (which give one Privy session across *.recoupable.com) are only reliable on a cookie-capable SDK. This bumps chat to the same ^3.31.0 marketing runs.

Migration surface is tiny (audited)

Every @privy-io/react-auth import in chat is usePrivy (47 sites) or the PrivyProvider component (1) — nothing else. None of the v3-renamed/removed APIs are used:

  • ❌ useLoginToFrame, useSignAuthorization, useSetWalletPassword, useSolanaWallets, useWallets, setActiveWallet, useLogin/useLogout callbacks, connectWallet/linkWallet, funding — none present.
  • ✅ usePrivy() return shape (login, logout, authenticated, user, getAccessToken, ready) unchanged in v3.
  • ✅ user.email.address / user.wallet.address access unchanged.
  • ✅ chat uses no Solana — the @solana/web3.js→@solana/kit swap (the documented #1 v3 failure point) doesn't apply.

Only code change: embeddedWallets.createOnLogin moved under a per-chain key in v3 → embeddedWallets.ethereum.createOnLogin (behavior preserved: email users still get an embedded EVM wallet, which useUser reads for account keying).

Verification

  • pnpm install → @privy-io/react-auth 3.31.0.
  • tsc --noEmit: zero Privy-related type errors (remaining errors are pre-existing: stale .next/types + AI-SDK UIMessage drift in an email test, both unrelated).
  • pnpm build: webpack compiled successfully (Privy provider compiles). Two Module not found warnings are optional v3 peer deps chat doesn't use (@stripe/crypto fiat-onramp, @farcaster/mini-app-solana). My local build can't finish page-data collection (missing Supabase env locally) — Vercel preview build is the authoritative check.
  • pnpm exec vitest run → 68 passed.

Can't be verified here (needs your config)

Runtime auth — login → logout, getAccessToken() → Bearer → recoup-api — needs a real browser session and the HttpOnly cookie + DNS config on the prod Privy app (Phase 1b, dashboard-only, not a PR). Worth a manual login/logout smoke test on the preview before merge. Note: switching storage mode invalidates existing localStorage sessions, so current chat users re-login once on rollout.

Part of recoupable/chat#1801 (Phase 1a). PR targets test.

🤖 Generated with Claude Code


Summary by cubic

Upgraded @privy-io/react-auth v1.88.4 → v3.31.0 to enable cookie-based cross-subdomain auth and match marketing. Part of recoupable/chat#1801 (Phase 1a).

  • Dependencies

    • Bumped @privy-io/react-auth to ^3.31.0.
  • Migration

    • Updated provider config to v3: embeddedWallets.createOnLogin → embeddedWallets.ethereum.createOnLogin.
    • Do a quick preview smoke test (login/logout, getAccessToken) with the Privy app’s HttpOnly cookie + DNS config; one-time re-login expected.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed embedded wallet configuration to properly handle wallet creation behavior for users without existing wallets on Ethereum networks.