
Marketplace Sdk Reference
Wire Sitecore Marketplace ClientSDK AI mutations such as brand review for copy and assets inside a marketplace-hosted app.
Install
npx skills add https://github.com/vercel-labs/sitecore-skills --skill marketplace-sdk-referenceWhat is this skill?
- Register ClientSDK with AI module via @sitecore-marketplace-sdk/client and @sitecore-marketplace-sdk/ai
- ai.skills.generateBrandReview mutation for text, image URL, and document URL inputs
- sitecoreContextId from application.context query resourceAccess live context
- brandkitId plus structured input body patterns for marketing asset checks
- TypeScript-first examples for parent-window ClientSDK.init target
Adoption & trust: 20 installs on skills.sh; 3 GitHub stars; 2/3 security scanners passed (skills.sh audits).
Recommended Skills
Microsoft Foundrymicrosoft/azure-skills
Azure Aimicrosoft/azure-skills
Azure Hosted Copilot Sdkmicrosoft/azure-skills
Lark Eventlarksuite/cli
Running Claude Code Via Litellm Copilotxixu-me/skills
Setup Matt Pocock Skillsmattpocock/skills
Journey fit
Primary fit
Primary shelf is Build integrations because module registration and client.mutate patterns are implemented in application code. The skill documents SDK query/mutate APIs against Sitecore—not UI components—so integrations is the canonical subphase.
Common Questions / FAQ
Is Marketplace Sdk Reference safe to install?
skills.sh reports 2 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.
SKILL.md
READMESKILL.md - Marketplace Sdk Reference
# AI Skills Package API Reference ## Module Registration ```typescript import { ClientSDK } from "@sitecore-marketplace-sdk/client"; import { AI } from "@sitecore-marketplace-sdk/ai"; const client = await ClientSDK.init({ target: window.parent, modules: [AI], }); ``` ## Brand Review API The Brand Review API provides AI-powered content analysis against a brand kit configured in Sitecore. ### Client-Side | Key | Type | Description | |-----|------|-------------| | `ai.skills.generateBrandReview` | Mutation | Generate a brand review for content | ```typescript // Get sitecoreContextId from application context const { data: appContext } = await client.query("application.context"); const sitecoreContextId = appContext.resourceAccess[0].context.live; // Text review const { data: review } = await client.mutate("ai.skills.generateBrandReview", { body: { brandkitId: "your-brand-kit-id", input: { text: "Your marketing copy here..." }, }, query: { sitecoreContextId }, }); // Image review (by URL) const { data: review } = await client.mutate("ai.skills.generateBrandReview", { body: { brandkitId: "your-brand-kit-id", input: { banner: { name: "banner.png", type: "image", url: "https://example.com/banner.png", mimeType: "image/png", }, }, }, query: { sitecoreContextId }, }); // Document review (by URL) const { data: review } = await client.mutate("ai.skills.generateBrandReview", { body: { brandkitId: "your-brand-kit-id", input: { campaign: { name: "brief.pdf", type: "document", url: "https://example.com/brief.pdf", mimeType: "application/pdf", }, }, }, query: { sitecoreContextId }, }); ``` ## Server-Side Client For full-stack (Auth0) apps: ```typescript import { experimental_createAIClient } from "@sitecore-marketplace-sdk/ai"; const aiClient = await experimental_createAIClient({ getAccessToken: async () => { return await getYourAccessToken(); }, }); const review = await aiClient.skills.generateBrandReview({ body: { brandkitId: "your-brand-kit-id", input: { text: "Content to review..." }, }, query: { sitecoreContextId: "your-context-id" }, }); ``` # Client Package API Reference ## ClientSDK.init(config) Creates and initializes the SDK client. ```typescript import { ClientSDK } from "@sitecore-marketplace-sdk/client"; const client = await ClientSDK.init({ target: window.parent, // Required: target window (typically window.parent) modules?: Module[]; // Optional: Additional modules (XMC, AI) }); ``` ## QueryMap — Available Queries Results are returned as `{ data, unsubscribe? }`. All keys support `subscribe: true` for live updates. | Query Key | Description | Returns | |-----------|-------------|---------| | `application.context` | App context incl. `sitecoreContextId` | `ApplicationContext` | | `host.user` | Current user info | `UserInfo` | | `host.state` | Current host state | `XmcXmAppsHostState \| XmcPagesContextViewHostState` | | `host.route` | Current host route | `string` | | `pages.context` | Current page context (Pages editor) | `PagesContext` | | `site.context` | Current site context | `SiteContext` | ### Usage ```typescript const { data: appContext } = await client.query("application.context"); // sitecoreContextId: appContext.resourceAccess[0].context.live const { data: user } = await client.query("host.user"); const { data: hostState } = await client.query("host.state"); const { data: route } = await client.query("host.route"); ``` ## MutationMap — Available Mutations | Mutation Key | Description | Params | |-------------|-------------|--------| | `pages.context` | Navigate to a page in the Pages editor | `{ itemId: string }` | | `pages.reloadCanvas` | Reload the Pages canvas | none | ### Usage ```typescript // Navigate to a different page await client.mutate("pages.context", { params: { itemId: "{12345678-ABCD-1234-ABCD-1234567