Skip to content
MBGA
mbga
Build Bitcoin apps with lightweight, composable, and type-safe modules that interface with Spark
Modular
Composable hooks for wallets, payments, and invoices
Lightweight
Tree-shakeable with zero bloat. Only pay for what you use.
Performant
Powered by TanStack Query with automatic caching and deduplication
Typed APIs
TypeScript strict mode with autocomplete for every API

Overview

// 1. Import modules.
import { createConfig, sparkMainnet } from 'mbga'
import { xverse, walletStandardDiscovery } from '@mbga/connectors'
 
// 2. Set up your config with desired network & connectors.
const config = createConfig({
  network: sparkMainnet,
  connectors: [xverse()],
  plugins: [walletStandardDiscovery()],
})
 
// 3. Use hooks in your components!
import { useConnect, useBalance, useSendPayment } from 'mbga'
 
function App() {
  const { connect, connectors } = useConnect()
  const { data: balance } = useBalance()
  const { sendPayment } = useSendPayment()
}

Features

mbga supports all these features out-of-the-box:

Community

Check out the following places for more mbga-related content: