convex-billing
यह क्या करती है
यह स्किल Convex ऐप को Stripe भुगतान से जोड़ती है। इसमें चेकआउट, भुगतान दर्ज करने वाला webhook, और कुछ सुविधाएँ सिर्फ़ भुगतान करने वाले उपयोगकर्ताओं तक सीमित करने की जाँच शामिल है।
कब इस्तेमाल करें
- ✓जब आप अपने Convex ऐप के लिए ग्राहकों से शुल्क लेना चाहें।
- ✓जब आपको सब्सक्रिप्शन चाहिए जो ऐप में कुछ सुविधाएँ खोलें।
- ✓जब आप चाहें कि Stripe webhook आपके ऐप की भुगतान स्थिति अपने-आप अपडेट करे।
Skill का लिंक
https://github.com/openclaw/clawhub/blob/main/.agents/skills/convex-billing/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“मेरे Convex ऐप में Stripe सब्सक्रिप्शन जोड़िए, ताकि सिर्फ़ भुगतान करने वाले उपयोगकर्ताओं को प्रीमियम सुविधाएँ मिलें।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
एजेंट Stripe कंपोनेंट इंस्टॉल करता है, आपकी Stripe कुंजियाँ Convex सेटिंग में सहेजता है, चेकआउट एक्शन और webhook सेट करता है, और एक जाँच जोड़ता है जो ऐप को बताती है कि उपयोगकर्ता का सब्सक्रिप्शन सक्रिय है या नहीं।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
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
- Install the component:
npm install @convex-dev/stripe. - Create
convex/convex.config.ts:import stripe from "@convex-dev/stripe/convex.config.js"; import { defineApp } from "convex/server"; const app = defineApp(); app.use(stripe); export default app; - Store Stripe keys in Convex env (use the
envmicro power):STRIPE_SECRET_KEY(sk_test_… / sk_live_…) andSTRIPE_WEBHOOK_SECRET(whsec_…). - Create
convex/http.tsto register the webhook route (the component handles signature verification automatically):import { registerRoutes } from "@convex-dev/stripe"; import { httpRouter } from "convex/server"; import { components } from "./_generated/api"; const http = httpRouter(); registerRoutes(http, components.stripe, { webhookPath: "/stripe/webhook" }); export default http; - Create
convex/billing.tswith a checkout action and a subscription-gate query:import { StripeSubscriptions } from "@convex-dev/stripe"; import { v } from "convex/values"; import { components } from "./_generated/api"; import { action, query } from "./_generated/server"; 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"); }, }); - Run
npx convex dev --once— it will install the component and push the functions. Verify output shows✔ Installed component stripe. - In Stripe Dashboard → Webhooks: add endpoint
https://<deployment>.convex.site/stripe/webhook, subscribe tocheckout.session.completed,customer.subscription.*,invoice.*,payment_intent.*. Copy the signing secret asSTRIPE_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
envmicro 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.
अक्सर पूछे जाने वाले सवाल
Stripe कुंजियाँ कहाँ रखी जाती हैं?
Convex environment सेटिंग में, कोड में नहीं। टेस्ट कुंजियाँ और लाइव कुंजियाँ अलग रखी जाती हैं।
क्या स्किल webhook संदेश जाँचती है?
हाँ। Stripe कंपोनेंट हर webhook के हस्ताक्षर अपने-आप जाँचता है।
क्या यह एक बार के भुगतान भी संभालती है?
स्किल चेकआउट और सब्सक्रिप्शन पर केंद्रित है। अगर आपको दूसरा भुगतान प्रकार चाहिए, तो बना हुआ कोड खुद जाँचें।
जानकारी
लेखक का मूल विवरण
Add Stripe billing/payments to the Convex app via @convex-dev/stripe (checkout + webhook + gating).
repo: openclaw/clawhub
लोकप्रियता
- GitHub स्टार
- 9.5k
- रैंकिंग में स्थान
- #12236
- लाइसेंस
- MIT
- अपडेट की गई
- 2/11/2026
कमेंट
- …
इस repository की और skills
axiom-alerting
9.5kआपके एजेंट को Axiom API से Axiom मॉनिटर और सूचना मार्ग बनाने और प्रबंधित करने में मदद करती है, और यह जाँचती है कि अलर्ट अपेक्षित ढंग से काम करते हैं।
axiom-sre
9.5kआपके एजेंट को प्रोडक्शन घटनाओं और बग की जाँच चरण-दर-चरण करने देती है, निष्कर्ष निकालने से पहले हर अनुमान को Axiom लॉग से परखते हुए।
building-dashboards
9.5kआपके एजेंट को Axiom डैशबोर्ड डिज़ाइन करने में मदद करती है, जिसमें सही चार्ट, क्वेरी और फ़िल्टर हों, और शुरुआत उन फ़ैसलों से होती है जिन्हें डैशबोर्ड सहारा देगा।
controlling-costs
9.5kआपके एजेंट को Axiom में अनुपयोगी डेटा ढूँढने और ऐसे डैशबोर्ड व मॉनिटर बनाने में मदद करती है जो लॉगिंग लागत को ट्रैक करें और घटाएँ।
मिलती-जुलती skills
api-connector-builder
280kयह आपके एजेंट को मौजूदा pattern के हिसाब से नए API connections बनाने देता है। जब बिना कोई नया तरीका बनाए एक और integration जोड़ना हो, तब इसका इस्तेमाल करें।
api-design
280kयह आपके एजेंट को best practices के हिसाब से REST APIs डिज़ाइन करने में मदद करता है। यह तय करने में काम आता है कि APIs आपस में कैसे बात करें, errors कैसे दिखें, और data को कैसे व्यवस्थित करें।
backend-patterns
280kआपके एजेंट को server-side architecture patterns और database optimization में मदद करता है। server पर चलने वाला code बनाने या review करने के लिए उपयोगी है।