{"_id":"@bato-web-agency/cookie-consent","_rev":"7-0f2a3bea50bc562e4af8c51e1d7a1d43","name":"@bato-web-agency/cookie-consent","dist-tags":{"latest":"1.2.3"},"versions":{"1.0.3":{"name":"@bato-web-agency/cookie-consent","version":"1.0.3","keywords":["cookie-consent","gdpr","eprivacy","consent-banner","privacy","vanilla-js"],"author":{"name":"Bato Web Agency","email":"hello@bato.dev"},"license":"MIT","_id":"@bato-web-agency/cookie-consent@1.0.3","maintainers":[{"name":"bato-web-agency","email":"bato.organisation@gmail.com"}],"dist":{"shasum":"60e7c66387a7fc8c2a7b0688bafb4f65466b9066","tarball":"https://registry.npmjs.org/@bato-web-agency/cookie-consent/-/cookie-consent-1.0.3.tgz","fileCount":21,"integrity":"sha512-DMgtQ7pkJH31IdCKll3AI5oAy/Ia0IvVfwgnSEh45wU6E36OwtFsYiI+Bsixn6mqWNO6GWFXlr0QXnNY/gmjtA==","signatures":[{"sig":"MEUCIDU4/rWcJ3ZXg7f17aq3aH35HjEtwLFETQF1ygQpKJ96AiEAuoEWU2cE/NgkNdN/pQZpzbFH30raYhmZG/+SkzCoUEQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":189284},"main":"./dist/index.umd.js","type":"module","style":"./dist/style.css","types":"./types/index.d.ts","module":"./dist/index.es.js","exports":{".":{"types":"./types/index.d.ts","import":"./dist/index.es.js","require":"./dist/index.umd.js"},"./style.css":"./dist/style.css","./style.scss":"./src/styles/index.scss"},"gitHead":"0ee996ca1fc1b77aa0bf4de67afd636b20c60be7","scripts":{"lint":"eslint \"src/**/*.js\" \"*.js\"","build":"vite build","check":"npm run lint && npm run lint:styles && npm run format:check && npm run build","format":"prettier --write \"**/*.{js,json,md,html,css,scss,ts}\"","lint:styles":"stylelint \"src/**/*.{css,scss}\"","format:check":"prettier --check \"**/*.{js,json,md,html,css,scss,ts}\""},"_npmUser":{"name":"bato-web-agency","email":"bato.organisation@gmail.com"},"_npmVersion":"11.6.1","description":"JavaScript cookie consent banner with customizable UI, i18n, script blocking, and runtime APIs.","directories":{},"_nodeVersion":"24.11.0","_hasShrinkwrap":false,"devDependencies":{"sass":"^1.94.2","vite":"^7.2.4","eslint":"^8.57.1","prettier":"^3.6.2","stylelint":"^16.26.0","postcss-scss":"^4.0.9","eslint-plugin-import":"^2.32.0","eslint-config-airbnb-base":"^15.0.0","stylelint-config-standard-scss":"^16.0.0"},"_npmOperationalInternal":{"tmp":"tmp/cookie-consent_1.0.3_1779293694092_0.8300731993246666","host":"s3://npm-registry-packages-npm-production"}},"1.0.4":{"name":"@bato-web-agency/cookie-consent","version":"1.0.4","keywords":["cookie-consent","gdpr","eprivacy","consent-banner","privacy","vanilla-js"],"author":{"name":"Bato Web Agency","email":"hello@bato.dev"},"license":"MIT","_id":"@bato-web-agency/cookie-consent@1.0.4","maintainers":[{"name":"bato-web-agency","email":"bato.organisation@gmail.com"}],"dist":{"shasum":"c59e832c8c5334ccc44ed890cb8a2af821c5f25b","tarball":"https://registry.npmjs.org/@bato-web-agency/cookie-consent/-/cookie-consent-1.0.4.tgz","fileCount":22,"integrity":"sha512-A5egkUzWiA4PF4P4q4AM6mJmigHkouimdXFA1HxMLpwSbqPX0RL8gwMmteFjuuKlgVsCucYVsExT+H6rLOmsTw==","signatures":[{"sig":"MEQCIG2TZEfxy9UaSoB1A7JjOFFtMXlkIna98qbxwMFMvOp9AiAUdvVCaLiOgZzYi+kWlTaOOH6G5DtKZF0WS9hlOsOfNQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":241219},"main":"./dist/index.umd.js","type":"module","style":"./style.css","types":"./types/index.d.ts","module":"./dist/index.es.js","exports":{".":{"types":"./types/index.d.ts","import":"./dist/index.es.js","require":"./dist/index.umd.js"},"./style.css":"./style.css","./style.scss":"./src/styles/index.scss"},"gitHead":"675b7f042d3ec5f420320c7b32835933bd2d986b","scripts":{"lint":"eslint \"src/**/*.js\" \"*.js\"","build":"vite build","check":"npm run lint && npm run lint:styles && npm run format:check && npm run build","format":"prettier --write \"**/*.{js,json,md,html,css,scss,ts}\"","lint:styles":"stylelint \"src/**/*.{css,scss}\"","format:check":"prettier --check \"**/*.{js,json,md,html,css,scss,ts}\""},"_npmUser":{"name":"bato-web-agency","email":"bato.organisation@gmail.com"},"_npmVersion":"11.6.1","description":"JavaScript cookie consent banner with customizable UI, i18n, script blocking, and runtime APIs.","directories":{},"_nodeVersion":"24.11.0","_hasShrinkwrap":false,"devDependencies":{"sass":"^1.94.2","vite":"^7.2.4","eslint":"^8.57.1","prettier":"^3.6.2","stylelint":"^16.26.0","postcss-scss":"^4.0.9","eslint-plugin-import":"^2.32.0","eslint-config-airbnb-base":"^15.0.0","stylelint-config-standard-scss":"^16.0.0"},"_npmOperationalInternal":{"tmp":"tmp/cookie-consent_1.0.4_1779373113946_0.6901599425897493","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@bato-web-agency/cookie-consent","version":"1.1.0","keywords":["cookie-consent","gdpr","eprivacy","consent-banner","privacy","vanilla-js"],"author":{"name":"Bato Web Agency","email":"hello@bato.dev"},"license":"MIT","_id":"@bato-web-agency/cookie-consent@1.1.0","maintainers":[{"name":"bato-web-agency","email":"bato.organisation@gmail.com"}],"dist":{"shasum":"9b92889f20bb559cb6484bb2a81a114edab1b53a","tarball":"https://registry.npmjs.org/@bato-web-agency/cookie-consent/-/cookie-consent-1.1.0.tgz","fileCount":22,"integrity":"sha512-GofLHwcqkZqi9rMVXR/otzSq3+KZskX+u3XKQu21JN2c6iTSGK71n3/DqnR00PVTetJz7QnfWZLNN1jnyNA/Sw==","signatures":[{"sig":"MEUCIAIxiupvw3SLtMeC4vu/UXl0/2ZqPBgxcmcVslUafQrSAiEA1vaA0V0rYUvYiH31YTEeXm49tiISv4e/l/RSr30pt70=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":242759},"main":"./dist/index.umd.js","type":"module","style":"./style.css","types":"./types/index.d.ts","module":"./dist/index.es.js","exports":{".":{"types":"./types/index.d.ts","import":"./dist/index.es.js","require":"./dist/index.umd.js"},"./style.css":"./style.css","./style.scss":"./src/styles/index.scss"},"gitHead":"49d0c9d85e81f55d7adf1ba37731fc5b5fcd9205","scripts":{"lint":"eslint \"src/**/*.js\" \"*.js\"","build":"vite build","check":"npm run lint && npm run lint:styles && npm run format:check && npm run build","format":"prettier --write \"**/*.{js,json,md,html,css,scss,ts}\"","lint:styles":"stylelint \"src/**/*.{css,scss}\"","format:check":"prettier --check \"**/*.{js,json,md,html,css,scss,ts}\""},"_npmUser":{"name":"bato-web-agency","email":"bato.organisation@gmail.com"},"_npmVersion":"11.6.1","description":"JavaScript cookie consent banner with customizable UI, i18n, configurable script loading, and runtime APIs.","directories":{},"_nodeVersion":"24.11.0","_hasShrinkwrap":false,"devDependencies":{"sass":"^1.94.2","vite":"^7.2.4","eslint":"^8.57.1","prettier":"^3.6.2","stylelint":"^16.26.0","postcss-scss":"^4.0.9","eslint-plugin-import":"^2.32.0","eslint-config-airbnb-base":"^15.0.0","stylelint-config-standard-scss":"^16.0.0"},"_npmOperationalInternal":{"tmp":"tmp/cookie-consent_1.1.0_1779373513795_0.49391516549903347","host":"s3://npm-registry-packages-npm-production"}},"1.2.0":{"name":"@bato-web-agency/cookie-consent","version":"1.2.0","keywords":["cookie-consent","gdpr","eprivacy","consent-banner","privacy","vanilla-js"],"author":{"name":"Bato Web Agency","email":"hello@bato.dev"},"license":"MIT","_id":"@bato-web-agency/cookie-consent@1.2.0","maintainers":[{"name":"bato-web-agency","email":"bato.organisation@gmail.com"}],"dist":{"shasum":"a9f7de84d7426d8b55a2e64a74a24ada8c4cb2e2","tarball":"https://registry.npmjs.org/@bato-web-agency/cookie-consent/-/cookie-consent-1.2.0.tgz","fileCount":23,"integrity":"sha512-Ax/gomjPbIThicmClRY8zfy3AVlXS6Z0Q9VPWKD1SOQl+8mqqhC79E41oiJ4dyv59z3RfTDjNKs5Xa8p0SLPPA==","signatures":[{"sig":"MEQCICUL6tpQfGo4whrOPELZO+DCgMqT/kpcpsXhPTHmBbxLAiBTe8FSKr3Z3+pRwJ005ZLd3NTJ7DfSs2d0mrtbguN1nQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":283915},"main":"./dist/index.umd.js","type":"module","style":"./style.css","types":"./types/index.d.ts","module":"./dist/index.es.js","exports":{".":{"types":"./types/index.d.ts","import":"./dist/index.es.js","require":"./dist/index.umd.js"},"./style.css":"./style.css","./style.scss":"./src/styles/index.scss"},"gitHead":"495093de755532625365b036d78f478538bf0d7e","scripts":{"lint":"eslint \"src/**/*.js\" \"*.js\"","build":"vite build","check":"npm run lint && npm run lint:styles && npm run format:check && npm run build","format":"prettier --write \"**/*.{js,json,md,html,css,scss,ts}\"","lint:styles":"stylelint \"src/**/*.{css,scss}\"","format:check":"prettier --check \"**/*.{js,json,md,html,css,scss,ts}\""},"_npmUser":{"name":"bato-web-agency","email":"bato.organisation@gmail.com"},"_npmVersion":"11.6.1","description":"JavaScript cookie consent banner with customizable UI, i18n, configurable script loading, and runtime APIs.","directories":{},"_nodeVersion":"24.11.0","_hasShrinkwrap":false,"devDependencies":{"sass":"^1.94.2","vite":"^7.2.4","eslint":"^8.57.1","prettier":"^3.6.2","stylelint":"^16.26.0","postcss-scss":"^4.0.9","eslint-plugin-import":"^2.32.0","eslint-config-airbnb-base":"^15.0.0","stylelint-config-standard-scss":"^16.0.0"},"_npmOperationalInternal":{"tmp":"tmp/cookie-consent_1.2.0_1779377045624_0.30622751097788936","host":"s3://npm-registry-packages-npm-production"}},"1.2.1":{"name":"@bato-web-agency/cookie-consent","version":"1.2.1","keywords":["cookie-consent","gdpr","eprivacy","consent-banner","privacy","vanilla-js"],"author":{"name":"Bato Web Agency","email":"hello@bato.dev"},"license":"MIT","_id":"@bato-web-agency/cookie-consent@1.2.1","maintainers":[{"name":"bato-web-agency","email":"bato.organisation@gmail.com"}],"dist":{"shasum":"98c34a394b6d680cbbe3ee6c39a52c3dd4448efa","tarball":"https://registry.npmjs.org/@bato-web-agency/cookie-consent/-/cookie-consent-1.2.1.tgz","fileCount":23,"integrity":"sha512-+CRs01YN3jdUZQ9QCD2zrLnd9A3coJRdv9jruTfqBMJ5KtFce/ccs7OQoGoKgRT/+QrijQuXl0h7zm7UwG8Rzw==","signatures":[{"sig":"MEYCIQDmtrXPTU0zQqd4E75yX1YESkf9it4f2QfHoJdWvQZhuQIhAKqFA/yetCKS8m70Oxe5lVyDAGQRJZVzVQ8n8EPiBQG1","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":284619},"main":"./dist/index.umd.js","type":"module","style":"./style.css","types":"./types/index.d.ts","module":"./dist/index.es.js","exports":{".":{"types":"./types/index.d.ts","import":"./dist/index.es.js","require":"./dist/index.umd.js"},"./style.css":"./style.css","./style.scss":"./src/styles/index.scss"},"gitHead":"6dab4366374ada01557982479857d20245f76310","scripts":{"lint":"eslint \"src/**/*.js\" \"*.js\"","build":"vite build","check":"npm run lint && npm run lint:styles && npm run format:check && npm run build","format":"prettier --write \"**/*.{js,json,md,html,css,scss,ts}\"","lint:styles":"stylelint \"src/**/*.{css,scss}\"","format:check":"prettier --check \"**/*.{js,json,md,html,css,scss,ts}\""},"_npmUser":{"name":"bato-web-agency","email":"bato.organisation@gmail.com"},"_npmVersion":"11.6.1","description":"JavaScript cookie consent banner with customizable UI, i18n, configurable script loading, and runtime APIs.","directories":{},"_nodeVersion":"24.11.0","_hasShrinkwrap":false,"devDependencies":{"sass":"^1.94.2","vite":"^7.2.4","eslint":"^8.57.1","prettier":"^3.6.2","stylelint":"^16.26.0","postcss-scss":"^4.0.9","eslint-plugin-import":"^2.32.0","eslint-config-airbnb-base":"^15.0.0","stylelint-config-standard-scss":"^16.0.0"},"_npmOperationalInternal":{"tmp":"tmp/cookie-consent_1.2.1_1779378094156_0.2706588914381769","host":"s3://npm-registry-packages-npm-production"}},"1.2.2":{"name":"@bato-web-agency/cookie-consent","version":"1.2.2","keywords":["cookie-consent","gdpr","eprivacy","consent-banner","privacy","vanilla-js"],"author":{"name":"Bato Web Agency","email":"hello@bato.dev"},"license":"MIT","_id":"@bato-web-agency/cookie-consent@1.2.2","maintainers":[{"name":"bato-web-agency","email":"bato.organisation@gmail.com"}],"dist":{"shasum":"73e06c932f9059cfe51b1093b552a7441c75b383","tarball":"https://registry.npmjs.org/@bato-web-agency/cookie-consent/-/cookie-consent-1.2.2.tgz","fileCount":23,"integrity":"sha512-He2Yq2LhhAzxL9Y10YKwNE3+tXpODgiUGTb6A9Njr6poBvqHtjA0Wo42jTz0C+R2G4eWSqdlRgiAUANuhJKBvg==","signatures":[{"sig":"MEUCIDTa0Q74IpEM82a+oufj1GCcudqyiNrJgRfWe7/HisBbAiEA73Yrv4d1VXV/QBVdcNpejf210571WZxD/5vZQgju/yk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":284875},"main":"./dist/index.umd.js","type":"module","style":"./style.css","types":"./types/index.d.ts","module":"./dist/index.es.js","exports":{".":{"types":"./types/index.d.ts","import":"./dist/index.es.js","require":"./dist/index.umd.js"},"./style.css":"./style.css","./style.scss":"./src/styles/index.scss"},"gitHead":"822de07722dcf5bed1beca4c9a9c8576f9afb58b","scripts":{"lint":"eslint \"src/**/*.js\" \"*.js\"","build":"vite build","check":"npm run lint && npm run lint:styles && npm run format:check && npm run build","format":"prettier --write \"**/*.{js,json,md,html,css,scss,ts}\"","lint:styles":"stylelint \"src/**/*.{css,scss}\"","format:check":"prettier --check \"**/*.{js,json,md,html,css,scss,ts}\""},"_npmUser":{"name":"bato-web-agency","email":"bato.organisation@gmail.com"},"_npmVersion":"11.6.1","description":"JavaScript cookie consent banner with customizable UI, i18n, configurable script loading, and runtime APIs.","directories":{},"_nodeVersion":"24.11.0","_hasShrinkwrap":false,"devDependencies":{"sass":"^1.94.2","vite":"^7.2.4","eslint":"^8.57.1","prettier":"^3.6.2","stylelint":"^16.26.0","postcss-scss":"^4.0.9","eslint-plugin-import":"^2.32.0","eslint-config-airbnb-base":"^15.0.0","stylelint-config-standard-scss":"^16.0.0"},"_npmOperationalInternal":{"tmp":"tmp/cookie-consent_1.2.2_1779711552678_0.22594126768179268","host":"s3://npm-registry-packages-npm-production"}},"1.2.3":{"name":"@bato-web-agency/cookie-consent","version":"1.2.3","description":"JavaScript cookie consent banner with customizable UI, i18n, configurable script loading, and runtime APIs.","type":"module","main":"./dist/index.umd.js","module":"./dist/index.es.js","types":"./types/index.d.ts","style":"./style.css","exports":{".":{"types":"./types/index.d.ts","import":"./dist/index.es.js","require":"./dist/index.umd.js"},"./style.css":"./style.css","./style.scss":"./src/styles/index.scss"},"scripts":{"build":"vite build","lint":"eslint \"src/**/*.js\" \"*.js\"","lint:styles":"stylelint \"src/**/*.{css,scss}\"","format":"prettier --write \"**/*.{js,json,md,html,css,scss,ts}\"","format:check":"prettier --check \"**/*.{js,json,md,html,css,scss,ts}\"","check":"npm run lint && npm run lint:styles && npm run format:check && npm run build"},"keywords":["cookie-consent","gdpr","eprivacy","consent-banner","privacy","vanilla-js"],"author":{"name":"Bato Web Agency","email":"hello@bato.dev"},"license":"MIT","devDependencies":{"eslint":"^8.57.1","eslint-config-airbnb-base":"^15.0.0","eslint-plugin-import":"^2.32.0","postcss-scss":"^4.0.9","prettier":"^3.6.2","sass":"^1.94.2","stylelint":"^16.26.0","stylelint-config-standard-scss":"^16.0.0","vite":"^7.2.4"},"gitHead":"7084b546adfcab403d909019daa31d48aacc48fd","_id":"@bato-web-agency/cookie-consent@1.2.3","_nodeVersion":"24.11.0","_npmVersion":"11.6.1","dist":{"integrity":"sha512-Rmk6D0iLRvacmADgvnwKCWCyFV3nILetlXiXVD43YkV08NkpTEgH+l4yf1gZTjfEwSNNpovPi7Un1adSsiX5GQ==","shasum":"4efbd8af35214bc27e313ca66f4aadf1e46a992a","tarball":"https://registry.npmjs.org/@bato-web-agency/cookie-consent/-/cookie-consent-1.2.3.tgz","fileCount":23,"unpackedSize":285249,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIGXVXG6unM0oq0t1XqTu2QUL1jAjwoLxLGP7hWyh6baoAiEAx85uxROjRgkzIWOhD3/z73G79i3r33t2NyeAFUJ/OwE="}]},"_npmUser":{"name":"bato-web-agency","email":"bato.organisation@gmail.com"},"directories":{},"maintainers":[{"name":"bato-web-agency","email":"bato.organisation@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/cookie-consent_1.2.3_1779715612450_0.4124792177553842"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-20T16:14:53.934Z","modified":"2026-05-25T13:26:52.719Z","1.0.3":"2026-05-20T16:14:54.236Z","1.0.4":"2026-05-21T14:18:34.106Z","1.1.0":"2026-05-21T14:25:14.019Z","1.2.0":"2026-05-21T15:24:05.799Z","1.2.1":"2026-05-21T15:41:34.383Z","1.2.2":"2026-05-25T12:19:12.877Z","1.2.3":"2026-05-25T13:26:52.626Z"},"author":{"name":"Bato Web Agency","email":"hello@bato.dev"},"license":"MIT","keywords":["cookie-consent","gdpr","eprivacy","consent-banner","privacy","vanilla-js"],"description":"JavaScript cookie consent banner with customizable UI, i18n, configurable script loading, and runtime APIs.","maintainers":[{"name":"bato-web-agency","email":"bato.organisation@gmail.com"}],"readme":"# Cookie Consent\n\nJavaScript cookie consent banner with customizable UI, local storage, i18n, configurable script loading, and runtime APIs.\n\n## Install\n\n```bash\nnpm install @bato-web-agency/cookie-consent\n```\n\n## Quick Start\n\n```js\nimport CookieConsent from '@bato-web-agency/cookie-consent';\nimport '@bato-web-agency/cookie-consent/style.css';\n\nawait CookieConsent.init({\n  mode: 'gdpr',\n  policyVersion: '2026-05-19',\n  language: 'browser',\n  fallbackLanguage: 'en',\n  layout: 'floating',\n  policyLinks: [{ label: 'Cookie policy', href: '/cookie-policy' }],\n  scripts: [\n    {\n      id: 'analytics',\n      category: 'analytics',\n      callback: () => {\n        window.analyticsLoaded = true;\n      }\n    }\n  ]\n});\n```\n\n## Browser Script\n\nWhen you serve the built package files yourself, use the UMD build and compiled CSS:\n\n```html\n<link rel=\"stylesheet\" href=\"/dist/style.css\" />\n<script src=\"/dist/index.umd.js\"></script>\n<script>\n  window.CookieConsent.init({\n    defaultLanguage: 'uk',\n    policyVersion: '1'\n  });\n</script>\n```\n\nFor CDN usage with jsDelivr:\n\n```html\n<link\n  rel=\"stylesheet\"\n  href=\"https://cdn.jsdelivr.net/npm/@bato-web-agency/cookie-consent@1.2.0/style.css\"\n/>\n<script src=\"https://cdn.jsdelivr.net/npm/@bato-web-agency/cookie-consent@1.2.0\"></script>\n<script>\n  window.CookieConsent.init({\n    defaultLanguage: 'uk',\n    policyVersion: '1'\n  });\n</script>\n```\n\nFor CDN usage with unpkg:\n\n```html\n<link\n  rel=\"stylesheet\"\n  href=\"https://unpkg.com/@bato-web-agency/cookie-consent@1.2.0/dist/style.css\"\n/>\n<script src=\"https://unpkg.com/@bato-web-agency/cookie-consent@1.2.0/dist/index.umd.js\"></script>\n<script>\n  window.CookieConsent.init({\n    defaultLanguage: 'uk',\n    policyVersion: '1'\n  });\n</script>\n```\n\nThe `/dist/...` paths above are local/static hosting paths, not CDN URLs. Examples and plain HTML templates inside this repository should use the built files:\n\n```html\n<link rel=\"stylesheet\" href=\"./dist/style.css\" />\n<script type=\"module\">\n  import CookieConsent from './dist/index.es.js';\n</script>\n```\n\nFor source-level development, edit `src/styles/index.scss` and run `npm run build`.\n\n## Runtime API\n\n- `CookieConsent.init(config)`\n- `CookieConsent.getConsent()`\n- `CookieConsent.hasConsent(category)`\n- `CookieConsent.setConsent({ categories })`\n- `CookieConsent.acceptCategory(category)`\n- `CookieConsent.resetConsent()`\n- `CookieConsent.openBanner()`\n- `CookieConsent.openPreferences()`\n- `CookieConsent.close()`\n- `CookieConsent.on(event, handler)`\n- `CookieConsent.off(event, handler)`\n- `CookieConsent.registerScript(script)`\n- `CookieConsent.loadCategory(category)`\n- `CookieConsent.registerEmbed(embed)`\n- `CookieConsent.loadEmbed(id)`\n- `CookieConsent.loadEmbedsByCategory(category)`\n\nUse `getConsent()` and `hasConsent(category)` from arbitrary site JavaScript to branch behaviour after the user choice:\n\n```js\nif (CookieConsent.hasConsent('analytics')) {\n  window.siteAnalyticsFeatureEnabled = true;\n}\n```\n\n## Consent Mode\n\n`mode` controls when tagged scripts are loaded:\n\n- `gdpr` is the default. Registered scripts and blocked script selectors are loaded only after the user accepts the required category.\n- `eprivacy` loads registered scripts and blocked script selectors automatically after initialization or registration.\n\n```js\nCookieConsent.init({\n  mode: 'eprivacy',\n  scripts: [\n    {\n      id: 'analytics',\n      category: 'analytics',\n      selector: 'script[type=\"text/plain\"][data-cookie-category=\"analytics\"]'\n    }\n  ]\n});\n```\n\nIn `eprivacy` mode, automatic script loading does not mark optional categories as accepted. Use `getConsent()` and `hasConsent(category)` for the user's saved preference state.\n\n## YouTube And Vimeo Embeds\n\nEmbedded videos are managed separately from JavaScript scripts because YouTube and Vimeo cookies can be created when an iframe loads. Use `data-cc-src`, not `src`, for compliance-safe markup in `gdpr` mode:\n\n```html\n<div\n  data-cc-embed=\"youtube\"\n  data-cc-id=\"homepage-video\"\n  data-cc-src=\"https://www.youtube.com/watch?v=VIDEO_ID\"\n  data-cc-title=\"Product video\"\n></div>\n```\n\n```js\nCookieConsent.init({\n  mode: 'gdpr',\n  embeds: {\n    enabled: true,\n    category: 'marketing',\n    autoScan: true,\n    providers: {\n      youtube: {\n        enabled: true,\n        privacyMode: true\n      },\n      vimeo: {\n        enabled: true,\n        dnt: true\n      }\n    }\n  }\n});\n```\n\nIn `gdpr`, the library renders a local placeholder until the user allows the configured category. In `eprivacy`, embeds load automatically with privacy-friendly URL normalization. YouTube URLs are converted to `youtube-nocookie.com` when `privacyMode` is enabled, and Vimeo URLs receive `dnt=1` when `dnt` is enabled.\n\nRegular `<iframe src=\"...\">` markup can load before the consent library runs, so use `data-cc-src` or config-based embeds instead.\n\n## Customization\n\nUse CSS variables for fast styling:\n\n```css\n:root {\n  --cc-font-size: 1rem;\n  --cc-color-primary: #0f6cbd;\n  --cc-color-primary-hover: #115ea3;\n  --cc-color-primary-active: #0f548c;\n  --cc-color-secondary: #f5f5f5;\n  --cc-color-focus: #000;\n  --cc-duration: 160ms;\n  --cc-easing: cubic-bezier(0.33, 0, 0.67, 1);\n  --cc-font-family: 'Segoe UI', 'Segoe UI Variable', system-ui, sans-serif;\n  --cc-radius: 4px;\n  --cc-shadow: 0 0.5em 1em rgb(0 0 0 / 14%), 0 0 0.125em rgb(0 0 0 / 12%);\n}\n```\n\nAnimations are controlled by `--cc-duration` and respect `prefers-reduced-motion`.\n\nHide UI parts through `components`. The logo is included in this list:\n\n```js\nCookieConsent.init({\n  components: {\n    logo: false\n  }\n});\n```\n\nSupported starter languages: `en`, `en-gb`, `en-uk`, `de`, `fr`, `es`, `ca-es`, `it`, `sv`, `no`, `nl`, `pt`, `fi`, `hu`, `cs`, `hr`, `da`, `sk`, `sl`, `pl`, `el`, `he`, `mk`, `uk`, `ro`, `sr`, `et`, `lt`, `lv`, `ru`, `bg`, `cy`, `ja`, `ar`, and `tr`.\nBuilt-in language copy is stored as one JSON file per locale in `src/i18n/locales`.\nEvery label can be overridden with `translations`.\n\nLanguage resolution is controlled by `language`:\n\n- `browser` uses `navigator.language` and is the default.\n- `auto` uses the site language from the root `<html lang=\"...\">` attribute.\n- any language code, for example `he` or `en-uk`, forces that language.\n\nCategory content supports a short `description` and expandable `details` text. Override `details` through `content` or `translations`; category config is for category metadata such as `title`, `description`, `required`, and `defaultValue`.\n\n```js\nCookieConsent.init({\n  content: {\n    en: {\n      embeds: {\n        placeholder: {\n          title: 'Video content',\n          description: 'Allow marketing cookies to play this video.',\n          buttonText: 'Allow and play'\n        }\n      },\n      categories: {\n        analytics: {\n          description: 'Short analytics summary.',\n          details: 'Long analytics explanation shown after clicking Read More.'\n        }\n      }\n    }\n  }\n});\n```\n\nEditable popup text supports safe inline formatting such as links and emphasis:\n\n```js\nCookieConsent.init({\n  providedBy: 'Provided by <a href=\"https://bato.dev\">Bato Web Agency</a>',\n  content: {\n    en: {\n      banner: {\n        description: 'We use <strong>cookies</strong> to improve the site.'\n      }\n    }\n  }\n});\n```\n\nFormatted text allows these tags: `a`, `abbr`, `b`, `br`, `code`, `em`, `i`, `mark`, `small`, `span`, `strong`, `sub`, `sup`, and `u`. Supported attributes are `href`, `target`, `rel`, and `title` on links; `title` on `abbr`; and `class` or `title` on `span`.\n\nThe packaged stylesheet is available as compiled CSS and a source SCSS entrypoint:\n\n```js\nimport '@bato-web-agency/cookie-consent/style.css';\nimport '@bato-web-agency/cookie-consent/style.scss';\n```\n\nThe SCSS source is split into internal partial files for maintenance, but `@bato-web-agency/cookie-consent/style.scss` is the public SCSS import path.\n\nSee [docs/API.md](docs/API.md) and [docs/CONFIGURATION.md](docs/CONFIGURATION.md) for the full configuration reference.\n","readmeFilename":"README.md"}