SDK reference
Two packages: @ivorycom/embed (browser) and @ivorycom/embed-node (server).
Attributes
| attribute | meaning |
|---|---|
client-id | Public embed app id |
token | Minted embed session token |
view | Single-surface view (optional) |
record-id | Deep-link a record (optional) |
theme | light · dark · auto |
origin | Override the embed origin (optional) |
Commands
element.command(name, payload) — navigate, openRecord, prefill, setTheme, runAgent.
Events
element.on(name, handler) returns an unsubscribe; also emitted as DOM CustomEvents ivory:ready and ivory:event (detail: { event, payload }). Events include ready, navigate, lead.created, deal.won, agent.reply, error.
React
import { IvoryCrm } from "@ivorycom/embed/react";
<IvoryCrm clientId="iem_your_app" token={token} view="pipeline"
onReady={() => {}} onEvent={(name, payload) => {}} />
Server (mint)
import { createEmbedClient } from "@ivorycom/embed-node";
const { embed_token } = await createEmbedClient({ clientId, secret })
.mintSession({ sub, email, name, scopes });