Features
- Framework Agnostic: Works with vanilla JavaScript/TypeScript and any web framework
- Multi-Chain Support: Solana (available now); Ethereum, Bitcoin, and Sui networks (coming soon)
- Native Transaction Support: Direct transaction object handling
- User Wallet Integration: Connect to existing Phantom user wallets
- TypeScript Support: Full TypeScript definitions included
Security
The Browser SDK connects to existing Phantom user wallets, ensuring:- Users control their own wallets and private keys
- Integration with Phantom’s secure wallet infrastructure
- No private key handling in your application
- User maintains full control of their assets
Prerequisites
- Register your application
Sign up or log in to the Phantom Portal and register your application. - Obtain your App ID
- In the 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.
- Whitelist your domains and redirect URLs
- Add your application’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 application
- Must be whitelisted in your Phantom Portal app configuration
- This is where users will be redirected after completing OAuth with Google
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
)
Auto-Confirm
The SDK provides auto-confirm functionality that allows automatic transaction confirmation for specified chains.Available AddressTypes
AddressType | Supported Chains |
---|---|
AddressType.solana | Solana Mainnet, Devnet, Testnet |
AddressType.ethereum | Ethereum, Polygon, Arbitrum, and more |