मुख्य सामग्री पर जाएँ
Skillpedia
API और सर्वर (backend)9.5k · #12236

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 पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/openclaw/clawhub/blob/main/.agents/skills/convex-billing/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“मेरे Convex ऐप में Stripe सब्सक्रिप्शन जोड़िए, ताकि सिर्फ़ भुगतान करने वाले उपयोगकर्ताओं को प्रीमियम सुविधाएँ मिलें।”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

एजेंट Stripe कंपोनेंट इंस्टॉल करता है, आपकी Stripe कुंजियाँ Convex सेटिंग में सहेजता है, चेकआउट एक्शन और webhook सेट करता है, और एक जाँच जोड़ता है जो ऐप को बताती है कि उपयोगकर्ता का सब्सक्रिप्शन सक्रिय है या नहीं।

तकनीकी सामग्री (मूल SKILL.md)

लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।

<!-- 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:
    import stripe from "@convex-dev/stripe/convex.config.js";
    import { defineApp } from "convex/server";
    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):
    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;
    
  5. Create convex/billing.ts with 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");
      },
    });
    
  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.
अक्सर पूछे जाने वाले सवाल

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

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

axiom-alerting

9.5k

आपके एजेंट को Axiom API से Axiom मॉनिटर और सूचना मार्ग बनाने और प्रबंधित करने में मदद करती है, और यह जाँचती है कि अलर्ट अपेक्षित ढंग से काम करते हैं।

कोडिंगडिप्लॉय और क्लाउड (DevOps)

axiom-sre

9.5k

आपके एजेंट को प्रोडक्शन घटनाओं और बग की जाँच चरण-दर-चरण करने देती है, निष्कर्ष निकालने से पहले हर अनुमान को Axiom लॉग से परखते हुए।

कोडिंगडिप्लॉय और क्लाउड (DevOps)

building-dashboards

9.5k

आपके एजेंट को Axiom डैशबोर्ड डिज़ाइन करने में मदद करती है, जिसमें सही चार्ट, क्वेरी और फ़िल्टर हों, और शुरुआत उन फ़ैसलों से होती है जिन्हें डैशबोर्ड सहारा देगा।

डेटाएनालिसिस और स्प्रेडशीट

controlling-costs

9.5k

आपके एजेंट को Axiom में अनुपयोगी डेटा ढूँढने और ऐसे डैशबोर्ड व मॉनिटर बनाने में मदद करती है जो लॉगिंग लागत को ट्रैक करें और घटाएँ।

कोडिंगडिप्लॉय और क्लाउड (DevOps)

मिलती-जुलती skills