
Marketplace Sdk Reference
- 32 installs
- 3 repo stars
- Updated April 6, 2026
- vercel-labs/sitecore-skills
marketplace-sdk-reference documents Sitecore Marketplace SDK APIs.
About
The marketplace-sdk-reference skill answers questions about Sitecore Marketplace SDK v0.4 APIs across client, xmc, and ai packages. Check local reference markdown files first, then WebFetch developers.sitecore.com marketplace SDK docs. Provides TypeScript examples for ClientSDK.init, query, mutate, and subscribe patterns. Maps packages: client for core queries and mutations, xmc for Sites Pages Authoring Content Transfer Search and Agent APIs, ai for Brand Review. Use when users ask about SDK methods, types, queries, mutations, or subscriptions.
- SDK v0.4 reference for client, xmc, and ai packages.
- TypeScript examples for query mutate subscribe patterns.
- Local reference files plus live docs fallback.
- Specifies package ownership per API area.
- Quick ClientSDK.init and common patterns.
Marketplace Sdk Reference by the numbers
- 32 all-time installs (skills.sh)
- +1 installs in the week ending Jul 27, 2026 (Skillselion tracking)
- Ranked #934 of 1,901 Documentation skills by installs in the Skillselion catalog
- Security screen: LOW risk (skills.sh audit)
- Data as of Jul 27, 2026 (Skillselion catalog sync)
marketplace-sdk-reference capabilities & compatibility
- Capabilities
- sdk architecture and quick reference
- Use cases
- documentation · api development
What marketplace-sdk-reference says it does
Sitecore Marketplace SDK API reference
npx skills add https://github.com/vercel-labs/sitecore-skills --skill marketplace-sdk-referenceAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 32 |
|---|---|
| repo stars | ★ 3 |
| Security audit | 2 / 3 scanners passed |
| Last updated | April 6, 2026 |
| Repository | vercel-labs/sitecore-skills ↗ |
How do I call a Sitecore Marketplace SDK query or mutation?
Reference guide for Sitecore Marketplace SDK client, XMC, and AI package APIs.
Who is it for?
Developers integrating Sitecore Marketplace SDK features.
Skip if: Skip for non-Sitecore projects.
When should I use this skill?
User asks about Marketplace SDK methods or types.
What you get
TypeScript SDK usage with correct package and method.
Files
Sitecore Marketplace SDK Reference
You are the reference guide for the Sitecore Marketplace SDK (v0.4). Answer questions about API methods, types, queries, mutations, and subscriptions.
How to Answer
1. First check the reference files below for the answer 2. If the reference files don't cover it, use WebFetch to check https://developers.sitecore.com/marketplace/sdk for the latest docs 3. Always provide TypeScript code examples 4. Always specify which package the API belongs to (client, xmc, or ai)
SDK Architecture
The SDK has 3 packages:
@sitecore-marketplace-sdk/client (required)
The core client. Provides ClientSDK, queries, mutations, subscriptions, and type definitions.
- See client-api.md for full API reference
@sitecore-marketplace-sdk/xmc
XM Cloud APIs for Sites, Pages, Authoring, Content Transfer, Search, and Agent.
- See xmc-api.md for full API reference
@sitecore-marketplace-sdk/ai
AI Skills APIs for Brand Review.
- See ai-api.md for full API reference
Quick Reference
Client Initialization
import { ClientSDK } from "@sitecore-marketplace-sdk/client";
const client = await ClientSDK.init({
target: window.parent,
});Common Patterns
// Query — returns { data, unsubscribe? }
const { data } = await client.query("queryName", params);
// Mutation
const { data } = await client.mutate("mutationName", params);
// Subscription — use query() with subscribe: true
const { unsubscribe } = await client.query("queryName", {
subscribe: true,
onSuccess: (data) => console.log(data),
});
unsubscribe?.();Reference Files
- Client API — Core client queries, mutations, subscriptions, and types
- XM Cloud API — XM Cloud API reference
- AI API — AI Skills API reference
AI Skills Package API Reference
Module Registration
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 |
// 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:
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.
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 \ |
host.route | Current host route | string |
pages.context | Current page context (Pages editor) | PagesContext |
site.context | Current site context | SiteContext |
Usage
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
// Navigate to a different page
await client.mutate("pages.context", {
params: { itemId: "{12345678-ABCD-1234-ABCD-123456789ABC}" },
});
// Reload the canvas after content changes
await client.mutate("pages.reloadCanvas");Subscriptions
Subscriptions use the query() method with subscribe: true — there is no separate subscribe() method.
// Subscribe to host state changes
const { unsubscribe } = await client.query("host.state", {
subscribe: true,
onSuccess: (newState) => {
console.log("Host state changed:", newState);
},
});
// Subscribe to page context changes (Pages editor)
const { unsubscribe } = await client.query("pages.context", {
subscribe: true,
onSuccess: (pagesContext) => {
console.log("Page changed:", pagesContext);
},
});
// Always clean up subscriptions
unsubscribe?.();React Hooks
The scaffold generates React hooks for convenient SDK access:
import { useMarketplaceClient } from "@/components/providers/marketplace";
function MyComponent() {
const { client } = useMarketplaceClient();
// Use client?.query(), client?.mutate()
}XM Cloud Package API Reference
Module Registration
import { ClientSDK } from "@sitecore-marketplace-sdk/client";
import { XMC } from "@sitecore-marketplace-sdk/xmc";
const client = await ClientSDK.init({
target: window.parent,
modules: [XMC],
});Client-Side APIs
All XMC queries and mutations are prefixed with xmc.. Most require sitecoreContextId, obtained from application.context:
const { data: appContext } = await client.query("application.context");
const sitecoreContextId = appContext.resourceAccess[0].context.live;Sites API
| Key | Type | Description |
|---|---|---|
xmc.sites.listSites | Query | List all sites |
const { data: sites } = await client.query("xmc.sites.listSites", {
params: {
query: { sitecoreContextId },
},
});Pages API
| Key | Type | Description |
|---|---|---|
xmc.pages.retrievePage | Query | Get a specific page by ID |
const { data: page } = await client.query("xmc.pages.retrievePage", {
params: {
path: { pageId },
query: { site, sitecoreContextId, language },
},
});Authoring API (GraphQL)
| Key | Type | Description |
|---|---|---|
xmc.authoring.graphql | Mutation | Execute a GraphQL query/mutation against XM Cloud Authoring API |
const { data } = await client.mutate("xmc.authoring.graphql", {
params: {
query: { sitecoreContextId },
body: {
query: `
query GetItem($path: String!) {
item(path: $path, language: "en") {
id
name
fields { name value }
}
}
`,
variables: { path: "/sitecore/content/Home" },
},
},
});Content Transfer API
| Key | Type | Description |
|---|---|---|
xmc.contentTransfer.createContentTransfer | Mutation | Create a content transfer |
Page Context Subscription
Subscribe to page changes using the base pages.context query with subscribe: true:
const { unsubscribe } = await client.query("pages.context", {
subscribe: true,
onSuccess: (pagesContext) => {
console.log("Page changed:", pagesContext);
},
});
unsubscribe?.();Server-Side Client
For full-stack (Auth0) apps, use the server-side client in API routes or Server Actions:
import { experimental_createXMCClient } from "@sitecore-marketplace-sdk/xmc";
const xmcClient = await experimental_createXMCClient({
getAccessToken: async () => {
// Return the access token from your auth provider (e.g. Auth0)
return await getYourAccessToken();
},
});
const languages = await xmcClient.sites.listLanguages({
query: { sitecoreContextId: "your-context-id" },
});Related skills
FAQ
What does marketplace-sdk-reference do?
marketplace-sdk-reference documents Sitecore Marketplace SDK APIs.
When should I use marketplace-sdk-reference?
User asks about Marketplace SDK methods or types.
Is this skill safe to install?
Review the Security Audits panel on this page before installing in production.