Zindua

Zindua for Supabase

Auth email and WhatsApp from Edge Functions. Plug into Supabase Auth Hooks or your own OTP store. Supabase verifies, you send from your Gmail and WhatsApp. Guide v1.0.0.

npm install @zindua/sdk

Auth Hooks

Drop-in Send Email / Send SMS hooks. Supabase verifies; Zindua delivers.

WhatsApp as SMS

No Twilio required. Map phone OTP to WhatsApp on your Zindua line.

BYO email

Send from your Gmail / SMTP / Outlook - not a locked ESP network.

Custom OTP store

Optional Track B: hash OTP in Postgres + Edge Functions you control.

Server-only keys

ZINDUA_API_KEY lives in Edge secrets. Never NEXT_PUBLIC_.

One-click Connect

Dashboard → Integrations → Connect to Supabase. OAuth pushes Edge secrets for you.

Dashboard

Connect in one click

Pick a step. Screenshots of Integrations, then the Supabase authorize screen. Tap Zoom.

Live dashboard screenshotsStep 1/2
Choose a path

Track A or Track B

Same Zindua send API. Different ownership of OTP verify.

Track A - Auth Hooks

Recommended for Auth

Supabase generates and verifies OTP / magic links. Your Edge Function only calls POST /send.

When: signInWithOtp, recovery, confirm signup, phone Auth

examples/supabase-auth-hooks

Download zip

Track B - Custom OTP

WhatsApp-first

You hash OTP in Postgres, send via Zindua, verify in Edge. Full control outside Phone Auth.

When: Custom login, multi-tenant B2B, WhatsApp without Supabase Phone

examples/supabase-otp

Download zip
Examples

Pick a snippet

Edge send, secrets, Auth Hooks, Postgres, or client invoke. Same Zindua send().

send.ts
// Deno Edge - prefer fetch (SDK is Node-oriented)const res = await fetch("https://zindua.run/api/v1/send", {  method: "POST",  headers: {    Authorization: `Bearer ${Deno.env.get("ZINDUA_API_KEY")}`,    "Content-Type": "application/json",  },  body: JSON.stringify({    to: "user@example.com",    template: "otp-verification",    channel: "email",    variables: { code: "482910", otp: "482910" },  }),});
Reference

Setup, secrets, compare

Step through setup, then secrets, Resend, errors, and security.

Step 1

Create a Zindua project

Dashboard → project → copy znd_live_ / znd_test_ key. Connect email Service and/or WhatsApp QR. Create template otp-verification with {{code}}.

API key

znd_live_ / znd_test_

Template

otp-verification {{code}}
Open dashboard

Step 3

Deploy Edge Functions

Copy the starter into your Supabase repo. Set secrets. Deploy with supabase functions deploy.

Deploy

supabase functions deploy

Copy the starter into your Supabase repo, set secrets, then deploy.

Step 4

Wire & test

Enable hooks in Auth settings (Track A) or invoke send-otp (Track B). Confirm delivery in Zindua Logs.

Track A

Enable hooks in Auth settings

Track B

Invoke send-otp, then verify-otp

Confirm in Logs

Before you deploy

Checklist

Confirm project, Service, template, and optional WhatsApp before Edge deploy.

  • Project created + API key copied
  • Email Service connected (Gmail / SMTP / Outlook)
  • Template otp-verification with {{code}} (+ {{otp}}, {{appName}})
  • Optional: WhatsApp QR scanned for phone / Track B WA
  • Optional: webhook URL → zindua-webhook Edge Function

Ready to wire Supabase?

Connect from the dashboard to push Edge secrets, or download a starter and deploy Auth Hooks yourself.