Configuration
Configure the Consentify widget appearance and behavior with data attributes.
Data Attributes
Configure the widget using data-* attributes on the script tag:
| Attribute | Required | Default | Description |
|---|---|---|---|
data-site-id | Yes | — | Your unique site identifier from the dashboard |
data-position | No | "bottom-right" | Banner position on the page |
data-theme | No | "auto" | Color theme for the banner |
data-accent | No | "#3b82f6" | Accent color (hex format) for buttons |
Position Options
| Value | Description |
|---|---|
"bottom-right" | Bottom right corner (default) |
"bottom-left" | Bottom left corner |
"bottom-center" | Bottom center |
"top-right" | Top right corner |
"top-left" | Top left corner |
"top-center" | Top center |
Theme Options
| Value | Description |
|---|---|
"light" | Light background with dark text |
"dark" | Dark background with light text |
"auto" | Follows user's system preference (default) |
Server-side Configuration
Additional widget settings are configured in the Consentify dashboard and returned from the /api/consent/config/:siteId endpoint:
- Site name — displayed in the banner title
- Consent categories — the categories shown to visitors (name, description, required/default flags)
- Privacy policy URL — link shown in the banner
- Banner text — customizable title, description, and button labels
Storage
Consent preferences are stored in a consentify cookie managed by @consentify/core. The cookie contains a URL-encoded JSON snapshot:
{
"policy": "a1b2c3",
"givenAt": "2026-03-10T12:00:00.000Z",
"choices": { "analytics": true, "marketing": false }
}The policy field is a hash of your consent categories. When you change categories in the dashboard, the hash changes and visitors are prompted to consent again.
When a valid consent cookie exists, the banner is not shown on subsequent visits.