Skip to content
Platform documentation
Quickstart
Get started

Quickstart

From a local checkout to your first access check.

1. Start the platform

Use Node.js 24.x, pnpm and Docker for PostgreSQL and Redis. Configure .env from .env.example, with a verified public Fuji registry and preserved secrets, before running these commands. For a new registry, follow the Avalanche deployment guide first:

bash
corepack pnpm install --frozen-lockfile
corepack pnpm db:up
corepack pnpm db:migrate
corepack pnpm start:local

# In another terminal, after configuring the worker:
corepack pnpm mcp:local
ServiceLocal address
Dashboardhttp://localhost:3000/app
Website and documentationhttp://localhost:3001/docs
Entitlements APIhttp://localhost:4001
MCPhttp://localhost:4009/mcp when started separately
Live integrations need real configuration

Apply migrations through 0024. Configure email delivery, public Fuji RPC, token, registry and the persistent entitlement subject secret. Public chain connectivity does not deploy web hosting or fund customer wallets. Never paste a private key into the browser or chat.

2. Create a plan and checkout

  1. 1

    Verify email and wallet ownership

    Enter your email, confirm its code and sign wallet ownership during first-time onboarding. Returning users reconnect their saved wallet; replacement is a separate confirmation flow.

  2. 2

    Create a provider plan

    Select a feature, price in USDC, credit allocation, access duration, and the provider’s merchant wallet.

  3. 3

    Open checkout

    Create a checkout session for the customer’s holder identity and selected plan.

  4. 4

    Pay from a wallet

    Use the configured Avalanche network and token. After the payment is verified, the checkout creates the entitlement.

A connected wallet is not a payment

Access is granted after the transfer and payment evidence are verified, not merely when the wallet connects or signs in.

3. Check the customer’s access

Replace the example holder with the exact identity used in checkout. Read the API key from your server environment.

bash
curl "http://localhost:4001/v1/check?feature=ocr&holder=customer-123" \
  -H "Authorization: Bearer $BAGSEVEN_SECRET_KEY"

Read enabled, remaining, and paid_through. Deliver the service only when its authoritative access check allows it.

4. Consume prepaid credits

bash
curl -X POST http://localhost:4001/v1/usage/consume \
  -H "Authorization: Bearer $BAGSEVEN_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{"feature":"ocr","holder":"customer-123","amount":"1","idempotencyKey":"job-123"}'

Reuse the same idempotency key when retrying the same usage event. A numeric credit amount is a feature unit, not a USDC amount. No funded spending permission is required for this prepaid usage.

Bagseven documentationemail and wallet · Avalanche · Registry