Resources / AI backends
Adding a backend to apps built with Lovable, Bolt or v0
AI app builders are great at screens. Here is how to add the server-side parts — API keys, payments, webhooks, email — safely.
AI app builders produce beautiful frontends in minutes. The trouble starts with anything that must not run in the browser: secret API keys, payments, webhooks, emails, scheduled work. Put those in frontend code and anyone can read your keys.
What belongs on the server
- Calls to paid APIs (OpenAI, Google Maps, Twilio) — the key must stay secret
- Payment sessions and webhooks (Stripe, Paddle, Lemon Squeezy)
- Sending email
- Anything with business rules users shouldn't be able to bypass
- Scheduled jobs
The pattern
Your app calls an HTTPS endpoint you control. The endpoint holds the secret, checks the request (and rate-limits it), calls the third-party API and returns only what the browser needs.
Doing it in a few minutes
With Wisp, describe each endpoint: "a proxy to OpenAI that hides our key, limits each visitor to 20 calls a day and streams the answer". Wisp asks for the key in a private form (it never reaches the AI), deploys the endpoint with CORS enabled, and gives you a URL to paste into your app builder. Webhooks get signature verification, and you can cache read-heavy endpoints at the edge.
Tips
- Keep one Wisp project per app, so every endpoint shares one base URL and one set of secrets.
- Turn on per-visitor limits before you share the app publicly.
- Use the draft URL (
?test) from your app's preview and the live URL in production.
Try it: Template: contact form backend · Template: Stripe Checkout endpoint · Template: waitlist signup API
Build it with Wisp — describe an API, get it live.