Learn about Phantom Connect: For details about authentication flows, login, account selection, and session management, see the Phantom Connect guide.
Connection flow
- Provider setup: Wrap your app with
PhantomProviderand specify enabled providers. - Connection: Use
useConnect()oruseModal()to establish wallet connection. - Chain operations: Use chain-specific hooks (
useSolana(),useEthereum()) for transactions and signing.
Core connection hooks
useConnect hook
Connect to wallet with an authentication provider:Authentication providers
Theconnect() method accepts a provider parameter to specify how users should authenticate:
useIsExtensionInstalled hook
The"injected" provider directly connects to the user’s Phantom browser extension (not an embedded wallet). Use the useIsExtensionInstalled hook to check if the extension is installed:
- User wants to use their existing extension wallet directly.
- No embedded wallet creation needed.
- Direct access to extension accounts and balances.
Core account hooks
useAccounts hook
Get connected wallet addresses:useDisconnect hook
Disconnect from a wallet:Using the Connect modal (recommended)
The SDK includes a built-in connection modal that provides a user-friendly interface for connecting to Phantom. Use theuseModal() hook to control it:
- Multiple sign-in options: Google, Apple, browser extension
- Built-in error handling and loading states
- Works across devices and environments
- Handles the full connection flow and returns a ready-to-use wallet session
- Presented as a bottom sheet optimized for mobile interaction
Using ConnectBox for auth callbacks
TheConnectBox component provides an inline, embedded connection experience that’s perfect for auth callback pages. Unlike the modal, it renders directly in your page flow and automatically handles all OAuth callback states.

Setting up an auth callback page
When using OAuth providers (Google, Apple), users are redirected to your callback URL after authentication. UseConnectBox on this page to handle the callback flow:
ConnectBox props
Usage examples
ConnectBox vs modal
Configuration options
Important notes aboutredirectUrl:
- Must be an existing page/route in your application.
- Must be whitelisted in your Phantom Portal app configuration.
- This is where users will be redirected after completing OAuth authentication.
- Required for the
googleandappleproviders. - Not required for the
injectedprovider.
Handling connection errors
When a connection fails, theconnect() promise rejects with an error.