Skip to main content
The Phantom Connect Browser SDK provides 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, use sdk.connect() to establish a connection to the wallet:

Authentication providers

The connect() method requires a provider parameter and automatically switches between providers based on the authentication method you specify:

Connecting to injected extension

The injected provider directly connects to the user’s Phantom browser extension (not an embedded wallet). Before using this option, check if the extension is installed:
When to use the 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

Notes about 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, the connect() promise rejects with an error.