cookie-consent
/
3.0.1
cookie-consent 3.0.1
Install from the command line:
Learn more about npm packages
$ npm install @envato/cookie-consent@3.0.1
Install via package.json:
"@envato/cookie-consent": "3.0.1"
About this version
The npm package for cookie consent helpers. These functions are tighly coupled to using the cookiebot api at the moment.
npm install @envato/cookie-consent --save
# or using `yarn`
yarn add @envato/cookie-consent
import { Consent, consented, deferRun } from '@envato/cookie-consent'
// Check for consent inline (note that on the initial page load this function may return false)
if (consented(Consent.statistics)) {
// Do something..
}
// Manually parse and check the consent type in the CookieConsent cookie
checkCookieConsent(Cookies.get('CookieConsent'), Consent.statistics)
// Run function after consent
deferRun(() => {
doSomething()
}, Consent.marketing)
// Types of consent we support:
Consent.marketing
Consent.statistics
Consent.preferences
Consent.necessary
There is a cookiebot.css
in the module, you can include it to partially override the default Cookiebot style.
Publishing is automated via GitHub Actions. Trigger with the following steps:
- Ensure the latest version is committed in the
package.json
. eg."version": "1.1.1"
- Ensure the latest version is tagged from
main
. eg.git tag v1.1.1 && git push origin v1.1.1
- Create a release via the Github Releases
- Verify the build in Github Actions
- Verify the package published to Github Packages
- Verify the package published to NPM
Details
- cookie-consent
- envato
- 6 months ago
- MIT
- 7 dependencies
Assets
- cookie-consent-3.0.1.tgz
Download activity
- Total downloads 17,782
- Last 30 days 0
- Last week 0
- Today 0