1. Developer guides

Initialize the ai package

Version: 0.4
Before you begin
  • Complete the SDK quick start.

    In the quick start, you initialize the Marketplace SDK client package, which is required for every Marketplace app.

The Marketplace SDK ai package is optional by default, but you must initialize it if your app needs to interact with AI skills APIs. AI skills APIs provide LLM-powered capabilities grounded in SitecoreAI data.

To initialize the ai package:

  1. If you haven't installed the package yet, install it by running the following command in your terminal:

    npm install @sitecore-marketplace-sdk/ai
  2. In the useMarketplaceClient.ts hook, import AI from the package:

    import { AI } from "@sitecore-marketplace-sdk/ai";
  3. In the same file, in the getMarketplaceClient function, in the config variable, add AI to the list of modules, then save your changes:

    const config = {
      target: window.parent,
      modules: [AI], // add the module
    };

You can now start making queries and mutations that require access to AI skills APIs, for example, make a Brand Review API request. For a full list of operations, refer to the reference documentation.

If you have suggestions for improving this article, let us know!