Skip to main content

Embed in your product

What your application does, and what GOAT does.

This guide is for developers putting GOAT dashboards inside their own product. It covers the parts involved, who does what, and the order to read the pages in.

The parts​

PartWhat it does
Your pageHolds the dashboard element and the snippet from GOAT.
Your backendKnows who the signed-in user is and which of your customers they belong to. It asks GOAT for a viewer token for that customer.
The API keyYour backend's secret for asking GOAT for tokens. It never reaches the browser.
The viewer tokenA short-lived pass that names the tenant, meaning which of your customers the viewer belongs to. The page sends it with every request.
GOATChecks the token, checks the tenant can see the dashboard, and returns that tenant's rows only.

Who does what​

StepWhoWhere
Build and publish the dashboardAn authorPublish and share
Create an API keyAn AdminAPI keys
Register your customers as tenantsYou, by an API call with an Admin's or Author's own sign-in tokenTenants and access
Add a token endpoint to your backendYouViewer tokens
Paste the snippet into your pageYouEmbed a dashboard

The app has no control yet for registering customers, and does not yet give a way to get that sign-in token. An Admin can instead turn on an install setting, through the settings API, that registers each customer at its first token request. Tenants and access explains it and its trade-off.

Rules that keep customers apart​

  • Decide the tenant on your server, from your own sign-in, never from anything the browser sends.
  • Keep the API key on your server.
  • A viewer sees only dashboards that are published and that their tenant has access to, and only their tenant's rows.
  1. Embed a dashboard: the snippet and what each part does.
  2. Viewer tokens: the token request and its answers.
  3. Tenants and access: registering customers and granting access.
  4. Embed options and Content Security Policy, as you need them.

The Quickstart runs through all of it once, with a test customer.

GOAT documentation

Type to search.