Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions docs/pages/product/embedding/signed-embedding.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,37 @@ Here's a complete HTML example that demonstrates the full flow for embedding a d
</html>
```

## Customizing the theme

You can customize the embedded application theme by setting it to `light`, `dark`, or `auto` (follows system preference).

**Method 1: Query parameters**

Add a `theme` parameter to the embed URL:

```html
<iframe
id="cube-dashboard"
title="Dashboard"
src="https://your-tenant.cubecloud.dev/embed/dashboard/YOUR_DASHBOARD_PUBLIC_ID?session=YOUR_SESSION_ID&theme=dark"
width="100%"
></iframe>
```

**Method 2: PostMessage API**

Dynamically update the theme from the parent window:

```javascript
const iframe = document.getElementById('cube-dashboard');
iframe.contentWindow.postMessage({
type: 'SET_THEME',
payload: 'dark' // 'light', 'dark', or 'auto'
}, '*');
```

This is useful for providing theme toggles or synchronizing with your application's theme.

## User attributes

User attributes enable row-level security and personalized chat responses by filtering data based on user permissions. The attributes you pass during session generation automatically filter data queries and responses.
Expand Down