bitrefill-plugin docs
nirholas / bitrefill-plugin

bitrefill-plugin

Bitrefill plugins for SperaxOS — Default, Markdown, Standalone, and OpenAPI types

v1.0.0SEE LICENSE IN LICENSETypeScript
git clone https://github.com/nirholas/bitrefill-plugin.git

What it does

Capabilities documented in this repository.

Plugins

See the full documentation for details.

File Structure

See the full documentation for details.

Plugin 1 Bitrefill Default sperax-bitrefill

See the full documentation for details.

Plugin 3 Bitrefill Store Standalone bitrefill-store

See the full documentation for details.

Plugin 4 Bitrefill API OpenAPI bitrefill-openapi

See the full documentation for details.

Authentication

See the full documentation for details.

Get started

Install it, then run your first command.

git clone https://github.com/nirholas/bitrefill-plugin.git
CommandRuns
npm run devvercel dev
npm run buildbun scripts/build.ts
npm run linttsc --noEmit

Read the full getting started guide

Examples

Taken directly from this repository's documentation.

src/
  sperax-bitrefill.json       ← Default plugin definition
  bitrefill-catalog.json      ← Markdown plugin definition
  bitrefill-store.json        ← Standalone plugin definition
  bitrefill-openapi.json      ← OpenAPI plugin definition

api/
  _utils.ts                   ← Shared auth + CORS + response helpers
  sperax-bitrefill/
    manifest.ts               ← Manifest handler (served with CORS)
    search.ts                 ← Search products
    product.ts                ← Get product details
    balance.ts                ← Account balance
    invoice.ts                ← Create invoice
    invoice-status.ts         ← Get invoice status
    order.ts                  ← Get order + redemption codes
    orders.ts                 ← List orders
    phone-check.ts            ← Validate phone number
    esims.ts                  ← Purchase / top-up eSIM
    deposit.ts                ← Crypto deposit (Business API)
  bitrefill-catalog/
    manifest.ts               ← Manifest handler
    catalog.ts                ← Formatted product catalog (markdown)
    report.ts                 ← Order history report (markdown)
    receipt.ts                ← Order receipt with redemption codes (markdown)
  bitrefill-store/
    manifest.ts               ← Manifest handler
    app.ts                    ← Serves full standalone HTML storefront
  bitrefill-openapi/
    manifest.ts               ← Manifest handler
    spec.ts                   ← Serves OpenAPI 3.0 spec (inlined, edge-safe)

locales/
  sperax-bitrefill.en-US.json
  bitrefill-catalog.en-US.json
  bitrefill-store.en-US.json
  bitrefill-openapi.en-US.json

scripts/
  build.ts                    ← Generates public/index.json from src/*.json

public/
  index.json                  ← Generated plugin registry (bun run build)

vercel.json                   ← Rewrites + CORS headers
tsconfig.json                 ← TypeScript config (edge-compatible)
bun install
bun run build      # Regenerate public/index.json from src/*.json
bun run dev        # Vercel local dev server
bun run format     # Format all JSON files
bun run lint       # tsc --noEmit type check
bun run deploy     # Deploy to Vercel production

More examples

Reference