Learn about Phantom Connect: For details about authentication flows, login, account selection, and session management, see the Phantom Connect guide.
Using the connection modal (recommended)
The SDK includes a built-in bottom sheet modal that provides a user-friendly interface for connecting to Phantom. Use theuseModal() hook to control it:
- Multiple auth providers: Google, Apple
- Bottom sheet design: Optimized for mobile
- Automatic state management: Connect vs. wallet management views
- Built-in error handling and loading states
useConnect hook (manual connection)
Authentication providers
Theconnect() method accepts a provider parameter to specify how users should authenticate. Available providers are configured in the PhantomProvider config:
connect() method with one of the enabled providers:
Checking connection status
Use theuseAccounts hook to check if a wallet is already connected:
Handling connection errors
When a connection fails, theconnect() promise rejects with an error.