open-index/open-npm huggingface dataset:
npm package: @sitecore-marketplace-sdk/ai
Description: The `ai` package extends the Client SDK and provides type-safe interfaces for interacting with the following AI skills APIs: - [Brand Review REST API](https://api-docs.sitecore.com/ai-capabilities/ai-brand-review-admin-rest-api) - using AI-powered analysi
Author: Sitecore Corporation
Latest version: 0.1.0

# Sitecore Marketplace SDK - `ai` package

The `ai` package extends the Client SDK and provides type-safe interfaces for interacting with the following AI skills APIs:
- [Brand Review REST API](https://api-docs.sitecore.com/ai-capabilities/ai-brand-review-admin-rest-api) - using AI-powered analysis, evaluate whether input content and assets comply with the guidelines defined in a brand kit.

## Prerequisites
- Node.js 16 or later. Check your installed version by using the `node --version` command.
- npm 10 or later. Check your installed version by using the `npm --version` command.
- A Stream subscription.

## Installation

```bash
npm install @sitecore-marketplace-sdk/ai
```

## Initialization
Before you use queries or mutations, you must initialize the AI module.

1. Update the code where you initialized the Client SDK by importing `AI` and adding it to `config`:

```typescript
// utils/hooks/useMarketplaceClient.ts
import { AI } from '@sitecore-marketplace-sdk/ai';

// ...
const config = {
  // ...
  modules: [AI] // Extend Client SDK with `AI`
};
```

## Usage

### Make a mutation
Use the `mutate` method to trigger changes in Sitecore (the host). Pass a value to the method depending on the change you want to make.

For example, to generate a brand review using the AI skills API:

```typescript
const generateBrandReview = async () => {
  await client?.mutate('ai.skills.generateBrandReview', {
    body: {
      brandkitId: 'your-brand-kit-id',
      input: { text: 'Content to review' },
    },
  });
};
```

For an overview of all the possible values, refer to the [`MutationMap` interface](../../docs/modules/ai/interfaces/MutationMap.md).

> [!NOTE]
> Behind the scenes, the Host SDK (integrated via the internal `core` package) attaches the required user token and performs the HTTP request on behalf of the Marketplace app (the client).

## Documentation

For more information, refer to the reference documentation in the `/docs` folder.

## License 
This package is part of the Sitecore Marketplace SDK, licensed under the Apache 2.0 License. Refer to the [LICENSE](../../LICENSE.md) file in the repository root.

## Status
The `client` package is actively maintained as part of the Sitecore Marketplace SDK.
npm package: @sitecore-marketplace-sdk/core
Description: `core` is an internal package used by other Sitecore Marketplace SDK packages. Developers typically do not need to directly interact with it.
Author: Sitecore Corporation
Latest version: 0.3.2

# Sitecore Marketplace SDK - `core` package

`core` is an internal package used by other Sitecore Marketplace SDK packages. Developers typically do not need to directly interact with it.

The `core` package sets up secure communication between a Marketplace application and Sitecore, using the web browser's [PostMessage API](https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage). It handles low-level details, such as:
- secure handshake
- request-response pattern
- event publish-subscribe system
- origin validation

## Prerequisites
- Node.js 16 or later. Check your installed version by using the `node --version` command.
- npm 10 or later. Check your installed version by using the `npm --version` command.

## Installation
`core` is automatically installed when you install other Marketplace SDK packages, such as `client`.

## License 
This package is part of the Sitecore Marketplace SDK, licensed under the Apache 2.0 License. Refer to the [LICENSE](../../LICENSE.md) file in the repository root.

## Status
The `core` package is actively maintained as part of the Sitecore Marketplace SDK.