JSPM

@gates-x402/subscriptions

0.1.1
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 7
    • Score
      100M100P100Q75072F
    • License MIT

    Standalone Solana USDC subscription billing package for Next.js, Express, and vanilla JS apps

    Package Exports

    • @gates-x402/subscriptions
    • @gates-x402/subscriptions/widget/subscriptions.js

    Readme

    @gates-x402/subscriptions

    One-package install for standalone Solana USDC subscription billing.

    pnpm add @gates-x402/subscriptions

    This package includes:

    • framework-neutral billing core
    • storage interfaces and Prisma adapter
    • Express router and middleware
    • Next.js route handlers and guards
    • vanilla widget asset at @gates-x402/subscriptions/widget/subscriptions.js

    It is standalone: it does not call the Gates API, import the Gates app, or depend on the Gates database package.

    Basic Usage

    import {
      createSubscriptionBilling,
      createPrismaSubscriptionStore,
    } from '@gates-x402/subscriptions';
    
    export const billing = createSubscriptionBilling({
      network: 'devnet',
      rpcUrl: process.env.SOLANA_RPC_URL,
      treasuryWallet: process.env.SUBSCRIPTION_TREASURY_WALLET!,
      store: createPrismaSubscriptionStore(prisma),
      plans: [
        {
          id: 'pro',
          name: 'Pro',
          priceUsdc: 29_990_000n,
          interval: 'month',
          features: ['api', 'exports'],
        },
      ],
    });

    See docs/subscriptions in the Gates x402 repository for full setup guides.