Marketplace SDK packages
The Marketplace SDK is modular, allowing you to build robust and maintainable apps with optimized bundle sizes. You can install only the packages you need for the functionalities you want to develop. This topic describes the purpose of every required and optional SDK package so you can choose the ones you need for your application.
Here's an overview of all the SDK packages:
Required packages
client
The client package is required for all Marketplace apps. It connects your app to Sitecore, allowing the two to securely communicate. The SDK connects your app by loading it in Sitecore inside a sandboxed iframe. The iframe and its parent window securely communicate using the web browser's PostMessage API.
After initializing client, you can start making queries and mutations that do not require access to product-specific APIs.
Optional packages
All optional packages require the client package.
Optional packages give your app API access to specific Sitecore products or capabilities and are only required when your app is configured to use those APIs. Each optional package corresponds to a Sitecore product or capability that the Marketplace is compatible with.
Note the following about API requests:
-
When using the Marketplace SDK built-in authorizationbuilt-in authorization, the SDK automatically authorizes your requests to all the Sitecore APIs your Marketplace app has access to, with no manual authorization required.
-
All requests to Sitecore APIs must contain the Context ID of your SitecoreAI environment, which you can retrieve from the application context.
-
Requests to Sitecore APIs only work in the SitecoreAI environments where your app is installed.
xmc
The xmc package provides type-safe interfaces for interacting with SitecoreAI APIs. You only need this package if you select SitecoreAI APIs during app configuration. Use it to integrate SitecoreAI functionalities into your app. The module supports the following APIs:
After initializing xmc, you can make API requests in the following ways:
-
From the client side - start making queries and mutations that require access to SitecoreAI APIs.
-
From the server side - if your app architecture supports server-side API calls to SitecoreAI APIs, you can use the experimental functions to access SitecoreAI APIs directly from the server.
ai
The ai package provides type-safe interfaces for interacting with AI skills APIs. AI skills APIs provide LLM-powered capabilities grounded in SitecoreAI data. You only need this package if you select AI skills APIs during app configuration. Use it to integrate AI functionalities into your app. The module supports the following APIs:
After initializing ai, you can make API requests in the following ways:
-
From the client side - start making mutations that require access to AI skills APIs.
-
From the server side - if your app architecture supports server-side API calls to AI skills APIs, you can use the experimental functions to access AI skills APIs directly from the server.