Skip to content

EF: <function-name>

Copy this to backend/edge-functions/<function-name>.md for any edge function that needs a dedicated page (most are covered by the generated index). Add a sidebar entry if linking prominently.

At a glance

Name<domain-action> or <domain-noun-verb>
TypeType A (JWT) / Type B (cron) / Webhook
Pathsupabase/functions/<function-name>/
Registered inEDGE_FN.<KEY> in <feature>Config.js
Testssupabase/functions/<function-name>/tests/

Purpose

What it does and why it's an EF (writes / secrets / external HTTP / webhook / cron).

Trigger

Who calls it (a specific service file + function) or what schedule/webhook fires it.

Request

json
{ "operation": "…", "field": "…" }

Required vs optional fields; validation rules.

Response

json
{ "result": "…" }

Success shape and the error statuses it can return (typed errors → HTTP codes).

Dependencies

  • _shared: handleCors, requireAuth, ok/err, logger.
  • Secrets (via Deno.env.get): list them.
  • External APIs / tables touched (link the table index).

Service that calls it, the hook(s) that read the resulting data, migrations involved.