Skip to main content
Use Phantom Connect to add wallet access, embedded wallets, and social login to a Next.js + React app.
This recipe covers adding Phantom Connect to a Next.js + React app. Use their Browser SDK for non-React web apps and the React Native SDK for mobile apps.

Prerequisites

Create a Phantom Portal app, configure allowed domains and redirect URLs, and copy the App ID.

Step-by-step (Next.js + React)

1

Install the React SDK

Use the React SDK for Next.js + React.
2

Add PhantomProvider (App Router or Pages Router)

Wrap your root layout so Phantom Connect can manage auth and wallet state. Put your App ID in config.appId (see appId: "your-app-id" in the examples) and set the redirect URL you configured.
Create a client-side provider component, then wrap it in app/layout.tsx.
3

Connect a user

Use the built-in modal or ConnectButton to trigger the Phantom flow.
4

Theme the Phantom ConnectUI

Use theming to customize the modal UI.