Tech News
← Back to articles

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

read original related products more articles

Why this library?

This is an opinionated library to help you implement payments with Stripe.

Define plans in code which sync to your Stripe account No manual webhook setup - the library handles webhooks and syncs Stripe data to your DB Simple APIs for subscriptions, credits, wallet balances, top-ups, and usage-based billing Support for seat based billing, tax collection, plan upgrades and downgrades (including sane handling of credits) Optional callbacks ( onSubscriptionCreated , etc.) for custom logic

Quick Start

This guide assumes you have a Next.js app and a PostgreSQL database. We recommend starting with a test mode Stripe API key so you can test your setup locally in your dev environment. Then, the guide will walk you through how to set up your app for production.

1. Install

npm install stripe-no-webhooks stripe npx stripe-no-webhooks init

You'll be prompted for:

Stripe test key (for eg, sk_test_... ) - get it from Stripe dashboard

(for eg, ) - get it from Stripe dashboard Database URL – PostgreSQL connection string (for example: postgresql://postgres:password@localhost:5432/app_db )

... continue reading