AIPM
Theme

AIPM package

Convex Billing

@convex/convex-billing@1.0.0

Add Stripe billing/payments to the Convex app via @convex-dev/stripe (checkout + webhook + gating).

Scanned · no issues · Nov 19, 2026

GitHub stars: ★ 69

LinkedInPost

Install Skill

Pins this version in aipm.package.json and aipm-lock.json.

aipm add @convex/convex-billing@1.0.0

Without project tracking

Writes the skill files only. Add --no-init to skip aipm.package.json and the lockfile.

aipm add @convex/convex-billing@1.0.0 --no-init

How to use

Install the skill above, then run this in your AI tool:

/convex-billing <your description>

About

<!-- GENERATED from convex-agents content/capabilities/billing.json — do not edit by hand. -->

Source

What gets added to your project

Preview every file this package writes on install before you run the command above.

Summary

Add Stripe billing/payments to the Convex app via @convex-dev/stripe (checkout + webhook + gating).

Skill instructions

<!-- GENERATED from convex-agents content/capabilities/billing.json — do not edit by hand. -->

Add billing / payments

Wire Stripe to Convex using @convex-dev/stripe: a checkout action, an httpAction webhook registered by the component (signature-verified automatically), subscription state stored in the component's tables, and server-side gating via a query.

Workflow

  1. Install the component: npm install @convex-dev/stripe.
  2. Create convex/convex.config.ts:
    ts
    import { defineApp } from 'convex/server';
    import stripe from '@convex-dev/stripe/convex.config.js';
    const app = defineApp();
    app.use(stripe);
    export default app;
    
  3. Store Stripe keys in Convex env (use the env micro power): STRIPE_SECRET_KEY (sk_test_… / sk_live_…) and STRIPE_WEBHOOK_SECRET (whsec_…).
  4. Create convex/http.ts to register the webhook route (the component handles signature verification automatically):
    ts
    import { httpRouter } from 'convex/server';
    import { components } from './_generated/api';
    import { registerRoutes } from '@convex-dev/stripe';
    const http = httpRouter();
    registerRoutes(http, components.stripe, { webhookPath: '/stripe/webhook' });
    export default http;
    
  5. Create convex/billing.ts with a checkout action and a subscription-gate query:
    ts
    import { action, query } from './_generated/server';
    import { components } from './_generated/api';
    import { StripeSubscriptions } from '@convex-dev/stripe';
    import { v } from 'convex/values';
    const stripeClient = new StripeSubscriptions(components.stripe, {});
    export const createSubscriptionCheckout = action({
      args: { priceId: v.string() },
      returns: v.object({ sessionId: v.string(), url: v.union(v.string(), v.null()) }),
      handler: async (ctx, args) => {
        const identity = await ctx.auth.getUserIdentity();
        if (!identity) throw new Error('Not authenticated');
        const customer = await stripeClient.getOrCreateCustomer(ctx, { userId: identity.subject, email: identity.email, name: identity.name });
        return await stripeClient.createCheckoutSession(ctx, { priceId: args.priceId, customerId: customer.customerId, mode: 'subscription', successUrl: `${process.env.SITE_URL ?? 'http://localhost:3000'}/?success=true`, cancelUrl: `${process.env.SITE_URL ?? 'http://localhost:3000'}/?canceled=true`, subscriptionMetadata: { userId: identity.subject } });
      },
    });
    export const isSubscribed = query({
      args: {},
      returns: v.boolean(),
      handler: async (ctx) => {
        const identity = await ctx.auth.getUserIdentity();
        if (!identity) return false;
        const subscriptions = await ctx.runQuery(components.stripe.public.listSubscriptionsByUserId, { userId: identity.subject });
        return subscriptions.some((sub) => sub.status === 'active' || sub.status === 'trialing');
      },
    });
    
  6. Run npx convex dev --once — it will install the component and push the functions. Verify output shows ✔ Installed component stripe.
  7. In Stripe Dashboard → Webhooks: add endpoint https://<deployment>.convex.site/stripe/webhook, subscribe to checkout.session.completed, customer.subscription.*, invoice.*, payment_intent.*. Copy the signing secret as STRIPE_WEBHOOK_SECRET.

Rules

  • Use @convex-dev/stripe (npm: @convex-dev/stripe@^0.1.4) — it handles webhook signature verification internally via registerRoutes; do NOT write a manual constructEvent webhook.
  • Stripe keys live in Convex env (use the env micro power): STRIPE_SECRET_KEY and STRIPE_WEBHOOK_SECRET.
  • Gate on server-stored subscription state via isSubscribed query (reads component tables), not client claims.
  • convex/convex.config.ts must import from '@convex-dev/stripe/convex.config.js' (not .ts) — the .js extension is required by the Convex bundler.

Loading package files…

Share this package

Add an Install with AIPM badge

Add this badge to a GitHub README so readers can open the package page and install the same version.

Install with AIPM
[![Install with AIPM](https://www.aipm-registry.com/install-with-aipm.svg)](https://www.aipm-registry.com/skills/convex/convex-billing/1.0.0?utm_source=github&utm_medium=readme&utm_campaign=package_badge)

Publisher

Convex

This imported publisher has not claimed its AIPM account. A connected account confirms account control, but it does not guarantee that a package is safe.

AI assistant context

What this skill is for

@convex/convex-billing@1.0.0 is an AIPM skill package for All tools. Use it when a project needs the reusable AI behavior described as: Add Stripe billing/payments to the Convex app via @convex-dev/stripe (checkout + webhook + gating).

Install
aipm add @convex/convex-billing@1.0.0
Use after install
/convex-billing <your description>

Tool targets

Install command by target

Add --no-init to any of these when you want the skill files without aipm.package.json or aipm-lock.json.

cursor

Run this variant when you want to install the package into cursor.

aipm add @convex/convex-billing@1.0.0 --target cursor --ci

claude

Run this variant when you want to install the package into claude.

aipm add @convex/convex-billing@1.0.0 --target claude --ci

Discussion

Comments (0)

Loading comments…

Keep exploring

Convex/convex-explain-app

Explain an existing Convex app — data model + relationships, public vs internal functions, auth/ownership model, components, a request→data flow — read from the schema and function surface. Read-only.

Published by Convex

skillScanned · no issues★ 69Imported · UnverifiedAll toolsNov 19, 2026, 1:09 AM2.45 KBApache-2.0

Convex/convex-suggest

Suggest the matching Convex component when the user hand-rolls a pattern it already solves (crons, sharded-counter, rate-limiter, storage, search, presence, workflow, RAG, prosemirror-sync). Passive — suggest after the task, never interr...

Published by Convex

skillScanned · no issues★ 69Imported · UnverifiedAll toolsNov 19, 2026, 1:09 AM1.58 KBApache-2.0

Convex/convex-domains

Point a domain you already own at your Convex app (DNS records, custom-domain attach, auth-origin rebind).

Published by Convex

skillScanned · no issues★ 69Imported · UnverifiedAll toolsNov 19, 2026, 1:09 AM1.60 KBApache-2.0

Package FAQ

Install and compatibility

How to install
Run aipm add @convex/convex-billing@1.0.0 in a project that has AIPM initialized.
Supported tools
@convex/convex-billing@1.0.0 supports All tools.

Before installing

AIPM skills can add files to your project. Review the package name, target, description, license, and publisher before installing. Use a clean branch when trying a new skill.