Features
- Framework-agnostic: Works with vanilla JavaScript/TypeScript and all web frameworks.
- Multi-chain support: Solana (available now), other chains coming soon.
- Native transaction support: Sign and send native transaction objects on supported chains.
- Flexible authentication providers: OAuth (Google, Apple), Phantom extension, embedded wallets, and injected providers.
- User wallet integration: Connects to existing Phantom user wallets across supported chains.
- TypeScript support: Fully typed API surface.
Security
The Phantom Connect Browser SDK connects to existing Phantom user wallets, ensuring:- Users control their own wallets and private keys.
- Users maintain full control of their assets.
- Integration with Phantom’s secure wallet infrastructure.
- No private key handling in your app.
Prerequisites
- Register your app: Sign up or log in to the Phantom Portal and register your app.
- Obtain your App ID:
- In Phantom Portal, go to your app and open URL Config (left-hand menu). This page shows your allowed origins and redirect URLs.
- Scroll down to the App ID section at the bottom of the page — your App ID is listed there, below the URL configurations.
- Copy the App ID for use in your integration.
- Allowlist your domains and redirect URLs: Add your app’s domains and redirect URLs in the Phantom Portal to enable wallet connections.
Authentication configuration
When using the embedded provider, you’ll need to configure authentication options:redirectUrl:
- 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.
Installation
Quick start
User wallet connection
Chain-specific APIs
The SDK provides separate interfaces for each blockchain with optimized methods:Solana chain (sdk.solana)
Ethereum chain (sdk.ethereum)
| Network | Chain ID | Usage |
|---|---|---|
| Ethereum Mainnet | 1 | ethereum.switchChain(1) |
| Ethereum Sepolia | 11155111 | ethereum.switchChain(11155111) |
| Polygon Mainnet | 137 | ethereum.switchChain(137) |
| Polygon Amoy | 80002 | ethereum.switchChain(80002) |
| Base Mainnet | 8453 | ethereum.switchChain(8453) |
| Base Sepolia | 84532 | ethereum.switchChain(84532) |
| Arbitrum One | 42161 | ethereum.switchChain(42161) |
| Arbitrum Sepolia | 421614 | ethereum.switchChain(421614) |
| Monad Mainnet | 143 | ethereum.switchChain(143) |
| Monad Testnet | 10143 | ethereum.switchChain(10143) |
Auto-Confirm
The SDK provides Auto-Confirm functionality that allows automatic transaction confirmation for specified chains.Available AddressType values
| AddressType | Supported chains |
|---|---|
AddressType.solana | Solana Mainnet, Devnet, Testnet |
AddressType.ethereum | Ethereum, Polygon, Arbitrum, and more |
What you can do
Connect to wallets
Learn how to connect to Phantom embeded wallet with vanilla JavaScript
Sign messages
Implement message signing for authentication and verification
Sign and send transactions
Handle transaction signing and broadcasting across blockchains
Starter kits and examples
Framework-agnostic JavaScript examples and templates:Browser SDK demo app
Full-featured vanilla JavaScript example with all SDK features
All examples
Browse all example apps on GitHub
Code recipes
Code snippets and implementation patterns
Interactive sandbox
Test The Phantom Connect Browser SDK in our interactive sandbox