跳到主要内容

Embed security model

The partner backend is the identity authority. Dataira never asks the browser to prove who the end user is with a reusable server credential.

The public SDK demo follows this model: its API key stays on the demo server and the browser receives only a short-lived token for the read-only sample datasource.

Credential chain

  1. Your backend authenticates the end user.
  2. It uses an API key scoped to one Project and Environment.
  3. It requests a short-lived token for an end-user organization, end user, datasource, and row scope.
  4. The browser uses that token with @dataira/react or @dataira/client.
  5. The frontend requests a fresh token from your backend when needed.

Scope layers

LayerFixed by
Partner / TenantAPI key ownership; emitted as tenant_id
Project and EnvironmentAPI key scope
End-user organization and userRegistered membership and token claims
DatasourceToken claim and access policy
Data slicescopeColumn and scopeValue token claims

Collection, preference, conversation, metric, and dashboard operations derive their full Partner/Environment/customer-org/user scope from the token. Their APIs do not accept an arbitrary identity override.

Partner responsibilities

  • Store API keys only in a backend secret manager.
  • Authenticate every token endpoint request.
  • Derive the end-user and row scope from the authenticated session, not browser input that has not been validated.
  • Create separate Environment keys where staging and production must not share credentials, data, or user assets.
  • Revoke and rotate keys according to your security policy.

The Node SDK is a convenience layer, not a trust requirement. Any backend can call the token API over HTTPS and keep its own database and identity system.