> ## Documentation Index
> Fetch the complete documentation index at: https://docs.meetsilicon.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How to Embed Charts

> Embed a single saved Silicon chart with a minimal UI using the React SDK

> [!NOTE]
>
> Embedding is available for Silicon customers where Silicon has enabled it. [Get in touch](https://silicon.typeform.com/to/BujU5wg5) to ask about enabling it for your account.

> [!TIP]
>
> **Try it and see the code.** [embed.meetsilicon.com](https://embed.meetsilicon.com) is an interactive demo and helper that lets you preview embedded content and generate a JWT for your own project. For a working end-to-end example, see the [example embed app on GitHub](https://github.com/meetsilicon/example-embed-dashboard-with-nodejs-app) -- a Node.js app that mints tokens server-side and renders a Silicon dashboard.

## Overview

Chart embedding displays a single saved chart with a minimal, focused interface -- a clean, distraction-free view of one visualization, scoped to that chart alone.

> [!WARNING]
>
> Chart embedding is **only available through the React SDK**. iframe embedding is not supported for charts. By default, chart embeds are **read-only**: viewers can't change the configuration, apply filters, or reach Explore.

### When to use chart embedding

* **Single KPI displays**: show one key metric or visualization
* **Embedded widgets**: add analytics widgets to application pages
* **Minimal UI**: a clean, focused display with no dashboard chrome
* **Scoped access**: grant access to specific charts, not entire dashboards

### How it differs from dashboard embedding

| Feature | Dashboard embedding | Chart embedding |
| - | - | - |
| **Method** | iframe or React SDK | React SDK only |
| **Content** | Multiple tiles, tabs | Single chart |
| **Filters** | Interactive dashboard filters | Saved filters only, not interactive |
| **JWT scope** | Dashboard UUID | Chart UUID (`contentId`) |
| **Explore** | Can navigate to Explore | Only to drill down or edit, with [edit mode](#edit-and-drill-down) |

Chart embeds support all chart types (bar, line, pie, table, big number, and so on), parameterized charts with their saved values, and -- when enabled in the JWT -- CSV export, image export, and viewing underlying data.

## Set up a chart embed

Follow the [embedding quickstart](https://docs.meetsilicon.com/embed/set-up-embedding.md) for the shared setup: create an embed secret and generate tokens from your backend. The chart-specific part is the allowlist -- each chart must be added individually under **Settings -> Embed** before it can be embedded.

## Embed with the React SDK

Render a chart with `Silicon.Chart`, passing the chart UUID and a server-generated token:

```tsx theme={null}
import Silicon from '@meetsilicon/sdk';

function MyChart() {
  return (
    <Silicon.Chart
      instanceUrl="https://app.meetsilicon.com"
      id="your-chart-uuid"
      token={generateToken()} // Server-side function
    />
  );
}
```

See the [React SDK reference](https://docs.meetsilicon.com/embed/react-sdk.md#siliconchart) for installation, CORS setup, props, and styling.

## Configure what viewers can do

A chart token is scoped to one chart via `content.contentId` (the saved chart UUID). Inside `content`, you can allow CSV export, image export, and viewing underlying data. For the full schema, see the [chart token](https://docs.meetsilicon.com/embed/reference.md#chart-token) in the embedding reference.

```javascript theme={null}
import jwt from 'jsonwebtoken';

const token = jwt.sign({
  content: {
    type: 'chart',
    projectUuid: 'your-project-uuid',
    contentId: 'your-chart-uuid',

    canExportCsv: true,
    canExportImages: true,
    canViewUnderlyingData: true,
  },
  user: {
    externalId: 'user-123',
    email: 'user@example.com',
  },
}, SILICON_EMBED_SECRET, { expiresIn: '24h' });
```

> [!NOTE]
>
> Parameter values are fixed when the chart is saved. A chart embed displays the chart with its saved parameter configuration.

If the token's `userAttributes` don't meet the [required attributes](https://docs.meetsilicon.com/workspace-admin/user-attributes.md) of the chart's model, the embed shows **Error loading chart** with an authorization message.

## Edit and drill down

To let viewers edit the chart or drill into its data, add a `writeActions` claim whose write spaces include the chart's space, make sure the write actor can update the chart, and pass `isEditMode` to `Silicon.Chart`. The chart then renders in Explore: `isEditMode={true}` opens it for editing, and `isEditMode={false}` lets viewers click a data point and **Drill into** it, with a **Back to Chart** button. See [Edit and drill into a chart](https://docs.meetsilicon.com/embed/react-sdk.md#edit-and-drill-into-a-chart).

## Limitations

Chart embeds are single-scope. Without [edit mode](#edit-and-drill-down), viewers **cannot** modify dimensions, metrics, or visualization type, drill down, or reach the Explore view. In every mode, viewers can't apply filters through the SDK `filters` prop or access any content beyond the chart named in `contentId`.

> [!NOTE]
>
> If you need interactive filters or exploration, use [dashboard embedding](https://docs.meetsilicon.com/embed/embed-dashboards.md) instead, or reach out with your use case.

## Example: single KPI widget

Drop a key metric into your own layout and let the chart background go transparent so it inherits your styling:

```tsx theme={null}
<div className="kpi-widget">
  <h3>Monthly Revenue</h3>
  <Silicon.Chart
    instanceUrl="https://app.meetsilicon.com"
    id="revenue-chart-uuid"
    token={token}
    styles={{ backgroundColor: 'transparent' }}
  />
</div>
```

Pass `user` metadata in the token to attribute queries in [usage analytics](https://docs.meetsilicon.com/workspace-admin/usage-analytics.md#query-tags), and `userAttributes` for [row-level security](https://docs.meetsilicon.com/workspace-admin/user-attributes.md). Styling and localization props are covered in the [React SDK reference](https://docs.meetsilicon.com/embed/react-sdk.md#siliconchart).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.