Help centerIntegrations
Supabase, Xano, n8n and Make
Where to create customer portal links, register domains automatically and receive Tenanci events using Supabase, Xano, n8n or Make.
Front-end builders like WeWeb, Softr, Lovable and Bolt can't keep secrets. The Tenanci key has to live on a backend, and that's where portal links, automatic domain registration and reactions to events (say, emailing a customer when their domain goes live) happen. This guide shows how to do it on Supabase, Xano, n8n and Make.
The calls you'll use
All of them with a domains:write key, created under API keys and restricted to the project.
| To | Call |
|---|---|
| Portal link ("Connect domain" button) | POST /projects/:id/portal/sessions |
| Register a customer's domain, customer included | POST /domains with tenant |
| Update customer data (name, plan, colors) | PUT /domains/:id/tenant |
Supabase (Edge Function)
The path for Lovable, Bolt and WeWeb with Supabase. The function validates the user through the session and takes their customer from there, never from the browser.
- Store the key as a secret:
supabase secrets set TENANCI_API_KEY=...(or Edge Functions → Secrets in the Supabase dashboard). - Create
supabase/functions/tenanci-portal/index.tswith the code below and adjust thetenantIdline to your data model. - Deploy with
supabase functions deploy tenanci-portal. - In the app, call it with
supabase.functions.invoke("tenanci-portal")and open the response'surl.
// supabase/functions/tenanci-portal/index.ts — creates the portal link for the logged-in user
import { createClient } from "npm:@supabase/supabase-js@2";
const cors = { "access-control-allow-origin": "*", "access-control-allow-headers": "authorization, content-type" };
Deno.serve(async (req) => {
if (req.method === "OPTIONS") return new Response(null, { headers: cors });
const supabase = createClient(Deno.env.get("SUPABASE_URL")!, Deno.env.get("SUPABASE_ANON_KEY")!, {
global: { headers: { Authorization: req.headers.get("Authorization") ?? "" } },
});
const { data: { user } } = await supabase.auth.getUser();
if (!user) return new Response("unauthorized", { status: 401, headers: cors });
// the customer comes from the logged-in user, never from the browser (adjust to your data model)
const tenantId = String(user.app_metadata?.tenant_id ?? user.id);
const r = await fetch("https://api.tenanci.com/v2/projects/prj_8f3k2m/portal/sessions", {
method: "POST",
headers: { authorization: `Bearer ${Deno.env.get("TENANCI_API_KEY")}`, "content-type": "application/json" },
body: JSON.stringify({ tenantId, tenantData: { name: user.user_metadata?.company ?? user.email }, returnUrl: req.headers.get("origin") ?? undefined }),
});
return new Response(await r.text(), { status: r.status, headers: { ...cors, "content-type": "application/json" } });
});Xano
A good match for WeWeb: WeWeb calls a Xano endpoint, and Xano talks to Tenanci.
- Under Settings → Environment Variables, create
TENANCI_API_KEYwith your key. - Create an endpoint (for example
POST /tenanci/portal) with user authentication on. - In the function stack, look up the authenticated user's customer in your database.
- Add an External API Request, click Import cURL and paste the call below.
- Replace the key in the header with
$env.TENANCI_API_KEY, andtenantId/namewith the customer data from step 3. - Return the response's
urlfield. In WeWeb, the button calls the endpoint and uses Navigate to with thaturl.
curl -X POST "https://api.tenanci.com/v2/projects/prj_8f3k2m/portal/sessions" \
-H "Authorization: Bearer tnc_live_xxxxxxxx_xxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"tenantId":"<tenantId>","tenantData":{"name":"<name>"},"returnUrl":"<returnUrl>"}'n8n
Handy when the app has no backend (Softr, for example): the button opens an n8n webhook, which creates the link and redirects the customer.
- Create a workflow with a Webhook node (GET method). The button's link passes the customer id, for example
https://n8n.yourdomain.com/webhook/tenanci-portal?customer=rec123. - Check in your database that this customer exists and is active.
- Add an HTTP Request node, click Import cURL and paste the call above. Keep the key in a credential
(Header Auth, name
Authorization, valueBearer+ the key) instead of leaving it in the node. - Finish with Respond to Webhook, set Respond With to Redirect and use the response's
url.
Make
The same flow as n8n, with Make modules:
- Webhooks → Custom webhook, receiving the customer id in the URL.
- Look up and check the customer in your database (Airtable, Google Sheets, your Softr data source…).
- HTTP → Make a request: method
POST, URLhttps://api.tenanci.com/v2/projects/prj_8f3k2m/portal/sessions, headerAuthorization: Bearer+ the key, a JSON body withtenantId,tenantDataandreturnUrl, and Parse response on. - Webhooks → Webhook response with status
302and aLocationheader set to theurlfrom step 3.
Register domains automatically
If your system already knows the customer's domain (at sign-up or checkout), create the domain directly, with the
customer attached. The response includes the DNS record (dns.type, dns.name, dns.values) for you to show or
email.
curl -X POST "https://api.tenanci.com/v2/domains" \
-H "Authorization: Bearer tnc_live_xxxxxxxx_xxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: order-48213" \
-d '{"projectId":"prj_8f3k2m","hostname":"seasidehomes.com","tenant":{"id":"rec123","data":{"name":"Seaside Homes","plan":"pro"},"expose":true}}'const domain = await tenanci.domains.create({
projectId: "prj_8f3k2m",
hostname: "seasidehomes.com",
tenant: { id: "rec123", data: { name: "Seaside Homes", plan: "pro" }, expose: true },
});When the customer changes plan or name, update it with
PUT /domains/:id/tenant. The new value reaches the domains within seconds.
Read the customer in your backend
If your backend is the project's origin (the address set on the project), every request that goes through
Tenanci arrives with X-Tenanci-Tenant, X-Tenanci-Tenant-Data and, once the project has a secret, the
X-Tenanci-Tenant-Signature signature. Generate the secret under project → Customization → Customer context
signature and check the signature before trusting the value. Verification code (Node.js and Python) is in
Customer context.
Receive events (webhooks)
To react without polling the API, register an endpoint under Organization → Webhooks
(it can be an n8n Webhook node or a Make Custom webhook). The events are domain.created,
domain.status_changed, domain.deleted and tailorkit.published, signed in the Tenanci-Signature header. A
common use: when domain.status_changed shows the domain went live, send the customer a welcome email. Details in
Webhooks.

