Skip to main content
Invoke from the app:

Writing and deploying

Code is a Deno module - standard fetch/Response, ESM imports, no bundler:
The same command updates an existing function. It runs at $NEXT_PUBLIC_BACKEND_URL/functions/my-function.

Secrets

Store API keys once; read them inside functions as environment variables:

When to use a function

Put logic in a function (not client code) when it involves secrets, spend (AI calls, email sends), or trust (payments, fulfillment) - anything a stranger holding your publishable key must not be able to drive.