Custom Handlers
Lightweight per-app backend routes the AI co-locates with your generated app. Great for webhooks, form submissions, or any small server-side action you do not want in client code.
How They Work
When your prompt implies server-side behavior ("send a Slack message when someone submits the form", "receive a webhook from Stripe"), the generator can emit a custom handler alongside your frontend code. The handler is exposed at a stable URL the moment your app is saved; no separate deploy step.
Routes
Each handler is reachable at:
POST /api/custom/{appId}/{handlerName}
GET /api/custom/{appId}/{handlerName}
PUT /api/custom/{appId}/{handlerName}
DELETE /api/custom/{appId}/{handlerName}The handler declares which methods it accepts (usually one). Calling an unsupported method returns 405.
/api/custom/{appId}/{name} from the generated app using a relative URL, which the deploy-service proxy routes correctly in production.Auth
Two layers guard a handler:
- Platform check: the caller must have viewer-level access to the app. This blocks random external probes.
- Handler-level check: the handler can also enforce its own rules: signed-in user via
window.genmb.auth, role check via RBAC, signing secret on a webhook, etc.
When to Reach for One
Use a custom handler when:
- A third-party needs to POST to a stable URL (webhooks).
- You need to keep a secret out of client code (signing a payload, calling a paid API).
- You want simple form submission processing without standing up a Function.
For larger logic, a piece of code you want to test in isolation, or anything you want to edit explicitly file-by-file, prefer a Function.
Limits
- Handler name: alphanumeric with
_or-, capped per app. - Per-request timeout matches the function host (30 seconds).
- Global API rate limit (200 req / min / IP) applies to handler calls.
- Available on all plans, including Free.
FAQs
How are custom handlers different from Functions?▾
What HTTP methods are supported?▾
How does access control work?▾
Can a custom handler read my app data?▾
Ready to build?
Create your first app for free, no credit card required.