Orejime requires configuration to function. This is typically done by assigning an object to window.orejimeConfig before initialization.
Required options:
privacyPolicyUrl: A link to your privacy policy page (required for GDPR compliance).purposes: An array of third-party purposes to manage.
Purpose Object Schema:
id (string): Internal identifier.title (string): Display name in the banner/modal.description (string, optional): Detailed description.cookies (array, optional): A list of regex expressions, strings, or arrays [name, path, domain] representing cookies to be deleted if consent is withdrawn.isMandatory (boolean, default: false): If true, the user cannot disable this purpose.isExempt (boolean, default: false): If true, the purpose loads even before explicit consent.default (boolean, default: false): If true, the purpose is enabled by default.runsOnce (boolean, default: false): If true, the purpose executes only once regardless of toggling.purposes (array, optional): Allows grouping sub-purposes under a parent purpose.
window.orejimeConfig = {
privacyPolicyUrl: 'https://example.com/privacy',
purposes: [
{
id: 'google-tag-manager',
title: 'Google Tag Manager',
description: 'Used for analytics.',
cookies: ['_ga', '/^_gat_.+$/i'],
isMandatory: false
},
{
id: 'advertising',
title: 'Advertising',
purposes: [
{ id: 'foo', title: 'Foo', cookies: [] }
]
}
],
forceModal: false,
forceBanner: false,
logo: '/img/logo.png',
orejimeElement: '#orejime',
cookie: {
name: 'orejime',
duration: 365,
domain: 'mydomain.com',
sameSite: 'strict'
}
};