Prismatic Embedded
Reference documentation for embedding Prismatic's integration marketplace and workflow builder inside a customer-facing web application.
Core Concepts
Embedding Prismatic means your customers never leave your app to manage integrations. The flow is:
- Your backend generates a short-lived signed JWT (10 min) authenticating the customer user
- Your frontend calls
prismatic.authenticate({ token }) with that JWT — never sign JWTs on the frontend
- The frontend calls
prismatic.showMarketplace(), prismatic.showWorkflows(), or another screen method to render an embedded iframe
Before the JWT expires, the frontend re-fetches a fresh JWT from your backend and calls prismatic.authenticate({ token }) again. Existing iframes update automatically.
Critical Security Rule
JWT tokens MUST be signed on your backend using your private key.
Never expose the private signing key to the frontend. The frontend only receives the signed JWT string from a backend API endpoint.
Signing Keys
Before any embedding can work, your organization needs a signing key. To check or create one:
# Check existing signing keys
prism organization:signing-keys:list --extended --output json
# Generate a new signing key (Prismatic creates the key pair)
prism organization:signing-keys:generate
# OR: import your own key generated with OpenSSL
openssl genrsa -out my-private-key.pem 4096
openssl rsa -in my-private-key.pem -pubout > my-public-key.pub
prism organization:signing-keys:import -p my-public-key.pub
The private key is only shown once at generation time — store it securely (e.g., environment variable or secrets manager). Prismatic only stores the last 8 characters of the public key for identification.
SDK Quick Start
npm install @prismatic-io/embedded
import prismatic from "@prismatic-io/embedded";
// 1. Initialize once on app startup (before authentication)
prismatic.init();
// 2. Authenticate with a JWT fetched from YOUR backend
const { token } = await fetch("/api/integration-token").then(r => r.json());
await prismatic.authenticate({ token });
// 3. Show an embedded screen
prismatic.showMarketplace({ selector: "#integrations-div", usePopover: false });
JWT Required Claims
Every JWT must include these Prismatic-specific fields — standard JWT libraries won't add them automatically:
| Claim |
Required |
Description |
sub |
Yes |
Unique user ID (UUID or similar) |
organization |
Yes |
Prismatic organization ID (from org settings → Embedded tab) |
customer |
Yes |
Your internal customer/tenant ID — identifies which customer this user belongs to |
iat |
Yes |
Issued-at Unix timestamp. Use currentTime - 5 to buffer for clock skew |
exp |
Yes |
Expiry Unix timestamp. Use currentTime + 600 (10 minutes) |
external_id |
No |
External ID for this user in Prismatic; typically matches sub |
name |
No |
User's display name |
customer_name |
No |
If no customer with this customer ID exists yet, creates one with this name |
role |
No |
ULC only: "admin" (can deploy) or "user" (supplies user config). Defaults to "admin". |
organization and customer are the most commonly missed fields — they are not standard JWT claims and must be set explicitly.
Minimum valid payload:
{
"sub": "user-uuid",
"organization": "T3JnYW5pemF0aW9uOi...",
"customer": "your-customer-id",
"iat": 1700000000,
"exp": 1700000600
}
JWT Token Lifecycle
- Keep token lifetime short: 10 minutes (
exp: currentTime + 600)
- Add a small clock-skew buffer:
iat: currentTime - 5
- Re-authenticate before expiry: set a timer to fetch a new JWT and call
prismatic.authenticate({ token }) again ~1 minute before the token expires
- Existing iframes are updated automatically when
prismatic.authenticate is called with a new token
SDK Methods Reference
| Method |
Purpose |
prismatic.init(options?) |
Initialize the SDK (call once at app startup) |
prismatic.authenticate({ token }) |
Authenticate with a signed JWT |
prismatic.showMarketplace(options?) |
Embed the integration marketplace |
prismatic.showWorkflows(options?) |
Embed the workflow builder list |
prismatic.showWorkflow({ workflowId, ...options }) |
Open a specific workflow in the builder |
prismatic.createWorkflow(contextStableKey, { name, contextData, externalId }) |
Create a pre-configured workflow from an org-defined context (in-app automation entry point) |
prismatic.queryWorkflows(filters?) |
List the customer's workflows, filterable by context or externalId |
prismatic.showDashboard(options?) |
Embed the customer dashboard |
prismatic.showConnections(options?) |
Embed the connections management screen |
prismatic.showLogs(options?) |
Embed the logs screen |
prismatic.showComponents(options?) |
Embed the component browser |
prismatic.showComponent({ componentId, ...options }) |
Show a specific component |
prismatic.configureInstance(props) |
Open a config wizard for an integration |
prismatic.editInstanceConfiguration({ instanceId, selector, ... }) |
Render an existing instance's config wizard inline (your own dialog/drawer) with success/cancel/delete callbacks |
prismatic.setConfigVars({ iframe, configVars }) |
Programmatically set config variables |
prismatic.graphqlRequest({ query, variables? }) |
Execute authenticated GraphQL queries |
Phase-Specific References
Load only the references relevant to the current setup step. This keeps context focused.
Step 2: Signing Keys
references/authentication.md — Signing key setup (generate, import, list)
Step 3: Backend JWT Endpoint
references/authentication.md — Backend examples for Node.js, Python, Ruby, Go, C#; JWT claims reference
Step 4: Frontend SDK Setup
references/framework-examples.md — React, Next.js, Vue, Svelte integration patterns with full code
references/sdk-api.md — Full SDK type definitions, method signatures, ScreenConfiguration
Follow-up Topics (load on demand)
- Theming / dark mode / custom fonts →
references/theming-and-i18n.md
- Translations / i18n / phrase keys →
references/theming-and-i18n.md
- Marketplace filters, events, setConfigVars, reconfiguring an instance inline →
references/marketplace.md
- Workflow builder setup, workflow contexts (automation entry points) →
references/workflow-builder.md
- Dashboard, connections, logs, components →
references/additional-screens.md
- Custom marketplace UI / GraphQL →
references/custom-marketplace-ui.md
All References
Full list for manual lookup:
references/authentication.md — JWT claims, signing examples for Node.js, Python, Ruby, Go, C#, and re-authentication pattern
references/sdk-api.md — Full SDK type definitions, ScreenConfiguration, Filters, PrismaticMessageEvent enum
references/marketplace.md — showMarketplace, filters (simple and advanced), configureInstance, editInstanceConfiguration, events, setConfigVars
references/workflow-builder.md — showWorkflows, showWorkflow, workflow contexts (createWorkflow, queryWorkflows), key differences from the low-code designer
references/theming-and-i18n.md — Light/dark mode, custom fonts, loading screen, custom terms, translations
references/additional-screens.md — showDashboard, showConnections, showComponents, showLogs, common options
references/custom-marketplace-ui.md — Building a fully custom marketplace with GraphQL, TypeScript types, avatar images, reconfiguring an existing instance inline (editInstanceConfiguration)
references/framework-examples.md — React, Next.js, Vue, and Svelte integration patterns with full code examples
1---2name: embedded-patterns3description: Reference documentation for embedding Prismatic's integration marketplace and workflow builder in a web application. Covers JWT authentication, the embedded SDK, marketplace and workflow embedding, theming, i18n, additional screens, and custom marketplace UI. Use when the user asks about embedding Prismatic, JWT tokens for embedded apps, marketplace iframes, workflow builder integration, custom marketplace UI, or frontend SDK setup.4---56# Prismatic Embedded78Reference documentation for embedding Prismatic's integration marketplace and workflow builder inside a customer-facing web application.910## Core Concepts1112Embedding Prismatic means your customers never leave your app to manage integrations. The flow is:13141. **Your backend** generates a short-lived signed JWT (10 min) authenticating the customer user152. **Your frontend** calls `prismatic.authenticate({ token })` with that JWT — **never sign JWTs on the frontend**163. The frontend calls `prismatic.showMarketplace()`, `prismatic.showWorkflows()`, or another screen method to render an embedded iframe1718Before the JWT expires, the frontend re-fetches a fresh JWT from your backend and calls `prismatic.authenticate({ token })` again. Existing iframes update automatically.1920## Critical Security Rule2122**JWT tokens MUST be signed on your backend using your private key.**23Never expose the private signing key to the frontend. The frontend only receives the signed JWT string from a backend API endpoint.2425## Signing Keys2627Before any embedding can work, your organization needs a signing key. To check or create one:2829```bash30# Check existing signing keys31prism organization:signing-keys:list --extended --output json3233# Generate a new signing key (Prismatic creates the key pair)34prism organization:signing-keys:generate3536# OR: import your own key generated with OpenSSL37openssl genrsa -out my-private-key.pem 409638openssl rsa -in my-private-key.pem -pubout > my-public-key.pub39prism organization:signing-keys:import -p my-public-key.pub40```4142The private key is only shown once at generation time — store it securely (e.g., environment variable or secrets manager). Prismatic only stores the last 8 characters of the public key for identification.4344## SDK Quick Start4546```bash47npm install @prismatic-io/embedded48```4950```typescript51import prismatic from "@prismatic-io/embedded";5253// 1. Initialize once on app startup (before authentication)54prismatic.init();5556// 2. Authenticate with a JWT fetched from YOUR backend57const { token } = await fetch("/api/integration-token").then(r => r.json());58await prismatic.authenticate({ token });5960// 3. Show an embedded screen61prismatic.showMarketplace({ selector: "#integrations-div", usePopover: false });62```6364## JWT Required Claims6566Every JWT must include these Prismatic-specific fields — standard JWT libraries won't add them automatically:6768| Claim | Required | Description |69|-------|----------|-------------|70| `sub` | Yes | Unique user ID (UUID or similar) |71| `organization` | Yes | Prismatic organization ID (from org settings → Embedded tab) |72| `customer` | Yes | Your internal customer/tenant ID — identifies which customer this user belongs to |73| `iat` | Yes | Issued-at Unix timestamp. Use `currentTime - 5` to buffer for clock skew |74| `exp` | Yes | Expiry Unix timestamp. Use `currentTime + 600` (10 minutes) |75| `external_id` | No | External ID for this user in Prismatic; typically matches `sub` |76| `name` | No | User's display name |77| `customer_name` | No | If no customer with this `customer` ID exists yet, creates one with this name |78| `role` | No | ULC only: `"admin"` (can deploy) or `"user"` (supplies user config). Defaults to `"admin"`. |7980`organization` and `customer` are the most commonly missed fields — they are not standard JWT claims and must be set explicitly.8182Minimum valid payload:8384```json85{86 "sub": "user-uuid",87 "organization": "T3JnYW5pemF0aW9uOi...",88 "customer": "your-customer-id",89 "iat": 1700000000,90 "exp": 170000060091}92```9394## JWT Token Lifecycle9596- Keep token lifetime short: **10 minutes** (`exp: currentTime + 600`)97- Add a small clock-skew buffer: `iat: currentTime - 5`98- **Re-authenticate before expiry**: set a timer to fetch a new JWT and call `prismatic.authenticate({ token })` again ~1 minute before the token expires99- Existing iframes are updated automatically when `prismatic.authenticate` is called with a new token100101## SDK Methods Reference102103| Method | Purpose |104|--------|---------|105| `prismatic.init(options?)` | Initialize the SDK (call once at app startup) |106| `prismatic.authenticate({ token })` | Authenticate with a signed JWT |107| `prismatic.showMarketplace(options?)` | Embed the integration marketplace |108| `prismatic.showWorkflows(options?)` | Embed the workflow builder list |109| `prismatic.showWorkflow({ workflowId, ...options })` | Open a specific workflow in the builder |110| `prismatic.createWorkflow(contextStableKey, { name, contextData, externalId })` | Create a pre-configured workflow from an org-defined context (in-app automation entry point) |111| `prismatic.queryWorkflows(filters?)` | List the customer's workflows, filterable by context or `externalId` |112| `prismatic.showDashboard(options?)` | Embed the customer dashboard |113| `prismatic.showConnections(options?)` | Embed the connections management screen |114| `prismatic.showLogs(options?)` | Embed the logs screen |115| `prismatic.showComponents(options?)` | Embed the component browser |116| `prismatic.showComponent({ componentId, ...options })` | Show a specific component |117| `prismatic.configureInstance(props)` | Open a config wizard for an integration |118| `prismatic.editInstanceConfiguration({ instanceId, selector, ... })` | Render an existing instance's config wizard inline (your own dialog/drawer) with success/cancel/delete callbacks |119| `prismatic.setConfigVars({ iframe, configVars })` | Programmatically set config variables |120| `prismatic.graphqlRequest({ query, variables? })` | Execute authenticated GraphQL queries |121122## Phase-Specific References123124Load only the references relevant to the current setup step. This keeps context focused.125126### Step 2: Signing Keys127- `references/authentication.md` — Signing key setup (generate, import, list)128129### Step 3: Backend JWT Endpoint130- `references/authentication.md` — Backend examples for Node.js, Python, Ruby, Go, C#; JWT claims reference131132### Step 4: Frontend SDK Setup133- `references/framework-examples.md` — React, Next.js, Vue, Svelte integration patterns with full code134- `references/sdk-api.md` — Full SDK type definitions, method signatures, ScreenConfiguration135136### Follow-up Topics (load on demand)137- Theming / dark mode / custom fonts → `references/theming-and-i18n.md`138- Translations / i18n / phrase keys → `references/theming-and-i18n.md`139- Marketplace filters, events, setConfigVars, reconfiguring an instance inline → `references/marketplace.md`140- Workflow builder setup, workflow contexts (automation entry points) → `references/workflow-builder.md`141- Dashboard, connections, logs, components → `references/additional-screens.md`142- Custom marketplace UI / GraphQL → `references/custom-marketplace-ui.md`143144## All References145146Full list for manual lookup:147148- `references/authentication.md` — JWT claims, signing examples for Node.js, Python, Ruby, Go, C#, and re-authentication pattern149- `references/sdk-api.md` — Full SDK type definitions, ScreenConfiguration, Filters, PrismaticMessageEvent enum150- `references/marketplace.md` — showMarketplace, filters (simple and advanced), configureInstance, editInstanceConfiguration, events, setConfigVars151- `references/workflow-builder.md` — showWorkflows, showWorkflow, workflow contexts (createWorkflow, queryWorkflows), key differences from the low-code designer152- `references/theming-and-i18n.md` — Light/dark mode, custom fonts, loading screen, custom terms, translations153- `references/additional-screens.md` — showDashboard, showConnections, showComponents, showLogs, common options154- `references/custom-marketplace-ui.md` — Building a fully custom marketplace with GraphQL, TypeScript types, avatar images, reconfiguring an existing instance inline (editInstanceConfiguration)155- `references/framework-examples.md` — React, Next.js, Vue, and Svelte integration patterns with full code examples