> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://knowledge.clym.io/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# Strapi plugin

# Clym CMP for Strapi

The Clym CMP plugin for Strapi allows you to quickly integrate Clym's consent and accessibility management solutions into your Strapi-powered website without needing to manually add the installation embed code to your project files. Once installed and configured, the plugin connects your website to your Clym account, making setup and ongoing management simpler and more streamlined. The plugin will automatically inject the Clym widget across your front-end pages, allowing you to easily deploy and manage Clym across your website.

Below, you can find details on:
* [The requirements to use the Clym CMP plugin](#2-requirements)
* [How to install the plugin on your Strapi website](#2-installation)
* [How to configure your Clym widget](#2-configuration)
* [How the integration works](#2-how-it-works)
* [How to verify the installation was successful](#2-verification)

---

## Requirements

* Strapi v5.x
* Node.js 18 or higher
* A Clym account — log in at [auth.clym.io](https://auth.clym.io) or register at [register.clym.io](https://register.clym.io)

---

## Installation

In your Strapi project root, run:

```bash
npm install strapi-plugin-clym-cmp
```

Then register the plugin in your Strapi configuration. Create or edit `config/plugins.ts` (or `config/plugins.js`):

```ts
export default () => ({
  'clym-cmp': {
    enabled: true,
  },
});
```

Restart your Strapi server:

```bash
npm run develop
```

---

## Configuration

1. Open the Strapi admin panel
2. Navigate to **Content Manager → Single Types → Clym Settings**
3. Enter your **Widget ID** in the field provided
4. Click **Save**

Your Widget ID can be found in your Clym Control Center account at [auth.clym.io](https://auth.clym.io). After signing into your Clym account, your property ID will be available in your URL.

![](https://storage.crisp.chat/users/helpdesk/website/-/a/e/3/8/ae38f50f15c00000/property-id_5g2vvx.png)


---

## How It Works

The plugin registers a Koa middleware that intercepts every HTML response and injects two script tags into the `<head>` section before the response is sent to the browser:

```html
<script src='https://config.clym-widget.net/v2/YOUR-WIDGET-ID.js'></script>
<script src='https://widget-next.clym-sdk.net/v2/stub.js' data-property='YOUR-WIDGET-ID'></script>
```

---

## Verification

Visit any page served by your Strapi front-end and view the page source. You should see the two Clym script tags immediately after the opening `<head>` tag.

You can also use the test route included in the plugin:

```
GET /clym-test
```

This returns a minimal HTML page you can inspect to confirm the scripts are injected correctly.

---

## Support

If you encounter any challenges, please reach out to support@clym.io.
