Loading...
Loading...
Compare original and translation side by side
@omni-co/embedTip: Useto find dashboards to embed, andomni-content-explorerto manage embed user permissions and user attributes for row-level security.omni-admin
@omni-co/embed提示:使用查找要嵌入的仪表板,使用omni-content-explorer管理嵌入用户权限和行级安全的用户属性。omni-admin
npm install @omni-co/embedundefinednpm install @omni-co/embedundefined
```bash
```bash
The embed secret is found in **Admin → Embed** in your Omni instance. The `OMNI_BASE_URL` for embedding uses the `.embed-omniapp.co` domain, not the standard `.omniapp.co` domain.
嵌入密钥可在您的Omni实例的**Admin → Embed**中找到。用于嵌入的`OMNI_BASE_URL`使用`.embed-omniapp.co`域名,而非标准的`.omniapp.co`域名。omni scim --help # Embed user lookup
omni documents --help # Document listing
omni folders --help # Folder listingTip: Useto force structured output for programmatic parsing, or-o jsonfor readable tables. The default is-o human(human in a TTY, JSON when piped).auto
omni scim --help # Embed user lookup
omni documents --help # Document listing
omni folders --help # Folder listing提示:使用强制输出结构化内容以便程序化解析,或使用-o json输出易读的表格。默认值为-o human(在TTY中输出人类可读格式,管道传输时输出JSON)。auto
embedSsoDashboard()@omni-co/embedimport { embedSsoDashboard, EmbedSessionMode } from "@omni-co/embed";
const embedUrl = await embedSsoDashboard({
contentId: "dashboard-uuid",
secret: process.env.OMNI_EMBED_SECRET,
host: "yourorg.embed-omniapp.co", // Hostname only, no https://
externalId: "user@example.com",
name: "Jane Doe",
userAttributes: { brand: ["Acme"] }, // For row-level security
mode: EmbedSessionMode.SingleContent,
prefersDark: "false",
});@omni-co/embedembedSsoDashboard()import { embedSsoDashboard, EmbedSessionMode } from "@omni-co/embed";
const embedUrl = await embedSsoDashboard({
contentId: "dashboard-uuid",
secret: process.env.OMNI_EMBED_SECRET,
host: "yourorg.embed-omniapp.co", // Hostname only, no https://
externalId: "user@example.com",
name: "Jane Doe",
userAttributes: { brand: ["Acme"] }, // For row-level security
mode: EmbedSessionMode.SingleContent,
prefersDark: "false",
});| Parameter | Required | Description |
|---|---|---|
| Yes | Dashboard UUID (from URL or Admin → Dashboards) |
| Yes | Embed secret from Admin → Embed |
| Yes | Embed hostname only — no protocol, no port |
| Yes | Unique user identifier (typically email) |
| Yes | Display name for the user |
| No | |
| No | |
| No | |
| No | Theme object (see Custom Themes below) |
| No | Entity name for workspaces (see Entity Workspaces below) |
hostyourorg.embed-omniapp.cohttps://:3000| 参数 | 是否必填 | 描述 |
|---|---|---|
| 是 | 仪表板UUID(来自URL或Admin → Dashboards) |
| 是 | 来自Admin → Embed的嵌入密钥 |
| 是 | 仅嵌入主机名——无协议、无端口 |
| 是 | 唯一用户标识符(通常为邮箱) |
| 是 | 用户的显示名称 |
| 否 | 用于行级安全的 |
| 否 | |
| 否 | |
| 否 | 主题对象(见下方自定义主题) |
| 否 | 工作区的实体名称(见下方实体工作区) |
hostyourorg.embed-omniapp.cohttps://:3000customThemeembedSsoDashboard()const embedUrl = await embedSsoDashboard({
// ...signing params
prefersDark: "false",
customTheme: {
"dashboard-background": "#FEF2F2",
"dashboard-tile-background": "#FFF5F5",
"dashboard-key-color": "#E60000",
"dashboard-key-text-color": "#ffffff",
// ...
},
});embedSsoDashboard()customThemeconst embedUrl = await embedSsoDashboard({
// ...签名参数
prefersDark: "false",
customTheme: {
"dashboard-background": "#FEF2F2",
"dashboard-tile-background": "#FFF5F5",
"dashboard-key-color": "#E60000",
"dashboard-key-text-color": "#ffffff",
// ...
},
});| Property | Description |
|---|---|
| Dashboard page background |
| Dashboard page padding |
| Property | Description |
|---|---|
| Spacing around tiles |
| Tile background color |
| Tile box shadow |
| Primary text color in tiles |
| Secondary text color in tiles |
| Tile border color |
| Tile border radius |
| Tile border style |
| Tile border width |
| Title font size |
| Title font weight |
| Title text color |
| Custom title font (woff2 URL) |
| Custom body font |
| Custom code font |
| Property | Description |
|---|---|
| Filter control background |
| Filter control border radius |
| Filter control border color |
| Filter control text color |
| Placeholder text color |
| Label text above controls |
| Focus outline color |
| Property | Description |
|---|---|
| Popover background |
| Popover text color |
| Secondary text in popovers |
| Link color in popovers |
| Divider color |
| Popover border radius |
| Popover border color |
| Filter input background |
| Filter input border radius |
| Filter input border color |
| Filter input text color |
| Placeholder text |
| Icon color in filter inputs |
| Focus outline for filter inputs |
| Checkbox, radio, and toggle color |
| Checkmark/dot color inside inputs |
| Multi-select token background |
| Multi-select token text color |
| Property | Description |
|---|---|
| Primary action color (Update buttons) |
| Text color on primary buttons |
| Button border radius |
| Transparent button text color |
| Transparent button hover color |
| Menu item hover background |
| 属性 | 描述 |
|---|---|
| 仪表板页面背景 |
| 仪表板页面内边距 |
| 属性 | 描述 |
|---|---|
| 磁贴周围间距 |
| 磁贴背景颜色 |
| 磁贴阴影 |
| 磁贴中的主要文本颜色 |
| 磁贴中的次要文本颜色 |
| 磁贴边框颜色 |
| 磁贴边框圆角 |
| 磁贴边框样式 |
| 磁贴边框宽度 |
| 标题字体大小 |
| 标题字体粗细 |
| 标题文本颜色 |
| 自定义标题字体(woff2 URL) |
| 自定义正文字体 |
| 自定义代码字体 |
| 属性 | 描述 |
|---|---|
| 筛选控件背景 |
| 筛选控件边框圆角 |
| 筛选控件边框颜色 |
| 筛选控件文本颜色 |
| 占位符文本颜色 |
| 控件上方的标签文本颜色 |
| 聚焦时的轮廓颜色 |
| 属性 | 描述 |
|---|---|
| 弹出框背景 |
| 弹出框文本颜色 |
| 弹出框中的次要文本颜色 |
| 弹出框中的链接颜色 |
| 分隔线颜色 |
| 弹出框边框圆角 |
| 弹出框边框颜色 |
| 筛选输入框背景 |
| 筛选输入框边框圆角 |
| 筛选输入框边框颜色 |
| 筛选输入框文本颜色 |
| 占位符文本颜色 |
| 筛选输入框中的图标颜色 |
| 筛选输入框聚焦时的轮廓颜色 |
| 复选框、单选框和切换按钮的颜色 |
| 输入框内勾选标记/圆点的颜色 |
| 多选标签的背景颜色 |
| 多选标签的文本颜色 |
| 属性 | 描述 |
|---|---|
| 主要操作按钮颜色(更新按钮) |
| 主要按钮上的文本颜色 |
| 按钮边框圆角 |
| 透明按钮的文本颜色 |
| 透明按钮的悬停颜色 |
| 菜单项的悬停背景颜色 |
"#FEF2F2""#E60000""0 2px 8px rgba(230, 0, 0, 0.1)""url(https://fonts.gstatic.com/...) format('woff2')"""linear-gradient()rgba()"#FEF2F2""#E60000""0 2px 8px rgba(230, 0, 0, 0.1)""url(https://fonts.gstatic.com/...) format('woff2')"""linear-gradient()rgba()dashboard-backgrounddashboard-tile-backgrounddashboard-tile-title-text-colordashboard-control-label-colordashboard-tile-border-colordashboard-key-colordashboard-filter-input-accent-colordashboard-backgrounddashboard-tile-backgrounddashboard-tile-title-text-colordashboard-control-label-colordashboard-tile-border-colordashboard-key-colordashboard-filter-input-accent-colorpostMessagesource: "omni"postMessagesource: "omni"window.addEventListener("message", (event) => {
if (event.data?.source !== "omni") return;
switch (event.data.name) {
case "dashboard:loaded":
// Dashboard ready
break;
case "error":
// Handle error
break;
case "dashboard:tile-drill":
// Handle drill action
break;
}
});window.addEventListener("message", (event) => {
if (event.data?.source !== "omni") return;
switch (event.data.name) {
case "dashboard:loaded":
// Dashboard ready
break;
case "error":
// Handle error
break;
case "dashboard:tile-drill":
// Handle drill action
break;
}
});dashboard:loaded{ "source": "omni", "name": "dashboard:loaded" }dashboard:filters{
"source": "omni",
"name": "dashboard:filters",
"payload": { /* filter state */ }
}error{
"source": "omni",
"name": "error",
"payload": {
"href": "https://...",
"message": "Error description"
}
}dashboard:tile-drill{
"source": "omni",
"name": "dashboard:tile-drill",
"payload": {
"userId": "string",
"dashboard": {
"filters": {
"filterName": {
"filter": {},
"asJsonUrlSearchParam": "string"
}
},
"href": "string",
"urlId": "string",
"path": "string",
"title": "string"
},
"tile": {
"id": "string",
"title": "string",
"appliedFilters": {
"filterName": {
"filter": {},
"asJsonUrlSearchParam": "string"
}
}
},
"drill": {
"field": "string",
"fieldLabel": "string",
"drillQueryLabel": "string",
"rowToDrill": { "field_name": "value" }
}
}
}drill.rowToDrillasJsonUrlSearchParamtile.appliedFiltersdashboard.filterspage:changed{
"source": "omni",
"name": "page:changed",
"payload": {
"pathname": "string",
"type": "string"
}
}<omni-message>{
"source": "omni",
"name": "<your-event-name>",
"payload": {
"data": "comma-separated values"
}
}<omni-message event-name="product-click" event-data="{{products.name.raw}},{{products.retail_price.raw}}">
Click here
</omni-message>dashboard:loaded{ "source": "omni", "name": "dashboard:loaded" }dashboard:filters{
"source": "omni",
"name": "dashboard:filters",
"payload": { /* filter state */ }
}error{
"source": "omni",
"name": "error",
"payload": {
"href": "https://...",
"message": "Error description"
}
}dashboard:tile-drill{
"source": "omni",
"name": "dashboard:tile-drill",
"payload": {
"userId": "string",
"dashboard": {
"filters": {
"filterName": {
"filter": {},
"asJsonUrlSearchParam": "string"
}
},
"href": "string",
"urlId": "string",
"path": "string",
"title": "string"
},
"tile": {
"id": "string",
"title": "string",
"appliedFilters": {
"filterName": {
"filter": {},
"asJsonUrlSearchParam": "string"
}
}
},
"drill": {
"field": "string",
"fieldLabel": "string",
"drillQueryLabel": "string",
"rowToDrill": { "field_name": "value" }
}
}
}drill.rowToDrilltile.appliedFiltersdashboard.filtersasJsonUrlSearchParampage:changed{
"source": "omni",
"name": "page:changed",
"payload": {
"pathname": "string",
"type": "string"
}
}<omni-message>{
"source": "omni",
"name": "<your-event-name>",
"payload": {
"data": "comma-separated values"
}
}<omni-message event-name="product-click" event-data="{{products.name.raw}},{{products.retail_price.raw}}">
Click here
</omni-message>dashboard:filter-change-by-url-parameteriframe.contentWindow.postMessage({
source: "omni",
name: "dashboard:filter-change-by-url-parameter",
payload: {
filterUrlParameter: 'f--<filter_id>={"values":["value1","value2"]}'
}
}, iframeOrigin);filterUrlParameterf--dashboard:filter-change-by-url-parameteriframe.contentWindow.postMessage({
source: "omni",
name: "dashboard:filter-change-by-url-parameter",
payload: {
filterUrlParameter: 'f--<filter_id>={"values":["value1","value2"]}'
}
}, iframeOrigin);filterUrlParameterf--import {
embedSsoDashboard,
EmbedSessionMode,
EmbedEntityFolderContentRoles,
EmbedUiSettings,
EmbedConnectionRoles,
} from "@omni-co/embed";
const embedUrl = await embedSsoDashboard({
// ...standard signing params
entity: "acme",
entityFolderContentRole: EmbedEntityFolderContentRoles.EDITOR,
mode: EmbedSessionMode.Application,
uiSettings: {
[EmbedUiSettings.SHOW_NAVIGATION]: false,
},
connectionRoles: {
"connection-uuid": EmbedConnectionRoles.RESTRICTED_QUERIER,
},
});| Parameter | Description |
|---|---|
| Entity name — scopes the user's folder (e.g., derived from email domain) |
| |
| Must be |
| Control Omni's built-in UI (e.g., hide Omni's sidebar if you provide your own) |
| Grant query access: |
import {
embedSsoDashboard,
EmbedSessionMode,
EmbedEntityFolderContentRoles,
EmbedUiSettings,
EmbedConnectionRoles,
} from "@omni-co/embed";
const embedUrl = await embedSsoDashboard({
// ...标准签名参数
entity: "acme",
entityFolderContentRole: EmbedEntityFolderContentRoles.EDITOR,
mode: EmbedSessionMode.Application,
uiSettings: {
[EmbedUiSettings.SHOW_NAVIGATION]: false,
},
connectionRoles: {
"connection-uuid": EmbedConnectionRoles.RESTRICTED_QUERIER,
},
});| 参数 | 描述 |
|---|---|
| 实体名称——限定用户的文件夹范围(例如从邮箱域名派生) |
| |
| 必须设置为 |
| 控制Omni的内置UI(例如如果您提供了自己的侧边栏,则隐藏Omni的侧边栏) |
| 授予查询权限: |
.omniapp.co.embed-omniapp.co.omniapp.co.embed-omniapp.coomni scim embed-users-list --filter 'embedExternalId eq "user@example.com"'externalIdomni scim embed-users-list --filter 'embedExternalId eq "user@example.com"'externalIdomni documents list --userid <omniUserId>recordsdocuments{
"pageInfo": {
"hasNextPage": false,
"nextCursor": null,
"pageSize": 20,
"totalRecords": 5
},
"records": [
{
"identifier": "fb007aa3",
"name": "Sales Dashboard",
"hasDashboard": true,
"folder": {
"id": "...",
"name": "Sales",
"path": "sales/regional"
}
}
]
}identifiercontentIdhasDashboard: trueomni documents list --userid <omniUserId>recordsdocuments{
"pageInfo": {
"hasNextPage": false,
"nextCursor": null,
"pageSize": 20,
"totalRecords": 5
},
"records": [
{
"identifier": "fb007aa3",
"name": "Sales Dashboard",
"hasDashboard": true,
"folder": {
"id": "...",
"name": "Sales",
"path": "sales/regional"
}
}
]
}identifiercontentIdhasDashboard: trueomni-system-sso-embed-entity-folder-pocomni folders listpath → nameomni-system-sso-embed-entity-folder-pocomni folders list路径 → 名称.embed-omniapp.co.omniapp.coEmbed: yourorg.embed-omniapp.co → used for iframe URLs
API: yourorg.omniapp.co → used for REST API calls.embed-omniapp.co.omniapp.co.embed-omniapp.co.omniapp.co嵌入域名: yourorg.embed-omniapp.co → 用于iframe URL
API域名: yourorg.omniapp.co → 用于REST API调用.embed-omniapp.co.omniapp.co