Step 1 — Install the SDK and detect the host
bankroll.status() tells you which — synchronous,
safe anywhere, including SSR (always 'unavailable' on the server).
Step 2 — Serve your manifest
Serve a manifest at/.well-known/bankroll.jwt on your app’s origin. It
declares your app’s name and icon, the capabilities it uses, and the address that
receives payments. It’s an Unsecured JWT (alg: none, empty signature) —
Bankroll binds it to your app by fetching it from your origin, so there’s no key
to manage.
On Next.js, manifestRoute() is the whole route — you declare what’s yours and
the SDK owns the format:
app/.well-known/bankroll.jwt/route.ts (Next.js)
/.well-known/bankroll-icon.png. See The manifest for every
claim and rule.
Step 3 — Identify the user
The user’s verified session travels as a signed token in thex-bankroll-token header.
The simplest way to send it is to decorate fetch once:
Client
bankroll.session() resolves the token (the SDK caches
it and re-mints before expiry, so repeated calls are cheap):
Client (manual)
session.user.wallet is the user’s stable id.
On Next.js this is one call, with the audience taken from the request’s own host
so there’s no origin constant to keep in step — see
Next.js helpers:
app/api/session/route.ts (Next.js)
Step 4 — Charge the user
Callbankroll.charge() with an amount in whole US cents. Bankroll shows the user
the charge, moves the funds to the address your manifest fixes in
capabilities.payments, and resolves with the settled payment’s signature.
The call cannot name a recipient.
Client
BankrollError with a stable snake_case code. Handle
insufficient_funds, payment_denied, and consent_declined as shown above
without surfacing an error; propagate anything else. On your server, confirm the returned signature
settled the expected amount to your payment address before granting value. See
Payments.
Step 5 — Launch your app
Users open your app with a Bankroll deep link — your app’s URL, URL-encoded:Step 6 — Test the round trip
- Open your
/playdeep link on a device signed into Bankroll. - Your site loads; your first
session()/charge()call runs. session()returns a token your server verifies (Step 3).charge()returns a signature your server confirms (Step 4).
Going live
No registration or approval is required: once your manifest is served, your/play link opens your app for any Bankroll user.
To pay users back — winnings, refunds — see Paying a user.
Being bundled in the Bankroll app itself (featured, first-party placement)
is a separate step that requires Bankroll approval — ask in the
Built for Bankroll Discord.