← Back to libraryAdd features
Integrate a third-party API
Adding payments, maps, login or an AI endpoint
The prompt
I want to integrate {{service, e.g. Stripe / Google Maps / OpenAI}} into my project. Stack: {{e.g. Next.js + TypeScript}} Scenario: {{what exactly, e.g. charge the user after checkout}} Please: 1. Explain the overall flow (which parties, how data moves). 2. List the credentials needed and where each belongs - and which must never reach the client. 3. Give minimal runnable call code including error handling and timeouts. 4. List this service's classic traps: {{signatures, webhooks, quotas, sandbox}}. 5. How do I test locally - is there a sandbox or test mode? Rules: - Where secrets are involved, mark clearly that it must run server-side. - Do not skip webhook or async notification handling - easiest to miss, most costly. - Warn me about documented limits that matter (rate limits, required business verification, ICP filing).
Replace the {{}} parts with your own content
Why it works
- Asking for the flow diagram first avoids getting a call snippet while missing callbacks and state handling
- Pinning where secrets live directly blocks the most common and most damaging mistake: shipping the secret to the client
- Forcing error handling and timeouts matters because third-party failures are normal, not exceptional
- Asking about verification or filing requirements surfaces the non-technical blockers that actually delay launch
What it looks like
Integrating payments, AI draws the checkout, charge, async webhook, and reconciliation path, stressing that the webhook must be signature-verified and the client result is not proof.
Where it bites
- Copying a call snippet and shipping, missing webhooks and errors, so users pay and orders never update
- Putting secrets in the frontend, which is publishing your credentials