Prerequisites
Create a Turnkey organization in the Turnkey dashboard, enable Auth Proxy, email OTP, and passkeys. Copy your Organization ID and Auth Proxy Config ID.Step-by-step (Next.js + React)
1
Install the React Wallet Kit
Install the Turnkey React Wallet Kit in your Next.js app.
Install dependencies
Install dependencies
2
Add environment variables
Store your IDs in
.env.local so your app can initialize Turnkey.Create .env.local
Create .env.local
3
Wrap your app with TurnkeyProvider
Initialize Turnkey at the app root and include the wallet kit styles.
- App Router
- Pages Router
Create a client-side provider component, then wrap it in
app/layout.tsx.app/providers.tsx
app/providers.tsx
app/layout.tsx
app/layout.tsx
4
Connect a user
Use Turnkey’s modal and show a connected state when login completes.
5
Theme the Turnkey UI
Use theming to customize
the Turnkey UI.
See authentication for custom login
flows.