Skip to main content
The Phantom Connect React Native SDK provides React hooks for connecting to existing Phantom user wallets in your mobile React Native apps with native transaction support across multiple blockchains.

Quick start

Generate a new Solana project using the Phantom Embedded React Native Starter template.
Run the command above in your terminal to get started. View template on Solana Templates →

Features

  • Built for React Native: Works in Expo environments with native modules for authentication
  • Connection modal: Built-in modal for initiating wallet connections in mobile apps
  • System browser authentication: Uses Safari (iOS) and Chrome Custom Tab (Android) for login and redirect handling
  • Multi-chain support: Solana (available now), other chains coming soon.
  • User wallet integration: Connects to existing Phantom mobile wallets through browser-based OAuth flows.

Security

The Phantom Connect React Native SDK connects to existing Phantom user wallets:
  • OAuth authentication with Google, Apple, or custom JWT providers
  • PKCE support for secure OAuth flows
  • Users maintain full control of their existing wallets
  • Integration with Phantom’s secure wallet infrastructure

Prerequisites

  • Register your app: Sign up or log in to the Phantom Portal and register your app.
  • Obtain your App ID:
    • In Phantom Portal, expand your app in the left navigation, then select Set Up.
    • Your App ID appears at the top of the page.
  • Allowlist your domains and redirect URLs: Add your app’s domains and redirect URLs in the Phantom Portal to enable wallet connections.

Installation

Install peer dependencies

Required polyfill

You must polyfill random byte generation to ensure cryptographic operations work properly. Add this import at the very top of your app’s entry point (before any other imports):
The polyfill import must be the first import in your app’s entry point.

Configure your app scheme

Expo projects

Add your custom scheme to app.json:

Quick start

The SDK includes a built-in bottom sheet modal that provides a user-friendly interface for connecting to Phantom. The modal supports multiple authentication methods (Google, Apple) and handles all connection logic automatically.
Modal features:
  • Multiple auth providers: Google, Apple
  • Bottom sheet UI: Native bottom sheet design for mobile
  • Automatic state management: Shows connect screen when disconnected, wallet management when connected
  • Error handling: Clear error messages displayed in the modal
  • Loading states: Visual feedback during connection attempts

Or use hooks directly

Chain-specific operations

Solana operations

Ethereum operations

EVM support for Phantom Connect embedded wallets will go live later in 2026. The following Ethereum methods are currently available for injected provider (Phantom extension) connections only.

Hooks

useModal

Control the connection modal visibility. The modal automatically shows the appropriate content based on connection status.
Returns:
  • open() - Function to open the modal
  • close() - Function to close the modal
  • isOpened - Boolean indicating if modal is currently visible
Modal behavior:
  • When disconnected: Shows authentication provider options (Google, Apple)
  • When connected: Shows connected wallet addresses and disconnect button

useConnect

Manages wallet connection functionality.

useAccounts

Provides access to connected wallet information.

useSolana

Provides access to Solana-specific operations.

useEthereum

Provides access to Ethereum-specific operations.
EVM support for Phantom Connect embedded wallets will go live later in 2026.
Supported EVM Networks:

useDisconnect

Manages wallet disconnection.

Authentication flows

Available providers

The SDK supports multiple authentication providers that you specify in the providers array:
  • Google ("google") - Google OAuth authentication
  • Apple ("apple") - Apple ID authentication
Example configuration:
Example usage:

Authentication process

  1. User taps Connect Wallet in your app.
  2. System browser opens (Safari on iOS, Chrome Custom Tab on Android).
  3. User authenticates with their chosen provider.
  4. Browser redirects back to your app using the custom scheme.
  5. SDK automatically processes the authentication result.
  6. Wallet is connected and ready to use.
The SDK automatically handles deep link redirects. Ensure your app’s URL scheme is properly configured. Redirect URL format:

Security considerations

The Phantom Connect React Native SDK uses platform-level secure storage and system browsers during authentication:

Secure storage

  • iOS uses Keychain Services with hardware security.
  • Android uses Android Keystore with hardware-backed keys.

Secure authentication

  • Uses the system browser rather than in-app webviews.
  • Verifies redirect origins automatically.

Configuration examples

Basic configuration

Multi-chain configuration

Debug configuration

Configure debug logging by passing a debugConfig prop to PhantomProvider:
Debug configuration properties:

What you can do

Connect to wallets

Learn how to connect to Phantom wallets in mobile apps

Sign messages

Implement message signing for authentication and verification

Sign and send transactions

Handle transaction signing and broadcasting across blockchains

Starter kits and examples

Mobile-specific templates and examples:

React Native demo app

Full-featured React Native example with Expo

All examples

Browse all example apps on GitHub

Code recipes

Mobile implementation patterns and snippets

Mobile deep links

Alternative integration for Solana mobile apps

Additional resources

SDK overview

Compare all Phantom SDKs and choose the right one

Phantom Connect

Learn about authentication flows and user experience

JWT authentication

Implement custom JWT-based authentication for mobile