Integrations / Platforms / Supabase
Log events from Supabase Edge Functions or trigger LogIt from Supabase database webhooks when rows are inserted.
supabase functions new log-event
// supabase/functions/log-event/index.ts
import { serve } from "https://deno.land/std@0.208.0/http/server.ts";
serve(async (req) => {
const { email, plan } = await req.json() as { email: string; plan: string };
await fetch("https://api.logit.now/api/ingest", {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${Deno.env.get("LOGIT_API_KEY")}`,
},
body: JSON.stringify({
channel: "signups",
event: "New user signed up",
description: `${email} joined on ${plan}`,
icon: "๐ค",
notify: true,
tags: { plan },
metadata: { email },
}),
});
return new Response(JSON.stringify({ ok: true }), {
headers: { "Content-Type": "application/json" },
});
});
supabase secrets set LOGIT_API_KEY=lk_live_xxxxxxxxxxxxxxxx
supabase functions deploy log-event
Supabase can fire an HTTP request when a row is inserted in a table.
users and event to INSERThttps://api.logit.now/api/ingestAuthorization: Bearer lk_live_xxxxxxxxxxxxxxxx{
"channel": "signups",
"event": "New user row inserted",
"icon": "๐ค",
"notify": true
}
Tip: The database webhook body is static JSON. For dynamic content (email, plan), use an Edge Function instead.
Ready to connect Supabase?
7-day free trial. No credit card required.