Embedding in a corporate domain

You can embed dashboards and charts into a website or app using iframe.

Note

  • You can only embed objects on pages hosted on the domain you set during the deployment in the --auth-cookie-domain <domain> argument or in the .features.auth_cookie.enabled=true and .features.auth_cookie.domain=<domain> parameters in the values.yaml file.
  • DataLens and the resource you want to embed it into must have the same domain.
  • The <domain> format must be http://domain or https://domain.

For example, if DataLens is deployed at https://datalens.company-name.ru and the object embedding service is located at https://another-service.company-name.ru, specify the domain name during deployment in one of the following ways:

  • Provide it in the --auth-cookie-domain https://company-name.ru argument.
  • Specify it in the values.yaml file with .features.auth_cookie.enabled=true and .features.auth_cookie.domain=https://company-name.ru.

You can configure the features and appearance of the objects being embedded through these parameters:

  • _autoupdate: Sets the auto-update time for dashboards and charts in seconds. By default, these are not updated automatically. The feature only works for the active browser tab. Objects due for auto-update on inactive tabs will be auto-updated when the tab becomes active again. The minimum values are:

    • 30 seconds for dashboards
    • 15 seconds for charts
  • _embedded: Hides the navigation panel. To activate the parameter, set it to 1.

  • _no_controls: For charts, hides . To activate the parameter, set it to 1.

  • _theme: Specifies the object's appearance. The possible values are:

    • light: Light theme.
    • dark: Dark theme.
  • _no_scroll: Disables vertical scrolling on dashboards. To activate the parameter, set it to 1.

  • _lang: For charts, sets the language of the menu that opens when you click . Possible values: ru and en.

  • _opened_info: Displays dashboard description (if provided) when you open the dashboard. To activate the parameter, set it to 1.

Provide the parameters formatted as <parameter_name>=<value>. For example, to set the auto-update time to 50 seconds, specify _autoupdate=50.

The parameter is added to the object address after the question mark (?). To send multiple parameters, list them separated by & (ampersand), e.g.:

<iframe frameborder="0" src="<DataLens_domain>/preview/<object_id>?_embedded=1&_no_controls=1&_lang=en&_autoupdate=50" ></iframe>

Where:

  • <DataLens_domain>: Your corporate DataLens domain, e.g., https://enterprise.datalens.net.
  • <object_id>: ID of the embedded object, e.g., bgquq********. To copy the ID of a chart or dashboard, open it and click Copy ID.