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

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

Try it: Template: contact form backend · Template: Stripe Checkout endpoint · Template: waitlist signup API

Build it with Wisp — describe an API, get it live.

Related