Help centerIntegrations
FlutterFlow, WeWeb and Softr
How FlutterFlow (and Flutter Web), WeWeb and Softr apps find out which customer they're serving and build the "Connect domain" button without exposing your API key.
FlutterFlow, WeWeb and Softr run in the browser and don't let you read request headers. So in these apps the
customer arrives through window.TENANCI, and the portal link is created by a private call (FlutterFlow) or by your
backend (WeWeb and Softr). The Integration tab shows every snippet below with your project id already in it.
Before you start
On all three, the app only sees the customer if window.TENANCI is turned on:
- Under domain → Settings → Customer for this domain, fill in the Customer id in your app, the Customer data (name, colors…) and turn on Available in the browser (window.TENANCI).
- For domains that customers connect through the portal, turn on Send customer data to the browser (window.TENANCI) on domains connected through the portal under project → Customer portal.
FlutterFlow and Flutter Web
Flutter apps draw the screen on a canvas, not in HTML. That has two consequences:
- TailorKit can't edit elements in a Flutter app. Brand it with the customer data read from
window.TENANCI(name, colors, logo fromtenant.data); - search bots can't see the content without help. Turn on Pre-rendering for bots under domain → SEO → Site so Google and social networks get fully rendered HTML.
Under project → Overview → Single-page app (SPA), choose the Navigation mode (Mask keeps the customer's domain in the address bar) and, if the app needs to open straight on a route, turn on Send the initial route in a variable. More in SPA apps.
Find out who the customer is
- Under Custom Code, create a Custom Action named
tenanciTenantIdthat returnsString?. - Paste the code below and save.
- Call the action in the first page's On Page Load and store the result in an App State.
import 'dart:js_interop';
import 'dart:js_interop_unsafe';
import 'package:flutter/foundation.dart' show kIsWeb;
Future<String?> tenanciTenantId() async {
if (!kIsWeb) return null;
final t = globalContext['TENANCI'];
if (t == null) return null;
final tenant = (t as JSObject)['tenant'];
if (tenant == null) return null;
return ((tenant as JSObject)['id'] as JSString?)?.toDart;
}"Connect domain" button
- Under API Calls, click Add → Import cURL and paste the call below.
- Check Make Private: the call now runs on Firebase's server and the key stays out of the app.
- Create the
tenantId,nameandreturnUrlvariables. - On the button, add a Backend Call action with that call, then Launch URL with the response's
urlfield.
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]"}'WeWeb
On WeWeb, TailorKit works normally and the customer is read in a formula.
- In a formula (for example, on a
customerIdvariable), switch the mode to JavaScript. - Paste the code below.
- Use
customerIdin your collections' filters.
return window.TENANCI?.tenant?.id ?? null;WeWeb doesn't keep secrets on the front end, so the portal link is created by your backend: on Xano, an External
API Request with Import cURL; on Supabase, an Edge Function. On the button, call that endpoint in the workflow
and use Navigate to with the returned url. Each backend's walkthrough is in
Supabase, Xano, n8n and Make.
Softr
TailorKit works normally on Softr (texts, images and colors without code). To show the customer's name in any element:
- Go to Settings → Custom code → Header and paste the script below.
- On the blocks where the name should appear, add the
data-tenanci-nameattribute to the element.
<script>
document.addEventListener("DOMContentLoaded", function () {
var t = window.TENANCI && window.TENANCI.tenant;
if (!t) return;
document.querySelectorAll("[data-tenanci-name]").forEach(function (el) { el.textContent = t.data.name || ""; });
});
</script>Softr has no backend of its own. For the "Connect domain" button, point the button's link at an n8n or Make webhook
that creates the portal link and replies with a redirect to the url. See n8n and
Make.
Testing
- Open the app on the customer's domain. In the editor, in preview and on the platform's own address
(
*.flutterflow.app,*.weweb-preview.io,*.softr.app) there's nowindow.TENANCI. - In the browser console, type
window.TENANCI: you should see{ domain, tenant: { id, data } }. - Got
undefined? Check Available in the browser on the domain (or the portal option) and wait a few seconds after saving.

