Quick start
Generate a new Solana project using the Phantom Embedded React Native Starter template.- npm
- pnpm
- yarn
- bun
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):Configure your app scheme
Expo projects
Add your custom scheme toapp.json:
Quick start
Use the connection modal (Recommended)
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.- 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.open()- Function to open the modalclose()- Function to close the modalisOpened- Boolean indicating if modal is currently visible
- 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.
useDisconnect
Manages wallet disconnection.Authentication flows
Available providers
The SDK supports multiple authentication providers that you specify in theproviders array:
- Google (
"google") - Google OAuth authentication - Apple (
"apple") - Apple ID authentication
Authentication process
- User taps Connect Wallet in your app.
- System browser opens (Safari on iOS, Chrome Custom Tab on Android).
- User authenticates with their chosen provider.
- Browser redirects back to your app using the custom scheme.
- SDK automatically processes the authentication result.
- Wallet is connected and ready to use.
Deep-link handling
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 adebugConfig prop to PhantomProvider:
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