B3 SDK
A comprehensive TypeScript SDK for AnySpend cross-chain operations. Provides both React components for easy integration and headless TypeScript services for custom implementations.
What is the B3 SDK?
The B3 SDK (@b3dotfun/sdk) is a unified TypeScript SDK that provides everything you need to build applications on the B3 ecosystem. It wraps cross-chain payment infrastructure in developer-friendly React components and headless services.
Architecture
The SDK is organized into focused modules designed for maximum flexibility and ease of use:
Module Structure
Each module contains organized, purpose-built components:
react/- React components and hooks for easy integrationservices/- Headless TypeScript services for custom implementationstypes/- Comprehensive TypeScript definitionsutils/- Utility functions and helpersconstants/- Configuration and constants
Platform Support
| Feature | React Web | React Native | Headless |
|---|---|---|---|
| AnySpend | ✅ | ❌ | ✅ |
| Shared Utils | ✅ | ✅ | ✅ |
Installation
bashnpm install @b3dotfun/sdk
bashyarn add @b3dotfun/sdk
bashpnpm add @b3dotfun/sdk
CSS Styles
Import the default styles for the best visual experience:
typescriptimport "@b3dotfun/sdk/index.css";
Quick Start
Cross-Chain Payments with AnySpend
tsximport { AnySpend } from "@b3dotfun/sdk/anyspend/react";function PaymentPage() { return <AnySpend mode="page" />;}
NFT Minting
For a mint button that takes payment in any token, use AnySpendNFTButton, whose props and full nftContract object are documented under AnySpendNFTButton on docs.anyspend.com.
Key Features
Universal Payment Infrastructure
Headless TypeScript Services
To quote and create orders without React, call the AnySpend order API, starting with the quote endpoint on docs.anyspend.com.
Support & Community
What's Next?
- Install the SDK and import the styles
- Set up AnySpend for cross-chain payments
- Explore examples and implementation patterns
- Join the community for support and updates
The B3 SDK provides everything you need to build the next generation of cross-chain applications with seamless user experiences. Start building today!