TenanciTenanci

Help centerYour app's customers

Customer portal

A space with your SaaS branding where each of your app's customers connects their own domain, adjusts logo and colors and sees site stats, without access to your dashboard.

Available on: Growth, ScaleOpen in the dashboard

The customer portal is a space with your SaaS branding where each of your app's customers takes care of their own domain: they connect the address, follow DNS and HTTPS, change their logo and colors and see how many visits the site got. They never enter your Tenanci dashboard. It works like Stripe's customer portal: your backend creates a link for the customer and redirects them to it.

What customers can do

You choose what's enabled, per project:

  • Connect their own domain: the customer types the address, the portal shows the DNS record to create and follows verification and the certificate. There's a Check now button.
  • Adjust the domain's logo, colors and icon: logo, Primary color, Secondary color and Tab icon (favicon). When they click Save and publish, the branding goes straight to their domain, without touching your TailorKit draft.
  • See the domain's stats: visitors, page views, top pages, where visitors come from and devices, over the last 7, 30 or 90 days.

Customers only see and change their own domains (the ones with the same customer id within the project). There is no way to delete a domain from the portal.

Turn on the portal

  1. Open the project and go to the Customer portal tab.
  2. Turn on Portal enabled.
  3. Under Customers can, tick what's allowed.
  4. In Domains per customer, set how many domains each customer can connect (1 to 20; the default is 1).
  5. In Template domain, pick the domain whose published TailorKit will be copied to every new domain (see below).
  6. Optionally, tick Go over my plan's limit (extra domains billed to me).
  7. If your app reads the customer in the browser, tick Send customer data to the browser (window.TENANCI) on domains connected through the portal.
  8. Optionally, fill in the Support email and the Welcome message.
  9. Click Save.

In the Test with a link card, next to the settings:

  1. Fill in Customer id in your app (for example, barbershop-123) and, optionally, Customer name.
  2. Click Create link.
  3. Click Open to see the portal exactly as your customer will. The link is valid for 60 minutes.

Create the link from your backend

When the customer clicks "Connect domain" or "My branding" in your app, your backend calls POST /projects/:id/portal/sessions and redirects the customer to the url in the response. The key needs domains:write.

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":"barbershop-123","tenantData":{"name":"Joe’s Barbershop"},"returnUrl":"https://app.agendafacil.com/account"}'
# → { "id": "pss_…", "url": "https://app.tenanci.com/portal#pss_….…", "expiresAt": "…" }
Field What it is
tenantId the customer's id in your app: the same one that arrives in X-Tenanci-Tenant (see tenant context)
tenantData optional: customer data (name, plan…), saved on the domain they connect
returnUrl optional, https: where the portal's "Back" button goes
ttlMinutes optional: how long the link is valid, 5 to 1440 minutes (default 60)

The name in tenantData.name shows up in the portal greeting ("Olá, Joe’s Barbershop") and becomes the name of the connected domain. The data is written to the domain at the moment it's connected; to change data on a domain that already exists, use the tenant context.

Template domain and the customer's logo

The Template domain is a domain in the project that you prepare once in TailorKit (theme, texts and, above all, where the logo goes in the app). Whatever is published there is copied to every domain connected through the portal.

  • With a template: the customer uploads their logo and it shows up in the right place right away.
  • Without a template: colors and the tab icon apply immediately, but the logo only shows up after you mark where it goes in that domain's TailorKit. The portal tells the customer so.

Portal branding

The portal uses the name, logo and color of the project's status page (Status tab), even if the status page itself is turned off. Set them there so the portal looks like your SaaS. The portal also shows the Support email (under "Questions?") and the Welcome message you configured.

Security

  • The link's secret sits after the #: it doesn't show up in server logs or in the Referer, and Tenanci only stores a fingerprint of it. On open, the portal removes the secret from the address bar and keeps it only in that tab.
  • The link expires after the time you chose; the portal shows when access ends. Once expired, the customer sees a "link is not valid or has expired" message and needs to request a new one in your app.
  • Turning off the portal invalidates every link immediately.
  • Everything the customer does in the portal is recorded in your organization's Activity.

Common errors

Response When
400 portal_disabled the portal isn't turned on for the project: turn it on and save before creating links
403 feature_not_in_plan the organization isn't on Growth or Scale
403 forbidden the key lacks domains:write or belongs to another project