stripe-subscriptions_skill

This skill helps you implement a complete Stripe subscriptions workflow with webhooks, plan gating via feature flags, and a billing portal for seamless billing.
  • TypeScript

8

GitHub Stars

1

Bundled Files

2 months ago

Catalog Refreshed

4 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill andrelandgraf/fullstackrecipes --skill stripe-subscriptions

  • SKILL.md1.8 KB

Overview

This skill implements a complete subscription billing system integrated with Stripe, including plan gating via feature flags, webhook-driven sync to your database, and a customer billing portal. It bundles production-ready patterns and step-by-step recipes to connect Stripe, Postgres, and feature flagging for reliable recurring billing. The implementation is TypeScript-first and designed for full-stack Next.js apps.

How this skill works

The system wires Stripe checkout, billing portal sessions, and webhook handlers to keep subscription state synchronized with a Postgres database using Drizzle. Feature flags control plan availability and gating logic at runtime, so you can enable or disable plans without code releases. Webhooks from Stripe update subscription and invoice records, while usage tracking and billing portal links let customers manage billing directly.

When to use it

  • You need recurring billing with metered or tiered plans in a Next.js app.
  • You want server-side feature gating for plans without redeploying.
  • You require reliable subscription state in Postgres for product logic.
  • You want a ready-made webhook and billing portal integration.
  • You need production-ready patterns for logging, env validation, and DB pooling.

Best practices

  • Validate environment variables with a type-safe schema before startup.
  • Use server-side feature flag evaluation to enforce plan gating.
  • Verify Stripe webhook signatures and idempotency to avoid duplicate processing.
  • Store minimal Stripe IDs in Postgres and derive state from synced records.
  • Emit structured logs for billing events and webhook processing for auditability.

Example use cases

  • Offer tiered SaaS plans with usage-based billing and a self-serve checkout flow.
  • Gate premium features by checking feature flags on session or API routes.
  • Automatically sync subscription cancellations and renewals from Stripe to your app database.
  • Provide customers a link to Stripe Billing Portal for invoices and payment updates.
  • Track metered feature usage server-side and report it to Stripe for billing.

FAQ

No, but the recipes use Postgres with Drizzle ORM and Neon-compatible pooling for serverless environments; you can adapt the syncing logic to other databases.

How are feature flags evaluated?

Feature flags are evaluated server-side using the Flags SDK, allowing environment-based toggles and integration with your plan configuration without client-side exposure.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational
stripe-subscriptions skill by andrelandgraf/fullstackrecipes | VeilStrat