New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

billingsdk-core

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

billingsdk-core

Core types and client for Billing SDK

latest
npmnpm
Version
0.1.1
Version published
Weekly downloads
5
66.67%
Maintainers
1
Weekly downloads
 
Created
Source

billingsdk-core

Core types, client, plan definitions, entitlements, and storage for Billing SDK.

Installation

npm install billingsdk-core

Usage

import { createBilling, definePlans } from "billingsdk-core";

const plans = definePlans({
  free: {
    name: "Free",
    prices: [],
    features: { ai_generations: { limit: 10, reset: "month" } },
  },
  pro: {
    name: "Pro",
    prices: [{ id: "pro-monthly", amount: 2000, currency: "usd", interval: "month" }],
    features: { ai_generations: { limit: 1000, reset: "month" } },
  },
});

const billing = createBilling({
  adapter: stripe({ secretKey: process.env.STRIPE_SECRET_KEY! }),
  plans,
});

Exports

  • createBilling() — Create a billing client with a provider adapter
  • definePlans() — Define plan configurations with feature entitlements
  • createInMemoryStorage() — In-memory storage adapter for testing
  • Error classes: BillingError, BillingConfigurationError, BillingProviderError, BillingWebhookError, BillingNotFoundError, BillingAuthenticationError, BillingCapabilityError, BillingValidationError, BillingIdempotencyError
  • Utilities: getHeader(), streamToString(), mergeBuffers(), bodyToString()

FAQs

Package last updated on 16 Jul 2026

Related posts