The Edge Functions primitive lets you list, deploy, and invoke Supabase Edge Functions on a fullstack app’s project. Management operations (list/deploy) go through the Supabase Management API; invocation hits the project’s /functions/v1 endpoint — all with credentials injected by Naive.
Requires a fullstack app (naive.apps.create({ name, type: "fullstack" })).
Two ways to use it
// Your own project (default user)
await naive.functions.list();
// A specific end-user's project
await naive.forUser(alice.id).functions.list();
Omit { appId } to auto-resolve the user’s single fullstack app; pass it when they own several.
List & invoke
const fns = await naive.functions.list();
const result = await naive.functions.invoke("hello", { name: "world" });
const fn = await naive.functions.get("hello");
Deploy (advanced)
// Caller supplies the Management API function-deploy body (bundling is your responsibility)
await naive.functions.deploy({ slug: "hello", name: "hello", verify_jwt: true, body: "..." });
Edge function deployment requires bundling the function source (Supabase uses an eszip). For most cases, deploy functions from your app’s repo/workspace and use this primitive to invoke them. The raw Supabase Management API is available via the apps proxy for full control.
REST
# Invoke
curl -X POST https://api.usenaive.ai/v1/apps/<app-id>/functions/proxy/hello \
-H "Authorization: Bearer nv_sk_live_..." -H "Content-Type: application/json" \
-d '{"name":"world"}'
Your own project uses /v1/apps/<app-id>/…; an end-user’s project uses /v1/users/<user-id>/apps/<app-id>/….
See the Edge Functions API reference.
Billing
Free at the Naive layer — no per-operation credit cost. Account Kits can gate the functions primitive per user.