Table of content
- Installation
- Usage
- Versioning
- Contributing
- Hacking
- License
1. Installation
You can install the library with npm or with yarn:
npm install @rich-id/cookies-regulation
yarn add @rich-id/cookies-regulation
Add the library to your js
import CookiesRegulation from '@rich-id/cookies-regulation';
OR
window.CookiesRegulation = require('@rich-id/cookies-regulation');
2. Usage
Init
<script>
CookiesRegulation.init(
{
website: 'Cookies Regulation',
privacyPolicy: {
url: 'https://example.com/privacy',
label: 'Privacy Policy',
openInNewWindow: true,
},
modal: {
header: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras hendrerit, velit vitae accumsan pellentesque, sapien arcu gravida nibh, at accumsan nulla sapien sed magna. Integer sed sem dolor. Pellentesque feugiat, quam quis dapibus vehicula, risus morbi.',
relatedCompaniesCount: 5,
relatedCompaniesPrivacyPolicyUrl: ''
},
services: {
googleTagManager: {
name: 'Google Tag Manager',
description: 'Tag management system',
conservation: '6 months.',
service: 'googleTagManager',
options: {id: 'GTM-TEST'},
},
cookieTest1: {
name: 'Test Cookie',
description: 'Test description.',
conservation: '1 year.',
mandatory: false,
initializationCallback: function () {
}
},
cookieTest2: {
name: 'Other test cookie',
description: null,
conservation: '6 months.',
mandatory: true,
},
cookieTest3: {
name: 'Other test cookie 2',
description: null,
conservation: 'until you log out.',
mandatory: true,
}
},
locale: 'en', ,
decisionLogCallback: (decision) => {
}
}
);
</script>
Open Modal
window.CookiesRegulation.openModal();
3. Versioning
tour-bundle follows semantic versioning. In short the scheme is MAJOR.MINOR.PATCH where
- MAJOR is bumped when there is a breaking change,
- MINOR is bumped when a new feature is added in a backward-compatible way,
- PATCH is bumped when a bug is fixed in a backward-compatible way.
Versions bellow 1.0.0 are considered experimental and breaking changes may occur at any time.
4. Contributing
Contributions are welcomed! There are many ways to contribute, and we appreciate all of them. Here are some of the major ones:
- Bug Reports: While we strive for quality software, bugs can happen, and we can't fix issues we're not aware of. So please report even if you're not sure about it or just want to ask a question. If anything the issue might indicate that the documentation can still be improved!
- Feature Request: You have a use case not covered by the current api? Want to suggest a change or add something? We'd be glad to read about it and start a discussion to try to find the best possible solution.
- Pull Request: Want to contribute code or documentation? We'd love that! If you need help to get started, GitHub as documentation on pull requests. We use the "fork and pull model" were contributors push changes to their personal fork and then create pull requests to the main repository. Please make your pull requests against the
master
branch.
As a reminder, all contributors are expected to follow our Code of Conduct.
5. Hacking
You might use Docker and docker-compose
to hack the project. Check out the following commands.
docker-compose up -d
docker-compose exec application bash
yarn install && yarn build && yarn pack
cd path/to/project
yarn add file:path/to/package.tgz
6. License
tour-bundle is distributed under the terms of the MIT license.
See LICENSE for details.