From b37fae4dfda7dc3854c4034a5bb1e7e65f837e07 Mon Sep 17 00:00:00 2001 From: "mintlify[bot]" <109931778+mintlify[bot]@users.noreply.github.com> Date: Mon, 2 Nov 2026 09:46:54 +0000 Subject: [PATCH] docs: document chartSaveDestinations and dashboard-owned charts in embedded dashboards --- embed/embed-dashboards.mdx | 4 +++- embed/react-sdk.mdx | 24 ++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/embed/embed-dashboards.mdx b/embed/embed-dashboards.mdx index 53af7fdb..571e4a22 100644 --- a/embed/embed-dashboards.mdx +++ b/embed/embed-dashboards.mdx @@ -99,7 +99,9 @@ Embedded viewers can't create or manage [scheduled deliveries](/explore/create-s Add a `writeActions` claim to let embedded users save a new chart from Explore, or — through the React SDK — edit an existing dashboard or build a new one. Lightdash performs the write as a configured actor (a service account or user) into the spaces the token names. See [Write actions](/embed/reference#write-actions) for the claim and [`Lightdash.Dashboard` edit mode](/embed/react-sdk#with-edit-mode) for the SDK flow. -In dashboard edit mode, if the token also sets `canExplore: true`, the add-tile menu has **New chart** and tiles whose chart is in a write space have **Edit chart**. Both open Explore in place: a new chart is saved to a write space and added to the dashboard as a tile, and saving an edited chart updates its tile. +In dashboard edit mode, if the token also sets `canExplore: true`, the add-tile menu has **New chart** and tiles whose chart is in a write space have **Edit chart**. Both open Explore in place: a new chart is added to the dashboard as a tile, and saving an edited chart updates its tile. + +Charts created with **New chart** or **Save as new chart** are saved to the dashboard itself, the same as [creating a chart from a dashboard](/explore/dashboards#create-a-new-chart) in Lightdash. They don't appear in any space's chart list, and removing their tile and saving the dashboard deletes them. If the dashboard isn't in one of the token's write spaces, Lightdash saves the chart to the first write space instead. With the React SDK, you can save these charts to a write space, or let users choose, with the [`chartSaveDestinations` prop](/embed/react-sdk#choose-where-new-charts-are-saved). Iframe embeds always save them to the dashboard. Newly saved charts aren't added to the embed allowlist, so they won't be re-embeddable unless you add them explicitly. diff --git a/embed/react-sdk.mdx b/embed/react-sdk.mdx index c7ad8ba0..a2cfb063 100644 --- a/embed/react-sdk.mdx +++ b/embed/react-sdk.mdx @@ -149,6 +149,7 @@ type DashboardProps = { onEditModeChange?: ( isEditMode: boolean, ) => void; // Callback when the embed enters or leaves edit mode + chartSaveDestinations?: ('dashboard' | 'space')[]; // Where "New chart" and "Save as new chart" save (default: ['dashboard']) onExplore?: (options: { chart: SavedChart }) => void; // Handle "Explore from here" in your app instead of the embed @@ -259,6 +260,28 @@ function EditableDashboard() { The dashboard must be in one of the token's write spaces. The add-chart picker lists saved charts from the write spaces and any [source spaces](/embed/reference#add-charts-from-other-spaces); charts from a source space can't be edited from the dashboard. See [Write actions](/embed/reference#write-actions) for the JWT claim. +#### Choose where new charts are saved + +When the token sets `canExplore: true`, edit mode offers **New chart** in the add-tile menu and **Save as new chart** when editing a chart. Use `chartSaveDestinations` to control where those new charts are saved: + +| Value | Behavior | +|-------|----------| +| `['dashboard']` (default) | The chart is saved to the dashboard. It doesn't appear in any space's chart list, and removing its tile and saving the dashboard deletes it. | +| `['space']` | The chart is saved to a write space, and the dashboard tile references it. | +| `['dashboard', 'space']` | The save dialog lets the user choose between the dashboard and the write spaces. The dashboard is selected by default. | + +```tsx + +``` + +If the dashboard isn't in one of the token's write spaces, Lightdash saves new charts to the first write space whatever this prop says. Iframe embeds have no equivalent setting and always save to the dashboard. + ### Lightdash.DashboardBuilder @@ -289,6 +312,7 @@ type DashboardBuilderProps = { onEditModeChange?: ( isEditMode: boolean, ) => void; // Callback when the embed enters or leaves edit mode + chartSaveDestinations?: ('dashboard' | 'space')[]; // See "Choose where new charts are saved" onDashboardReady?: ( dashboard: EmbedDashboard, ) => void; // Called once the empty dashboard has been created