Skip to Content

Embedding Setup

Check your embed before go-live

Make sure each customer sees only their own rows, on your domains, with tokens that expire.

Do these checks after your first embed works and before real customers see it.

Before you start

  • Your embed shows on a page of your app. Embed your first dashboard
  • You can sign in to your app as users of two different customer companies.

Steps

  1. Open the data app in Data Studio > Data Apps and read Go-live readiness on the Overview tab. Every required step shows a check mark.
  2. Select the Tenancy tab. Fix every surface that is not scoped to the client. The Tenancy checklist covers:
    • Client column mapped: the datasource has a customer table and client column. Tenancy levels
    • Every metric filters by client: no metric shows every client’s rows.
    • Client scope is an app filter: the dashboard filter for the client comes from the token.
    • Underlying data and CSV covered: drill-down data and downloads are scoped too.
    • Token type and allowed domains: guest tokens only, and a domains list.
    • AI chat and dashboard import: cross-client import is off.
    • Schedules saved with the embed: each scheduled report runs as one client.
  3. Select Domains and keep only your own production and staging domains. Remove localhost entries you do not need.
  4. On your backend, read clientId from your own session. Never take it from the browser, a URL or a form.
  5. Sign in as a user of customer A. Note a total on the dashboard.
  6. Sign in as a user of customer B. Check that the same card shows customer B’s total, not customer A’s.
  7. As customer B, open the underlying data of a card and download a CSV. Check that only customer B’s rows are in it.
  8. Change the clientId your backend sends to a value that does not exist. Check that the token request fails with CLIENT_ID_ERROR, or that every card shows no rows.
  9. Set expiryTime to 60000 (one minute). Wait two minutes and reload a card. Check that your app gets a new token when the old one expires.
  10. Sign out and sign in as another company in the same browser tab. Check that the embed shows the new company’s data. Create the element again with the new token.
  11. Open the page from a domain that is not on the list. Check that the embed shows UNAUTHORIZED_ORIGIN.

You are ready to go live when every step passes. Watch tokens and errors in Settings > Embed & Distribution > Guest token usage.

If something goes wrong

  • Step 6 shows the same total for both customers. Tenancy is not set, or a metric does not filter by client. Go back to step 2.
  • Step 8 shows rows. Tenancy is not set for this datasource, so Databrain ignores clientId. Set up tenancy first.
  • Step 10 still shows the old company. Your app reused the element. Remove it and create a new one with the new token.

On this page