Synthèse automatique
Ce skill guide l'intégration complète de paiements Stripe (abonnements ou paiement unique) dans une application Convex + Next.js, du checkout hébergé aux webhooks et aux composants d'interface.
Points forts
- Déroule un workflow ordonné en 8 étapes, des clés API au déploiement en production
- Fournit des fichiers de référence prêts à copier (schéma Convex, actions, handler de webhook, composants UI)
- Inclut les pièges concrets : constructEventAsync, version d'API cohérente, allow_promotion_codes, fallback sur current_period_end
- Couvre la configuration des webhooks et une checklist de tests avec Stripe CLI
Limites
- Suppose obligatoirement une stack Convex + Next.js et un accès aux outils MCP Stripe/Convex
- Ne détaille pas les flux de checkout embarqué ni les modèles de tarification complexes (facturation à l'usage, multi-devises)
- Les extraits de code sont externalisés dans resources/ et ne sont pas inclus dans le SKILL.md lui-même
À utiliser lorsqu'il faut ajouter une fonctionnalité d'abonnement ou de paiement Stripe à une application existante basée sur Convex et Next.js.
À éviter sur un projet sans Convex, sans Next.js, ou lorsqu'un simple lien Payment Link Stripe suffit.
Analyse de sécurité
PrudenceThe skill describes a legitimate Stripe + Convex + Next.js integration workflow and does not instruct destructive, exfiltrating, or obfuscated actions. The main risk is ordinary secret handling and use of bash/network MCP tools, which warrants caution rather than a risky rating.
- •Instructs collecting a Stripe secret key from the user and writing it to `.env.local`; secret handling must ensure `.env.local` is gitignored and never logged or committed.
- •Uses `bash` for dependency installation and MCP tools with network access for Stripe/Convex configuration; legitimate but powerful capabilities.
- •References bundled `resources/` code files that are not included in the provided SKILL.md, so those files should be reviewed before publishing.
Exemples
Add a monthly $19 subscription to my Convex + Next.js app using Stripe hosted checkout, including the webhook handler and an upgrade button.I want to sell a one-time $49 lifetime access product in my Convex + Next.js app with Stripe Checkout — set up the backend, webhook, and upgrade UI.Configure the Stripe webhook endpoint for my Convex deployment so checkout.session.completed and subscription events keep membership status in sync.name: Integrating Stripe Payments description: Complete workflow for integrating Stripe payments (subscriptions or one-time) with Convex + Next.js. Includes hosted checkout, webhooks, UI components, and testing. Use when adding payment functionality to a Convex + Next.js app. version: "1.0.0" dependencies: ["stripe", "convex", "next.js"] allowed-tools: ["stripe-mcp", "convex-mcp", "file_write", "bash"]
Integrating Stripe Payments
Core Workflow
When user requests Stripe payment integration for Convex + Next.js:
1. Requirements Gathering
Ask these questions first:
- Payment type: Subscription or one-time payment?
- Backend: Confirm this is Convex (required for this skill)
- Checkout preference: Hosted Stripe Checkout (recommended) or embedded?
- Pricing: Amount, currency, billing interval for subscriptions?
- Product: What does user get after payment?
2. API Keys & Environment Setup
CRITICAL: Gather these FIRST before proceeding - MCP tools require credentials.
-
Get Stripe API keys from user:
- Ask for Stripe Secret Key (starts with
sk_test_orsk_live_) - Add to
.env.local:STRIPE_SECRET_KEY=sk_test_...
- Ask for Stripe Secret Key (starts with
-
Install dependencies:
npm install stripe -
Set initial environment variables:
STRIPE_SECRET_KEY(from step 1)NEXT_PUBLIC_SITE_URL=http://localhost:3000(default local development)
-
Use Stripe MCP tool to create product/price and get price ID
-
Use Convex MCP tool to set remaining environment variables
-
Manual fallback: Follow
resources/environment-setup.md
Complete required env vars:
STRIPE_SECRET_KEY✓ (set in step 1)STRIPE_PRICE_ID(from Stripe MCP tool)STRIPE_WEBHOOK_SECRET(set during webhook configuration)NEXT_PUBLIC_SITE_URL✓ (set in step 1)
3. Database Schema
Update convex/schema.ts with Stripe fields. See resources/database-schema.ts for complete schema.
4. Backend Implementation
Copy and customize these files:
convex/stripe.ts← Useresources/convex-stripe-actions.tsconvex/stripeDb.ts← Useresources/convex-stripe-db.tsconvex/http.ts← Useresources/convex-webhook-handler.ts
Key customizations:
- Update membership tier names (
"pro"vs"premium") - Adjust auth field names (
clerkIdvs your auth system) - Set correct API version:
2025-08-27.basil - Enable coupon codes by setting
allow_promotion_codes: truein checkout session creation
5. Frontend Components
Create UI components from resources/ui-components.tsx:
UpgradeButton- Shows different states based on membershipManageBillingButton- Opens customer portal
UI Design Guidelines:
- Match existing app design system
- Use gradients and proper state management
- Show loading states and error handling
- Keep prices in sync with Stripe Dashboard
6. Webhook Configuration
- Get Convex deployment URL (use
.convex.sitedomain) - Create webhook in Stripe Dashboard:
https://your-deployment.convex.site/stripe/webhook - Select events:
checkout.session.completed,customer.subscription.*,invoice.* - Copy webhook secret to environment variables
7. Testing
Follow resources/testing-checklist.md:
- Test successful payment flow
- Test failed payments
- Test customer portal
- Verify webhook delivery
- Use Stripe CLI for local testing
8. Production Deployment
- Switch to live Stripe keys
- Create production webhook endpoint
- Configure Customer Portal and Smart Retries
- Test with real payment (then refund)
Best Practices
Always:
- Use hosted checkout for simplicity and security
- Use
constructEventAsyncin webhooks (notconstructEvent) - Include user metadata in checkout sessions
- Handle missing
current_period_endwith fallbacks - Keep UI prices synchronized with Stripe prices
- Use consistent Stripe API version across all files
- Set
allow_promotion_codes: trueto enable coupon code input during checkout
Never:
- Use
.convex.cloudfor webhooks (use.convex.site) - Skip webhook idempotency in production
- Forget to configure Customer Portal
- Deploy without testing webhook delivery
Common Issues
Webhook not working: Check domain (.convex.site) and webhook secret
Membership not updating: Verify webhook events and metadata
API errors: Ensure consistent API version usage
Documentation References
Use Stripe MCP tool for latest documentation when:
- Checking API changes or new features
- Troubleshooting integration issues
- Verifying best practices
See resources/ folder for complete code examples and detailed setup instructions.
Du fichier au premier essai
Le téléchargement contient exactement le contenu affiché sur cette fiche. Cette copie peut différer de la dernière version du dépôt source.
Consulter la source et ses fichiers annexesCe téléchargement contient uniquement SKILL.md. Les scripts, références, modèles et dépendances éventuels ne sont pas inclus. Récupérez les fichiers nécessaires depuis la source en conservant leur arborescence avant de poursuivre.
1. Télécharger le fichier
Télécharger SKILL.mdDepuis la racine d’un projet de test, enregistrez le fichier sous .skill-downloads/integrating-stripe-payments-mmbizjvz/SKILL.md, ou utilisez la commande suivante. Ce dossier sert à examiner la skill avant son installation.
Commande pour macOS/Linux ou WSL : un shell POSIX et curl sont nécessaires. Sous Windows sans WSL, utilisez le bouton de téléchargement et créez le dossier manuellement.
mkdir -p '.skill-downloads/integrating-stripe-payments-mmbizjvz' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/integrating-stripe-payments-mmbizjvz/download' --output '.skill-downloads/integrating-stripe-payments-mmbizjvz/SKILL.md.part' && mv '.skill-downloads/integrating-stripe-payments-mmbizjvz/SKILL.md.part' '.skill-downloads/integrating-stripe-payments-mmbizjvz/SKILL.md'2. Vérifier les prérequis
Lisez SKILL.md avant de l’utiliser. Si le fichier cite des scripts ou services externes, examinez-les et préparez les accès nécessaires dans votre environnement de test.
Aucune section de prérequis reconnue dans ce fichier. Cela ne signifie pas qu’il est autonome : les bibliothèques, outils et accès peuvent être cités ailleurs dans le contenu ou dans le dépôt source.
Les plateformes de la fiche sont des indications du catalogue. Les chemins ci-dessous suivent la documentation des outils ; ils ne prouvent pas que cette skill y a été exécutée. Aucune version minimale de ces outils n’est attestée pour cette fiche.
3. Charger la skill
Le fichier ne fournit pas un en-tête name/description exploitable pour cette procédure native. Le téléchargement reste disponible pour lecture ; utilisez le mode manuel ci-dessous.
Mode manuel ou autre outil : joignez SKILL.md à une conversation, ou ouvrez-le dans un agent capable de lire les fichiers. Ajoutez les ressources annexes nécessaires. Il n’existe pas de dossier universel reconnu par tous les outils.
4. Faire un premier essai
Utilisez une entrée courte et fictive : un endpoint d’API, un petit document ou un brief d’interface. Dans une nouvelle conversation, joignez le fichier ou donnez son chemin à l’agent, puis adaptez cette demande :
Lis .skill-downloads/integrating-stripe-payments-mmbizjvz/SKILL.md et applique ses instructions à cet exemple : [décrire une entrée de test]. Indique les fichiers, dépendances ou accès qui manquent. Produis le résultat demandé par la skill sans inventer de données ni exécuter de script non examiné.Résultat attendu : une sortie correspondant aux instructions de la skill, ou une liste précise des prérequis manquants. Une simple confirmation de lecture ne valide pas le premier usage. Si une ressource externe est indisponible, ce parcours reste à tester.
Bonnes pratiques React Hook Form
Developpement
Maîtrisez React Hook Form : évitez les anti-patterns, gérez les abonnements, et traitez correctement reset, dirty state et entrées contrôlées.
Migration Emotion vers Mantine
Developpement
Migrer les styled-components Emotion vers des composants Mantine avec style props et modules CSS. Pour convertir .styled.tsx ou supprimer les imports @emotion.
Détecteur de dérive de périmètre
Developpement
Analyse les diffs git par rapport à une intention pour détecter la dérive de périmètre, fichiers non liés et PR trop larges, puis suggère de garder, diviser ou justifier.