Basic embed
Add the following HTML to any page where you want the policy displayed:{siteId} with your site ID. The script fetches the policy content and renders it inside the #katla-policy element.
Formats
Control which policy content is rendered with theformat query parameter:
| Parameter | Description |
|---|---|
full | Full cookie + privacy policy (default) |
cookie | Cookie policy only |
table | Cookie table only |
Locale
Set the language with thelocale query parameter:
locale is specified, the script auto-detects the visitor’s browser language and falls back to English.
Custom styling
You can apply CSS classes and inline styles to every generated HTML element by settingwindow.KatlaPolicy before the script loads.
Supported element keys
| Key | Element |
|---|---|
wrapper | Outer <div> wrapping all content |
h1 | <h1> headings |
h2 | <h2> headings |
h3 | <h3> headings |
p | <p> paragraphs |
table | <table> elements |
thead | <thead> elements |
tbody | <tbody> elements |
tr | <tr> rows |
th | <th> header cells |
td | <td> data cells |
ul | <ul> lists |
li | <li> list items |
a | <a> links |
strong | <strong> bold text |
em | <em> italic text |
Using CSS classes
Ideal for Tailwind or other utility-first frameworks:Using inline styles
For sites without a CSS framework:Combining classes and styles
Bothclasses and styles can be used together. When both are set for the same element, both the class and style attributes are applied:
JavaScript API
After the script loads,window.KatlaPolicy exposes the following methods:
| Method | Description |
|---|---|
render(selector?) | Re-render the policy into the given CSS selector (defaults to #katla-policy) |
getMarkdown() | Returns a Promise that resolves with the raw markdown string |
getLocale() | Returns the detected or configured locale string |
Direct URLs
Policy content is also available as standalone files:| Format | URL |
|---|---|
| HTML | https://dist.katla.app/{siteId}/policy.html |
| JSON | https://dist.katla.app/{siteId}/policy.json |
| Markdown | https://dist.katla.app/{siteId}/policy.md |
| JavaScript | https://dist.katla.app/{siteId}/policy.js |
locale and format query parameters.