Skip to content

Commit 6910413

Browse files
authored
Merge pull request #10 from refrakts/docs/improve-docs-usability
fix(docs): improve onboarding navigation
2 parents 938cbe7 + 4de87da commit 6910413

3 files changed

Lines changed: 80 additions & 1 deletion

File tree

site/pages/getting-started.mdx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,21 @@
33

44
MBGA is a collection of React hooks for building Bitcoin apps on [Spark](https://www.spark.info/). It handles wallet connections, balance queries, payments, and more.
55

6+
## Choose Your Path
7+
8+
| Goal | Best starting point |
9+
| --- | --- |
10+
| I want the fastest setup | [Scaffold a project](/installation#scaffolding) |
11+
| I already have a React app | Continue with the quick start below |
12+
| I need framework-specific setup | [Vite](/frameworks/vite) or [Next.js](/frameworks/nextjs) |
13+
| I am not sure which wallet integration to use | [Connector overview](/connectors#choosing-a-connector) |
14+
15+
## Before You Begin
16+
17+
- MBGA's React package is named `mbga`.
18+
- `MbgaProvider` creates and owns the TanStack Query client for you.
19+
- You will usually install `@mbga/connectors` alongside `mbga`, then add any extra connector peer dependencies you need.
20+
621
## Quick Start
722

823
### 1. Install
@@ -25,6 +40,12 @@ yarn add mbga @mbga/connectors @tanstack/react-query
2540

2641
### 2. Create a Config
2742

43+
Choose the connector that matches your app:
44+
45+
- `xverse()` for Xverse via Sats Connect
46+
- `walletStandardDiscovery()` for wallets implementing the Wallet Standard
47+
- `spark()` for programmatic or embedded wallets via the Spark SDK
48+
2849
```ts
2950
// src/mbga.ts
3051
import { walletStandardDiscovery, xverse } from '@mbga/connectors'
@@ -53,6 +74,8 @@ function App() {
5374
}
5475
```
5576

77+
If you already have your own app providers, place `MbgaProvider` alongside them near the root of your app.
78+
5679
### 4. Use Hooks
5780

5881
```tsx
@@ -111,6 +134,7 @@ MBGA abstracts all three behind a single `sendPayment` call.
111134

112135
## Next Steps
113136

137+
- [Installation](/installation#connector-specific-dependencies) — add connector peer dependencies before integrating a specific wallet
114138
- [Installation](/installation) — detailed setup for different connectors
115139
- [Connectors](/connectors/) — choose the right connector for your use case
116140
- [Frameworks](/frameworks/vite) — framework-specific setup guides

site/pages/index.mdx

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,16 @@ yarn add mbga @mbga/connectors
9191

9292
## Overview
9393

94+
### Start Here
95+
96+
| If you want to... | Start here |
97+
| --- | --- |
98+
| Get a working app running as fast as possible | [Installation](/installation#scaffolding) |
99+
| Add MBGA to an existing React app | [Getting Started](/getting-started#quick-start) |
100+
| Choose the right wallet integration | [Connectors](/connectors#choosing-a-connector) |
101+
| Set up framework-specific wiring | [Vite](/frameworks/vite) or [Next.js](/frameworks/nextjs) |
102+
| Browse the API surface | [API Reference](/api/) |
103+
94104
```tsx
95105
// 1. Import modules.
96106
import { createConfig, sparkMainnet } from 'mbga'
@@ -127,6 +137,27 @@ mbga supports all these features out-of-the-box:
127137
- Framework-agnostic [core actions](/api/core-actions) for vanilla JS usage
128138
- TypeScript ready with [strict typing](/api/types) throughout
129139

140+
## Common Paths
141+
142+
### Build a wallet connection flow
143+
144+
1. [Install MBGA](/installation)
145+
2. Pick a [connector](/connectors)
146+
3. Follow [Getting Started](/getting-started)
147+
4. Add a pre-built UI with [Kit](/kit) if you do not want to build the wallet UI yourself
148+
149+
### Build a server-managed or embedded wallet app
150+
151+
1. [Install MBGA](/installation)
152+
2. Use the [Spark SDK connector](/connectors/spark-sdk)
153+
3. Use [core actions](/api/core-actions) or React [hooks](/api/hooks)
154+
155+
### Add Flashnet orchestration
156+
157+
1. Set up the base wallet flow with [Getting Started](/getting-started)
158+
2. Add [Flashnet authentication](/flashnet/authentication)
159+
3. Continue with the [Flashnet docs](/flashnet)
160+
130161
## Community
131162

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

site/pages/installation.mdx

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11

22
# Installation
33

4+
## Choose an Install Path
5+
6+
| If you want to... | Do this |
7+
| --- | --- |
8+
| Start from scratch with a ready-made app | Use [create-mbga](#scaffolding) |
9+
| Add MBGA to an existing React app | Install the packages below |
10+
| Support a specific wallet | Add the matching [connector dependency](#connector-specific-dependencies) |
11+
12+
## What to Install
13+
14+
Install `mbga` for the React hooks, `@mbga/connectors` for wallet integrations, and any extra connector-specific dependency your app needs.
15+
416
## Package Manager
517

618
:::code-group
@@ -21,10 +33,20 @@ yarn add mbga @mbga/connectors @tanstack/react-query
2133

2234
- `mbga` — React hooks
2335
- `@mbga/connectors` — wallet connector implementations
24-
- `@tanstack/react-query` — peer dependency for caching and state management
36+
- `@tanstack/react-query` — peer dependency used internally by `MbgaProvider`
37+
38+
After installing, continue with [Getting Started](/getting-started) to create your config and mount `MbgaProvider`.
2539

2640
## Connector-specific Dependencies
2741

42+
Use this table if you want to confirm the extra package before reading the connector guide:
43+
44+
| Connector | Extra package | When to use it |
45+
| --- | --- | --- |
46+
| [Sats Connect](/connectors/sats-connect) | `sats-connect` | Browser wallets such as Xverse |
47+
| [Spark SDK](/connectors/spark-sdk) | `@buildonspark/spark-sdk` | Programmatic, embedded, or server-managed wallets |
48+
| [Wallet Standard](/connectors/wallet-standard) | None | Runtime wallet discovery across compatible wallets |
49+
2850
### Sats Connect (Xverse)
2951

3052
If using the [Sats Connect](/connectors/sats-connect) connector, also install `sats-connect`:
@@ -83,6 +105,8 @@ yarn create mbga
83105

84106
This generates a ready-to-run project with MBGA pre-configured.
85107

108+
Use this path if you want to skip manual setup and start from a working Vite + React project.
109+
86110
## Requirements
87111

88112
- Node.js 18+

0 commit comments

Comments
 (0)