Functions
Tested with: Not yet available on Databasezy · describes the launch design
Functions run your TypeScript or JavaScript at /functions/v1/<name> on the project endpoint, in the region that runs
the project, on the same open-source edge runtime Supabase uses.
How it works
Section titled “How it works”- A function is a
Deno.servehandler with npm and JSR imports. The CLI bundles it and uploads the bundle; every deploy is a version you can roll back to. - Each invocation runs in its own isolate from a warm pool for your project, with memory, CPU-time and wall-clock limits from your plan (below).
- Requests carry a project key or a user’s session token, verified at the edge;
verify_jwtis on by default. - Triggers: HTTP, cron schedules, queue messages and database changes.
- Secrets are set per project and read with
Deno.env.get. Database credentials can be injected by reference; they are resolved in the region and never copied into the control plane. - Logs and per-function metrics are kept for your plan’s log retention.
A function (at launch)
Section titled “A function (at launch)”Deno.serve(async (req) => { const { name } = await req.json(); return Response.json({ message: `Hello ${name}` });});curl -X POST "https://<ref>.us-east.databasezy.com:8443/functions/v1/hello" \ -H "apikey: <publishable-key>" \ -H "Authorization: Bearer <publishable-key>" \ -H "Content-Type: application/json" \ -d '{"name":"world"}'import { createClient } from "@supabase/supabase-js";
const supabase = createClient("https://<ref>.us-east.databasezy.com:8443", "<publishable-key>");
const { data, error } = await supabase.functions.invoke("hello", { body: { name: "world" },});from supabase import create_client
supabase = create_client("https://<ref>.us-east.databasezy.com:8443", "<publishable-key>")
res = supabase.functions.invoke("hello", invoke_options={"body": {"name": "world"}})// Cargo.toml: reqwest = { version = "0.12", features = ["json"] }, serde_json, tokiolet key = "<publishable-key>";let res = reqwest::Client::new() .post("https://<ref>.us-east.databasezy.com:8443/functions/v1/hello") .header("apikey", key) .bearer_auth(key) .json(&serde_json::json!({ "name": "world" })) .send() .await? .error_for_status()?;let json: serde_json::Value = res.json().await?;Pricing and limits
Section titled “Pricing and limits”| Meter | Price | Free | Solo | Team | Enterprise |
|---|---|---|---|---|---|
| Function invocations Coming soon | $2 per million | 250K | 2M | 10M | Contract |
| Function compute Coming soon | $0.0000166 per GB-second | 100K GB-s | 400K GB-s | 2M GB-s | Contract |
| Limit | Free | Solo | Team | Enterprise |
|---|---|---|---|---|
| Functions Coming soon | 5 | 25 | 100 | Unlimited |
| Function memory and time limit Coming soon | 150 MB, 150 s | 256 MB, 400 s | 512 MB, 400 s | 1,024 MB, 900 s |
Functions run regionally at launch; multi-region execution follows later.