← Back to library
Add features

Integrate a third-party API

Adding payments, maps, login or an AI endpoint

  • integration
  • API
  • third-party

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

  1. Asking for the flow diagram first avoids getting a call snippet while missing callbacks and state handling
  2. Pinning where secrets live directly blocks the most common and most damaging mistake: shipping the secret to the client
  3. Forcing error handling and timeouts matters because third-party failures are normal, not exceptional
  4. 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
When to use it
When connecting external services, especially payments or anything sensitive.
Models
Claude / GPT; cross-check the latest API details against official docs

Browse categories