@chili-publish/grafx-experience-extension-sdk
v1.0.0
Published
Helpers for building GraFx Experience extensions
Readme
@chili-publish/grafx-experience-extension-sdk
Helpers for building GraFx Experience extensions
Public getting started, Admin Console setup, and API auth live on docs.chiligrafx.com. Protocol, React wiring, and TypeDoc stay in this repository.
Quick start with AI
Fill in <APP_NAME> and <EXTENSION_BUILDERS_DESCRIBE_THEIR_ADDITIONAL_FEATURE_REQUIREMENTS_HERE>, then paste this into Cursor, Lovable, or a similar AI tool.
You are building a GraFx Experience extension called "<APP_NAME>". It is a React + Vite + TypeScript app that uses @chili-publish/grafx-experience-extension-sdk and runs embedded in GraFx Experience.
Before writing code, read and follow these sources of truth:
- Public getting started: https://docs.chiligrafx.com/GraFx-Developers/grafx-experience/extension-sdk/
- How the host embeds you: https://github.com/chili-publish/grafx-experience-extension-sdk/blob/main/docs/embedding.md
- React setup and wiring: https://github.com/chili-publish/grafx-experience-extension-sdk/blob/main/docs/react-guide.md
- SDK flows you must support: https://github.com/chili-publish/grafx-experience-extension-sdk/blob/main/docs/flows.md
Do not invent your own host communication, handshake, or API auth. Prefer the patterns and APIs described in those docs over improvising.
App requirements (from the builder): <EXTENSION_BUILDERS_DESCRIBE_THEIR_ADDITIONAL_FEATURE_REQUIREMENTS_HERE>
When done, verify against the docs:
- Embedding constraints in embedding.md are respected
- Structure matches react-guide.md
- Required flows from flows.md are implemented
- The app requirements above are covered
Get started
Install
# Stable
npm install @chili-publish/grafx-experience-extension-sdk
# RC (shared testing channel on main)
npm install @chili-publish/grafx-experience-extension-sdk@rc
# Canary (feature-branch preview — see releasing docs)
npm install @chili-publish/grafx-experience-extension-sdk@canaryHow we version and publish: Releasing.
Usage
// For ESM
import { createExtensionSDK, type IExtensionSDK } from "@chili-publish/grafx-experience-extension-sdk";
// For CommonJS
// const { createExtensionSDK } = require("@chili-publish/grafx-experience-extension-sdk");
const sdk: IExtensionSDK = createExtensionSDK();
// Handshake flow
const { authToken, extensionDetails, designTokens } = await sdk.connect();
// Fields are null when that host surface omitted them.Create and use the SDK once per app. Later createExtensionSDK() calls return the same instance.
See Flows for all available flows. Building with React? See Building a React extension.
Documentation
Public (docs.chiligrafx.com)
- Get started with the Extension SDK — scaffold, connect, first API call, embed
- Create a local extension — Admin Console registration
- API overview — OAuth refresh tokens and JWT claims
- Experience Extension API — OpenAPI for platform endpoints
In this repository
- How GraFx Experience embeds an extension — iframe,
tenantUrl, and host API (ExtensionSDKHost) - Building a React extension — Bootstrap a React app with the Extension SDK
- Flows — Handshake, design tokens, API calls, token refresh, page settings, navigation
- Releasing — Changesets, stable and RC publishes (maintainers)
- Local API reference — TypeDoc for classes, interfaces, and payloads
Local API reference
Run npm run docs after installing dependencies, then open docs/api/index.html locally.
Local development
npm install| Command | Description |
| ------------------------- | ---------------------------------------------------- |
| npm run dev | Serve the playground for embedding in the parent app |
| npm run build | Emit dist/ (ESM + CJS + types) |
| npm run preview | Preview the production playground build |
| npm run docs | Generate HTML API docs under docs/api/ |
| npm run docs:check | Validate TypeDoc without writing output |
| npm run check:types | Check published package types with arethetypeswrong |
| npm run changeset | Add a changeset for the next release |
| npm run release:rc:enter| Enter RC prerelease mode on main |
| npm run release:rc:exit | Exit RC prerelease mode |
npm run dev serves the playground at https://localhost:5000 (accept the
self-signed certificate warning once). Use this HTTPS origin for the parent
iframe URL and add it to the API's CORS allowlist.
