Show HN: Stripe-no-webhooks – Sync your Stripe data to your Postgres DB

Published: (February 10, 2026 at 12:14 PM EST)
3 min read

Source: Hacker News

Overview

stripe-no-webhooks is an open‑source library that syncs your Stripe payments data to your own Postgres database.

  • Repository:
  • Demo video:

Why it’s useful

  1. No webhook plumbing – The library creates the necessary webhook endpoint in Stripe and stores all events in a stripe.* schema, so you don’t have to decide which webhooks to listen for or write listeners yourself.
  2. Avoid rate limits – Stripe’s API is limited to 100 requests per minute. By querying your local Postgres you bypass this limitation, which is handy for internal tools or frequent subscription checks.
  3. Secure AI access – You can grant an AI agent read‑only access to the stripe.* schema to debug payment issues (failed charges, refunds, etc.) without exposing the Stripe dashboard.
  4. Custom analytics – Join Stripe data with your own tables for things like LTV calculations, custom reports, and more.

How it works

  1. The library registers a webhook endpoint in your Stripe account.
  2. Incoming Stripe events are forwarded to your backend, where a listener writes the data into a new stripe.* schema in Postgres.
  3. You define your plans in TypeScript and run a sync command. The library then creates the corresponding Stripe products and prices, handles webhooks, and keeps the database in sync.
  4. Existing Stripe data can be backfilled for already‑existing accounts.

Features

  • Pre‑paid usage credits, account wallets, and usage‑based billing
  • Auto‑generated, customizable pricing‑table component
  • Simple API for accessing billing information
// Example API calls
billing.subscriptions.get({ userId });
billing.credits.consume({ userId, key: "api_calls", amount: 1 });
billing.usage.record({ userId, key: "ai_model_tokens_input", amount: 4726 });

Plan definition (TypeScript)

{
  name: "Pro",
  description: "Cursor Pro plan",
  price: [{ amount: 2000, currency: "usd", interval: "month" }],
  features: {
    api_completion: {
      pricePerCredit: 1,          // 1 cent per unit
      trackUsage: true,          // Enable usage billing
      credits: { allocation: 500 },
      displayName: "API Completions",
    },
    tab_completion: {
      credits: { allocation: 2000 },
      displayName: "Tab Completions",
    },
  },
}

Consuming credits

await billing.credits.consume({
  userId: user.id,
  key: "api_completion",
  amount: 1,
});

await billing.credits.topUp({
  userId: user.id,
  key: "api_completion",
  amount: 500, // buy 500 credits, charges $5.00
});

Additional capabilities

  • Seat‑level credits and monetary wallets (micro‑cent precision)
  • Auto top‑ups, robust failure recovery, tax collection, invoices
  • Out‑of‑the‑box pricing table UI

Demo app

A toy app is available for testing:

  • App: (no validation; feel free to sign up with a dummy email)
  • Test card: 4242 4242 4242 4242, any future expiry, any 3‑digit CVV
  • Screenshot:

Feel free to try it out! If you use the library, please report any bugs on the repository. For help or discussion, you can reach out via your HN profile.

0 views
Back to Blog

Related posts

Read more »