sdk.connect() to establish a connection to the wallet and access chain-specific operations.
Learn about Phantom Connect: For details about authentication flows, login, account selection, and session management, see the Phantom Connect guide.
Basic connection
Connection flow
After instantiating the SDK, usesdk.connect() to establish a connection to the wallet:
Authentication providers
Theconnect() method requires a provider parameter and automatically switches between providers based on the authentication method you specify:
Connecting to injected extension
Theinjected provider directly connects to the user’s Phantom browser extension (not an embedded wallet). Before using this option, check if the extension is installed:
injected provider:
- User wants to use their existing extension wallet directly.
- No embedded wallet creation needed.
- Direct access to extension accounts and balances.
Configuration options
SDK configuration
redirectUrl (for embedded provider):
- Must be an existing page/route in your app.
- Must be allowlisted in your Phantom Portal app configuration.
- This is where users will be redirected after completing OAuth authentication.
Chain-specific operations
After connection, use dedicated chain interfaces:Solana operations
Ethereum operations
EVM support for Phantom Connect embedded wallets will go live later in 2026.
Auto-connect feature
The SDK can automatically reconnect to existing sessions when instantiated, providing a seamless user experience.Disabling auto-connect
Auto-connect events
You can listen for connection events to update your UI accordingly:Handling connection errors
When a connection fails, theconnect() promise rejects with an error.