accept-cookie-popup
v2.0.0
Published
Cookie consent notification plugin
Maintainers
Readme
AcceptCookiePopup
Cookie consent notification plugin
Getting Started
Download the plugin and add it to your website. Alternatively, install via NPM:
npm i accept-cookie-popupBelow, initialize an instance of AcceptCookiePopup:
new AcceptCookiePopup();Configuration
The plugin comes with default settings, but it can also accept a configuration object for customization. Below is a table of available configuration keys:
Key | Description (Type, Default Value)
----------------------|--------------------------------------
siteName | Website name (string, data-site-name from document.body || ~Hostname~)
linkCookiePage | URL of the cookie policy page (string, '/cookie-policy/')
showDelay | Delay before showing the popup in milliseconds (number, 2000)
showAnimationDuration | Popup show animation duration in milliseconds (number, 800)
flagName | activity flag title (string, 'cookieChoice')
acceptFlagValue | accept flag value (string, 'accepted')
declineFlagValue | decline flag falue (string, 'declined')
popupName | BEM class name for the popup (string, 'cookie-accept-popup')
acceptBtnText | Accept button text (string, 'Принять')
declineBtnText | Decline button text (string, 'Отклонить')
onAcceptHandler | Accept handler callback. (function)
messageText | Custom message text. Default method returns string. (function)