> For the complete Lynkow documentation index in agent-friendly format, see [llms.txt](/llms.txt).

# Get cookie consent config

**Published**: 2026-11-30
**Category**: Analytics & Tracking

## `GET /cookie-consent/config`

**Get cookie consent config**

Returns the cookie-consent banner configuration for the site:
layout, theme, primary color, texts, declared categories, and the
third-party scripts gated on consent. A site with no consent settings
gets a default configuration with `enabled` false.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `locale` | query | string | No | Language of the banner, matched by exact tag, then base language. An unsupported value uses the site default, then English. |


### Responses

| Status | Description |
| --- | --- |
| `200` | Successful response |
| `402` | The site subscription does not currently permit this operation |


> **Notes:** Cache: `Cache-Control: public, max-age=0, s-maxage=300`. Rate-limit
> bucket: general.

### SDK

```typescript
import { createClient } from 'lynkow'

const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID! })

const config = await lynkow.cookies.getConfig({
  fetchOptions: { next: { revalidate: 3600, tags: ['lynkow:consent'] } },
})
if (config.enabled) {
  console.log(config.categories) // [{id: 'necessary', ...}, {id: 'analytics', ...}]
  console.log(config.texts.acceptAll) // "Accept all"
}
```

### Examples

```curl
curl "https://api.lynkow.com/storefront/{siteId}/cookie-consent/config"
```

```javascript
const res = await fetch(`https://api.lynkow.com/storefront/${siteId}/cookie-consent/config`)
const { data } = await res.json()
```

### Response Example

```json
{
  "data": {
    "enabled": true,
    "consentMode": "opt-in",
    "showOnFirstVisit": true,
    "position": "bottom-right",
    "layout": "floating",
    "theme": "light",
    "primaryColor": "#1E40AF",
    "borderRadius": 12,
    "fontSize": 14,
    "showCustomizeButton": true,
    "orientation": "auto",
    "maxWidth": 480,
    "buttonSize": "compact",
    "themeStyles": {
      "light": {
        "primaryColor": "#1E40AF",
        "bgColor": "#FFFFFF",
        "textColor": "#0F172A"
      },
      "dark": {
        "primaryColor": "#60A5FA",
        "bgColor": "#0F172A",
        "textColor": "#F8FAFC"
      }
    },
    "texts": {
      "description": "We use cookies to improve your experience.",
      "acceptAll": "Accept all",
      "rejectAll": "Reject all",
      "customize": "Customize",
      "save": "Save preferences",
      "privacyPolicy": "Privacy policy",
      "required": "(required)"
    },
    "categories": [
      {
        "id": "necessary",
        "name": "Necessary",
        "description": "Required for the site to function.",
        "required": true,
        "enabled": true
      },
      {
        "id": "analytics",
        "name": "Analytics",
        "description": "Helps us understand usage.",
        "required": false,
        "enabled": true
      }
    ],
    "privacyPolicyUrl": "https://acme.io/privacy",
    "cookiePolicyUrl": "https://acme.io/cookies",
    "thirdPartyScripts": []
  }
}
```

---