convex-billing
하는 일
이 스킬은 Stripe 결제를 Convex 앱에 연결합니다. 결제 페이지, 결제를 기록하는 웹훅, 특정 기능을 유료 사용자로 제한하는 확인을 다룹니다. Convex 앱으로 고객에게 요금을 받으려는 개발자를 위한 스킬입니다.
사용하는 경우
- ✓Convex 앱으로 고객에게 요금을 청구하고 싶을 때.
- ✓앱의 일부 기능을 여는 구독이 필요할 때.
- ✓Stripe 웹훅이 앱의 결제 상태를 자동으로 업데이트하게 하고 싶은 경우.
스킬 링크
https://github.com/openclaw/clawhub/blob/main/.agents/skills/convex-billing/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“Convex 앱에 Stripe 구독을 추가해서 유료 사용자만 프리미엄 기능을 쓰게 해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 Stripe 구성 요소를 설치하고, Stripe 키를 Convex 설정에 저장하고, 결제 페이지 액션과 웹훅을 설정하며, 사용자의 구독이 활성인지 앱에 알려 주는 확인 기능을 추가합니다.
기술 내용 (원본 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 환경 설정에 둡니다. 테스트 키와 실제 키는 따로 보관됩니다.
스킬이 웹훅 메시지를 확인하나요?
예. Stripe 구성 요소가 각 웹훅의 서명을 자동으로 확인합니다.
일회성 결제도 처리하나요?
스킬은 결제 페이지와 구독에 초점을 둡니다. 다른 결제 유형이 필요하면 생성된 코드를 직접 검토해야 합니다.
상세 정보
작성자의 원본 설명
Add Stripe billing/payments to the Convex app via @convex-dev/stripe (checkout + webhook + gating).
repo: openclaw/clawhub
인기도
- GitHub 스타
- 9.5k
- 순위
- #12236
- 라이선스
- MIT
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
axiom-alerting
9.5k에이전트가 Axiom API로 Axiom 모니터와 알림 경로를 만들고 관리하며, 알림이 기대대로 작동하는지 확인하도록 돕습니다.
axiom-sre
9.5k에이전트가 운영 장애와 버그를 단계별로 조사하도록 돕습니다. 결론을 내리기 전에 각 추측을 Axiom 로그로 검증합니다.
building-dashboards
9.5k에이전트가 적합한 차트, 쿼리, 필터를 갖춘 Axiom 대시보드를 설계하도록 돕습니다. 대시보드가 지원해야 할 결정에서 시작합니다.
controlling-costs
9.5k에이전트가 Axiom에서 쓰이지 않는 데이터를 찾고, 로깅 비용을 추적하고 줄이는 대시보드와 모니터를 만들도록 돕습니다.
비슷한 스킬
api-connector-builder
280k에이전트가 기존 패턴을 따라 새로운 API 연결을 만들도록 합니다. 새로운 방식을 도입하지 않고 연동을 하나 더 추가할 때 씁니다.
api-design
280k에이전트가 모범 사례에 따라 REST API를 설계하도록 돕습니다. API가 통신하는 방식, 오류를 보여 주는 방식, 데이터를 정리하는 방식을 정하는 데 유용합니다.
backend-patterns
280k에이전트가 서버 쪽 아키텍처 패턴과 데이터베이스 최적화를 다루도록 돕습니다. 서버에서 실행되는 코드를 만들거나 검토할 때 유용합니다.