An ember-cli addon for using CookieConsent in Ember.js applications.
Largly inspired by ember-cli-cookieconsent.
- Ember.js v3.16 or above
- Ember CLI v2.13 or above
- Node.js v10 or above
ember install ember-cookieconsent
Use the online CookieConsent editor to get some help generating your first configuration.
Then just add your CookieConsent configuration to config/environment.js.
let ENV = {
// ...
cookieconsent: {
auto: true, // Automatically show cookie consent; default is true
options: {
// CookieConsent configuration goes here
}
}
}
This addon sets up a "cookieconsent" service:
-
cookieconsent.isAccepted
contains the current consent state. Since 1.0.1 this property is @tracked. -
cookieconsent.show()
can be called to manually show the CookieConsent if auto is set to false.
As of 1.0.2 ember-cookieconsent works with FastBoot out of the box by not loading the cookieconsent library in FastBoot at all. This is done because the library uses document
and window
which is not available in Node.js.
See the Contributing guide for details.
This project is licensed under the MIT License.