How to send Clix push notifications from Supabase using Edge Functions, SQL triggers, and helper builders.
ClixClient
inside supabase/functions/_shared
ClixNotification
payloadspg_net
supabase login
pg_net
enabled (we’ll cover this below)supabase/functions/_shared/clix_client.ts
.
todo_id
and a target project_user_id
, build a notification, and send it via ClixClient
(no database lookup logic included here).
notify-todo
in three primary ways—choose based on coupling, complexity, and operational preferences. (Code snippets intentionally omitted.)
todos
table so when a row transitions to completed
, Postgres performs an HTTP POST to the deployed Edge Function. Pros: automatic, low latency, no extra app call. Cons: trigger logic inside SQL, needs pg_net
and careful key handling.todo_id
. Pros: simplest to reason about in application code, easier to add conditional logic or retries. Cons: requires your app layer to explicitly invoke for every event.todo
to status completed
notification_dispatch_log
entriespg_net
Extension: https://supabase.com/docs/guides/database/extensions/pg_netClixClient
consuming environment secretsnotify-todo
) to send messages