├── .editorconfig ├── .eslintignore ├── .github ├── CONTRIBUTING.md ├── ISSUE_TEMPLATE.md ├── PULL_REQUEST_TEMPLATE.md └── lock.yml ├── .gitignore ├── .ncurc.js ├── .npmignore ├── .npmrc ├── .travis.yml ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── LICENSE.md ├── README.md ├── babel.config.js ├── babel.ext.json ├── declination.json ├── docs ├── commands.md ├── contribute.md ├── installation.md ├── introduction.md ├── js │ └── jsdoc.md ├── prerequisite.md └── release.md ├── internals └── testing │ └── test-bundler.js ├── package.json ├── rollup.config.js ├── sonar-project.properties ├── src ├── CookieBot.js ├── CookieBot.md ├── CookieBot.native.js ├── index.js └── tests │ └── index.test.js ├── styleguide.config.js └── styleguide ├── jsdoc.sh ├── prepare.sh └── styleguide.ext.json /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_size = 2 6 | end_of_line = lf 7 | indent_style = space 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | lib/ 2 | dist/ 3 | -------------------------------------------------------------------------------- /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to `react-cookiebot` 2 | 3 | Love react-cookiebot and want to help? Thanks so much, there's something to do for everybody! 4 | 5 | Please take a moment to review this document in order to make the contribution process easy and effective for everyone involved. 6 | 7 | Following these guidelines helps to communicate that you respect the time of the developers managing and developing this open source project. In return, they should reciprocate that respect in addressing your issue or assessing patches and features. 8 | 9 | ## Using the issue tracker 10 | 11 | The [issue tracker](https://github.com/yeutech-lab/react-cookiebot/issues) is 12 | the preferred channel for [bug reports](#bugs), [features requests](#features) 13 | and [submitting pull requests](#pull-requests). 14 | 15 | 16 | ## Bug reports 17 | 18 | A bug is a _demonstrable problem_ that is caused by the code in the repository. 19 | Good bug reports are extremely helpful - thank you! 20 | 21 | Guidelines for bug reports: 22 | 23 | 1. **Use the GitHub issue search** — check if the issue has already been reported. 24 | 25 | 2. **Check if the issue has been fixed** — try to reproduce it using the latest `master` or development branch in the repository. 26 | 27 | 3. **Isolate the problem** — ideally create a reduced test case and a live example. 28 | 29 | A good bug report shouldn't leave others needing to chase you up for more information. Please try to be as detailed as possible in your report. What is your environment? What steps will reproduce the issue? What browser(s) and OS 30 | experience the problem? What would you expect to be the outcome? All these details will help people to fix any potential bugs. 31 | 32 | Example: 33 | 34 | > Short and descriptive example bug report title 35 | > 36 | > A summary of the issue and the browser/OS environment in which it occurs. If 37 | > suitable, include the steps required to reproduce the bug. 38 | > 39 | > 1. This is the first step 40 | > 2. This is the second step 41 | > 3. Further steps, etc. 42 | > 43 | > `` - a link to the reduced test case 44 | > 45 | > Any other information you want to share that is relevant to the issue being 46 | > reported. This might include the lines of code that you have identified as 47 | > causing the bug, and potential solutions (and your opinions on their 48 | > merits). 49 | 50 | 51 | 52 | ## Feature requests 53 | 54 | Feature requests are welcome. But take a moment to find out whether your idea fits with the scope and aims of the project. It's up to *you* to make a strong case to convince the project's developers of the merits of this feature. Please provide as much detail and context as possible. 55 | 56 | 57 | 58 | ## Pull requests 59 | 60 | Good pull requests - patches, improvements, new features - are a fantastic 61 | help. They should remain focused in scope and avoid containing unrelated 62 | commits. 63 | 64 | **Please ask first** before embarking on any significant pull request (e.g. 65 | implementing features, refactoring code, porting to a different language), 66 | otherwise you risk spending a lot of time working on something that the 67 | project's developers might not want to merge into the project. 68 | 69 | Please adhere to the coding conventions used throughout a project (indentation, 70 | accurate comments, etc.) and any other requirements (such as test coverage). 71 | 72 | Since the `master` branch is what people actually use in production, we have a 73 | `dev` branch that unstable changes get merged into first. Only when we 74 | consider that stable we merge it into the `master` branch and release the 75 | changes for real. 76 | 77 | Adhering to the following process is the best way to get your work 78 | included in the project: 79 | 80 | 1. [Fork](https://help.github.com/articles/fork-a-repo/) the project, clone your fork, and configure the remotes: 81 | 82 | ```bash 83 | # Clone your fork of the repo into the current directory 84 | git clone https://github.com//react-cookiebot.git 85 | # Navigate to the newly cloned directory 86 | cd react-cookiebot 87 | # Assign the original repo to a remote called "upstream" 88 | git remote add upstream https://github.com/kopax/react-cookiebot.git 89 | ``` 90 | 91 | 2. If you cloned a while ago, get the latest changes from upstream: 92 | 93 | ```bash 94 | git checkout dev 95 | git pull upstream dev 96 | ``` 97 | 98 | 3. Create a new topic branch (off the `dev` branch) to contain your feature, change, or fix: 99 | 100 | ```bash 101 | git checkout -b 102 | ``` 103 | 104 | 4. Commit your changes in logical chunks. Please adhere to these [git commit message guidelines](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#-git-commit-guidelines) or your code is unlikely be merged into the main project. Use Git's [interactive rebase](https://help.github.com/articles/about-git-rebase/) feature to tidy up your commits before making them public. 105 | 106 | 5. Locally merge (or rebase) the upstream dev branch into your topic branch: 107 | 108 | ```bash 109 | git pull [--rebase] upstream dev 110 | ``` 111 | 112 | 6. Push your topic branch up to your fork: 113 | 114 | ```bash 115 | git push origin 116 | ``` 117 | 118 | 7. [Open a Pull Request](https://help.github.com/articles/using-pull-requests/) 119 | with a clear title and description. 120 | 121 | **IMPORTANT**: By submitting a patch, you agree to allow the project 122 | owners to license your work under the terms of the [MIT License](https://github.com/yeutech-lab/react-cookiebot/blob/master/LICENSE.md). 123 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | # react-cookiebot 2 | 3 | Before opening a new issue, please take a moment to review our [**community guidelines**](https://github.com/yeutech-lab/react-cookiebot/blob/master/.github/CONTRIBUTING.md) to make the contribution process easy and effective for everyone involved. 4 | 5 | **Before opening a new issue, you may find an answer in already closed issues**: 6 | https://github.com/yeutech-lab/react-cookiebot/issues?q=is%3Aissue+is%3Aclosed 7 | 8 | ## Issue Type 9 | 10 | - [ ] [Bug](https://github.com/yeutech-lab/react-cookiebot/blob/master/.github/CONTRIBUTING.md#bug-reports) 11 | - [ ] [Feature](https://github.com/yeutech-lab/react-cookiebot/blob/master/.github/CONTRIBUTING.md#feature-requests) 12 | 13 | ## Description 14 | 15 | (Add images if possible) 16 | 17 | ## Steps to reproduce 18 | 19 | (Add link to a demo on https://jsfiddle.net or similar if possible) 20 | 21 | # Versions 22 | 23 | - Node/NPM: 24 | - OS: 25 | - react-cookiebot: 26 | 27 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## react-cookiebot 2 | 3 | Thank you for contributing! Please take a moment to review our [**contributing guidelines**](https://github.com/yeutech-lab/react-cookiebot/blob/master/.github/CONTRIBUTING.md) 4 | to make the process easy and effective for everyone involved. 5 | 6 | **Please open an issue** before embarking on any significant pull request, especially those that 7 | add a new library or change existing tests, otherwise you risk spending a lot of time working 8 | on something that might not end up being merged into the project. 9 | 10 | Before opening a pull request, please ensure: 11 | 12 | - [ ] You have followed our [**contributing guidelines**](https://github.com/yeutech-lab/react-cookiebot/blob/master/.github/CONTRIBUTING.md) 13 | - [ ] Double-check your branch is based on `dev` and targets `dev` 14 | - [ ] Your are doing semantic commit message using [commitizen](https://github.com/commitizen/cz-cli) and our [commit message convention](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#-git-commit-guidelines) 15 | - [ ] Pull request has tests (we are going for 100% coverage!) 16 | - [ ] Code is well-commented, linted and follows project conventions 17 | - [ ] Documentation is updated (if necessary) 18 | - [ ] Description explains the issue/use-case resolved and auto-closes related issues 19 | 20 | Be kind to code reviewers, please try to keep pull requests as small and focused as possible :) 21 | 22 | **IMPORTANT**: By submitting a patch, you agree to allow the project 23 | owners to license your work under the terms of the [MIT License](https://github.com/yeutech-lab/react-cookiebot/blob/master/LICENSE.md). 24 | -------------------------------------------------------------------------------- /.github/lock.yml: -------------------------------------------------------------------------------- 1 | # Configuration for lock-threads - https://github.com/dessant/lock-threads 2 | 3 | # Number of days of inactivity before a closed issue or pull request is locked 4 | daysUntilLock: 365 5 | 6 | # Skip issues and pull requests created before a given timestamp. Timestamp must 7 | # follow ISO 8601 (`YYYY-MM-DD`). Set to `false` to disable 8 | skipCreatedBefore: false 9 | 10 | # Issues and pull requests with these labels will not be locked. Set to `[]` to disable 11 | exemptLabels: [] 12 | 13 | # Label to add before locking, such as `outdated`. Set to `false` to disable 14 | lockLabel: false 15 | 16 | # Comment to post before locking. Set to `false` to disable 17 | lockComment: > 18 | This thread has been automatically locked since there has not been 19 | any recent activity after it was closed. Please open a new issue for 20 | related bugs. 21 | 22 | # Assign `resolved` as the reason for locking. Set to `false` to disable 23 | setLockReason: true 24 | 25 | # Limit to only `issues` or `pulls` 26 | # only: issues 27 | 28 | # Optionally, specify configuration settings just for `issues` or `pulls` 29 | # issues: 30 | # exemptLabels: 31 | # - help-wanted 32 | # lockLabel: outdated 33 | 34 | # pulls: 35 | # daysUntilLock: 30 36 | 37 | # Repository to extend settings from 38 | # _extends: repo 39 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | npm-debug.log 3 | tmp.json 4 | .DS_Store 5 | bundle-stats.html 6 | .idea/ 7 | coverage/ 8 | /reports 9 | /test-report.xml 10 | jest_0 11 | lib 12 | dist 13 | /public 14 | /docs/cli 15 | /docs/declinations 16 | /docs/translation.md 17 | .git-credentials 18 | package-lock.json 19 | /*.tgz 20 | .iml 21 | debug.json 22 | -------------------------------------------------------------------------------- /.ncurc.js: -------------------------------------------------------------------------------- 1 | const { createConfig } = require('@rollup-umd/ncu'); 2 | module.exports = createConfig(); 3 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | npm-debug.log 3 | tmp.json 4 | .DS_Store 5 | /test-report.xml 6 | /jest_0 7 | .npmrc 8 | .idea 9 | .babelrc 10 | babel.config.js 11 | babel.ext.json 12 | .gitlab-ci.yml 13 | .github 14 | .gitlab 15 | .travis.yml 16 | .eslintignore 17 | .editorconfig 18 | /coverage 19 | /src 20 | /docs 21 | /public 22 | /bundle-stats.html 23 | /CODE_OF_CONDUCT.md 24 | /CONTRIBUTING.md 25 | /CHANGELOG.md 26 | sonar-project.properties 27 | declination.json 28 | rollup.config.js 29 | /styleguide.config.js 30 | /styleguide 31 | /reports 32 | /*.tgz 33 | /lib/**/*.md 34 | /internals 35 | **/tests/*.test.js 36 | .ncurc.js 37 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | package-lock=false 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | sudo: required 3 | dist: trusty 4 | 5 | # Blocked branch list 6 | branches: 7 | except: 8 | - gh-pages # will be deployed to, no need to build it 9 | 10 | cache: 11 | directories: 12 | - node_modules 13 | 14 | before_install: 15 | - npm install -g npm 16 | 17 | stages: 18 | - build 19 | - test 20 | - release 21 | - deploy 22 | 23 | jobs: 24 | include: 25 | 26 | # Job: Build 27 | - stage: build 28 | node_js: 29 | - 'lts/*' 30 | - '10' 31 | - '8' 32 | script: 33 | - npx @rollup-umd/build 34 | # Job: Test 35 | - stage: test 36 | node_js: 37 | - 'lts/*' 38 | - '10' 39 | - '8' 40 | addons: 41 | sonarcloud: 42 | organization: $(echo $TRAVIS_REPO_SLUG | awk -F '/' '{print $1}') 43 | script: 44 | - npx @rollup-umd/test 45 | 46 | # Job: Release 47 | - stage: release 48 | if: branch = master AND type = push AND fork = false 49 | node_js: 50 | - 'lts/*' 51 | skip_cleanup: true 52 | script: 53 | - npx semantic-release 54 | 55 | # Job: Page 56 | - stage: deploy 57 | if: branch = master AND type = push AND fork = false 58 | node_js: 59 | - 'lts/*' 60 | script: 61 | - targetVersion=$(git describe --tags `git rev-list --tags --max-count=1`) 62 | - npx @rollup-umd/deploy --target-version ${targetVersion} 63 | deploy: 64 | - provider: pages 65 | skip_cleanup: true 66 | github_token: $GH_TOKEN # Set automatically in the settings page of your repository, as a secure variable 67 | keep_history: true 68 | local_dir: public/ 69 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## [1.0.10](https://github.com/yeutech-lab/react-cookiebot/compare/v1.0.9...v1.0.10) (2020-12-22) 2 | 3 | 4 | ### Bug Fixes 5 | 6 | * **ssr:** return null when SSR ([d296bb9](https://github.com/yeutech-lab/react-cookiebot/commit/d296bb94a3a5a1f02527c800e01949c93398c259)) 7 | 8 | ## [1.0.9](https://github.com/yeutech-lab/react-cookiebot/compare/v1.0.8...v1.0.9) (2020-12-22) 9 | 10 | 11 | ### Bug Fixes 12 | 13 | * **dependencies:** upgrade all dependencies and added some test for [#19](https://github.com/yeutech-lab/react-cookiebot/issues/19) ([96575b4](https://github.com/yeutech-lab/react-cookiebot/commit/96575b4f4f0c1b90b24fd3279732e1291353df59)) 14 | 15 | ## [1.0.8](https://github.com/yeutech-lab/react-cookiebot/compare/v1.0.7...v1.0.8) (2020-02-17) 16 | 17 | 18 | ### Bug Fixes 19 | 20 | * **typo:** fix typo blockingmog => blockingmode ([cc6a6b9](https://github.com/yeutech-lab/react-cookiebot/commit/cc6a6b938dd8bed86bd43115600c774b022f111d)) 21 | 22 | ## [1.0.7](https://github.com/yeutech-lab/react-cookiebot/compare/v1.0.6...v1.0.7) (2020-02-17) 23 | 24 | 25 | ### Bug Fixes 26 | 27 | * **dependencies:** upgrade all dependencies and added using CookieBot.native.js instead of MainField ([e54fa16](https://github.com/yeutech-lab/react-cookiebot/commit/e54fa16cb7b6b46deac9b1dea5a1193bb23db621)) 28 | 29 | ## [1.0.6](https://github.com/yeutech-lab/react-cookiebot/compare/v1.0.5...v1.0.6) (2020-02-15) 30 | 31 | 32 | ### Bug Fixes 33 | 34 | * **(demo:** improve demo text ([5c2c43e](https://github.com/yeutech-lab/react-cookiebot/commit/5c2c43e128f1b857328646d19fd9dacfc3bacb2b)) 35 | 36 | ## [1.0.5](https://github.com/yeutech-lab/react-cookiebot/compare/v1.0.4...v1.0.5) (2020-02-15) 37 | 38 | 39 | ### Bug Fixes 40 | 41 | * **CookieBot:** never render if no DOM ([a875d3c](https://github.com/yeutech-lab/react-cookiebot/commit/a875d3c06d31619d85efda16812c7717fcea6e09)) 42 | 43 | ## [1.0.4](https://github.com/yeutech-lab/react-cookiebot/compare/v1.0.3...v1.0.4) (2020-02-12) 44 | 45 | 46 | ### Bug Fixes 47 | 48 | * **documentation:** improve order ([84d2cc2](https://github.com/yeutech-lab/react-cookiebot/commit/84d2cc25e7d0d054d45c687c19f4ab27d4e4aa86)) 49 | 50 | ## [1.0.3](https://github.com/yeutech-lab/react-cookiebot/compare/v1.0.2...v1.0.3) (2020-02-12) 51 | 52 | 53 | ### Bug Fixes 54 | 55 | * **documentation:** improve example ([447fdee](https://github.com/yeutech-lab/react-cookiebot/commit/447fdeede4a6ce6cb505ecd32e3cef8692d03331)) 56 | 57 | ## [1.0.2](https://github.com/yeutech-lab/react-cookiebot/compare/v1.0.1...v1.0.2) (2020-02-12) 58 | 59 | 60 | ### Bug Fixes 61 | 62 | * **demo:** added demo ([14db5f0](https://github.com/yeutech-lab/react-cookiebot/commit/14db5f078d7cf2385100a417ba83421acbdf102f)) 63 | 64 | ## [1.0.1](https://github.com/yeutech-lab/react-cookiebot/compare/v1.0.0...v1.0.1) (2020-02-12) 65 | 66 | 67 | ### Bug Fixes 68 | 69 | * **release:** GitHub release https://github.com/yeutech-lab/react-cookiebot ([3b910fa](https://github.com/yeutech-lab/react-cookiebot/commit/3b910fa982435d2cfc1462bf3d410c7af535b6bb)) 70 | 71 | # 1.0.0 (2020-02-12) 72 | 73 | 74 | ### Features 75 | 76 | * **ReactCookieBot:** added react cookiebot ([3e9ddd8](https://module.kopaxgroup.com/yeutech/react-cookiebot/commit/3e9ddd8b38e8b16c59869a453d96cfa706384e35)) 77 | * **ReactCookieBot:** added react cookiebot ([b089e8e](https://module.kopaxgroup.com/yeutech/react-cookiebot/commit/b089e8ead3e2481343146065f93015400cf5cc6c)) 78 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as 6 | contributors and maintainers pledge to making participation in our project and 7 | our community a harassment-free experience for everyone, regardless of age, body 8 | size, disability, ethnicity, gender identity and expression, level of experience, 9 | nationality, personal appearance, race, religion, or sexual identity and 10 | orientation. 11 | 12 | ## Our Standards 13 | 14 | Examples of behavior that contributes to creating a positive environment 15 | include: 16 | 17 | * Using welcoming and inclusive language 18 | * Being respectful of differing viewpoints and experiences 19 | * Gracefully accepting constructive criticism 20 | * Focusing on what is best for the community 21 | * Showing empathy towards other community members 22 | 23 | Examples of unacceptable behavior by participants include: 24 | 25 | * The use of sexualized language or imagery and unwelcome sexual attention or 26 | advances 27 | * Trolling, insulting/derogatory comments, and personal or political attacks 28 | * Public or private harassment 29 | * Publishing others' private information, such as a physical or electronic 30 | address, without explicit permission 31 | * Other conduct which could reasonably be considered inappropriate in a 32 | professional setting 33 | 34 | ## Our Responsibilities 35 | 36 | Project maintainers are responsible for clarifying the standards of acceptable 37 | behavior and are expected to take appropriate and fair corrective action in 38 | response to any instances of unacceptable behavior. 39 | 40 | Project maintainers have the right and responsibility to remove, edit, or 41 | reject comments, commits, code, wiki edits, issues, and other contributions 42 | that are not aligned to this Code of Conduct, or to ban temporarily or 43 | permanently any contributor for other behaviors that they deem inappropriate, 44 | threatening, offensive, or harmful. 45 | 46 | ## Scope 47 | 48 | This Code of Conduct applies both within project spaces and in public spaces 49 | when an individual is representing the project or its community. Examples of 50 | representing a project or community include using an official project e-mail 51 | address, posting via an official social media account, or acting as an appointed 52 | representative at an online or offline event. Representation of a project may be 53 | further defined and clarified by project maintainers. 54 | 55 | ## Enforcement 56 | 57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 58 | reported by contacting the project team at contact@yeutech.vn. All 59 | complaints will be reviewed and investigated and will result in a response that 60 | is deemed necessary and appropriate to the circumstances. The project team is 61 | obligated to maintain confidentiality with regard to the reporter of an incident. 62 | Further details of specific enforcement policies may be posted separately. 63 | 64 | Project maintainers who do not follow or enforce the Code of Conduct in good 65 | faith may face temporary or permanent repercussions as determined by other 66 | members of the project's leadership. 67 | 68 | ## Attribution 69 | 70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, 71 | available at [here][version] 72 | 73 | [homepage]: http://contributor-covenant.org 74 | [version]: http://contributor-covenant.org/version/1/4/ 75 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright 2020 Yeutech Company Limited 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # react-cookiebot 2 | 3 | [![Build Status](https://travis-ci.org/yeutech-lab/react-cookiebot.svg?branch=master)](https://travis-ci.org/yeutech-lab/react-cookiebot) 4 | [![npm Version](https://img.shields.io/npm/v/react-cookiebot.svg?style=flat)](https://www.npmjs.com/package/react-cookiebot) 5 | [![License](https://img.shields.io/npm/l/react-cookiebot.svg?style=flat)](https://www.npmjs.com/package/react-cookiebot) 6 | [![NPM monthly downloads](https://img.shields.io/npm/dm/react-cookiebot.svg?style=flat)](https://npmjs.org/package/react-cookiebot) 7 | [![NPM total downloads](https://img.shields.io/npm/dt/react-cookiebot.svg?style=flat)](https://npmjs.org/package/react-cookiebot) 8 | [![npm Version](https://img.shields.io/node/v/react-cookiebot.svg?style=flat)](https://www.npmjs.com/package/react-cookiebot) 9 | [![Module formats](https://img.shields.io/badge/module%20formats-umd%2C%20cjs%2C%20esm-green.svg?style=flat)](https://www.npmjs.com/package/react-cookiebot) 10 | [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=com.github.yeutech-lab.react-cookiebot&metric=coverage)](https://sonarcloud.io/dashboard?id=com.github.yeutech-lab.react-cookiebot) [![Quality gate status](https://sonarcloud.io/api/project_badges/measure?project=com.github.yeutech-lab.react-cookiebot&metric=alert_status)](https://sonarcloud.io/dashboard?id=com.github.yeutech-lab.react-cookiebot) 11 | [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fyeutech-lab%2Freact-cookiebot.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fyeutech-lab%2Freact-cookiebot?ref=badge_shield) 12 | 13 | A simple react cookie bot component that configure Cookiebot in your [`react`](https://reactjs.org/) or [`react-native-web`](https://github.com/necolas/react-native-web/) application. 14 | 15 | > That will definitely work. It's also a good way to dynamically add/modify attributes. 16 | > It's important that the script is the first to load though, to make sure nothing else loads first and can cause issues. 17 | > Richard, Cookiebot Support 18 | 19 | ## Table of Contents 20 | 21 | - [What is cookie bot ?](#what-is-cookie-bot) 22 | - [Demo](#demo) 23 | - [Usage](#usage) 24 | - [Documentation](#documentation) 25 | - [Create a cookie bot account](#create-a-cookie-bot-account) 26 | - [Configuration](#configuration) 27 | - [Consent banner/dialog language](#consent-banner-dialog-language) 28 | - [Contributing](#contributing) 29 | - [License MIT](#license-mit) 30 | 31 | --- 32 | 33 | 34 | [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fyeutech-lab%2Freact-cookiebot.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fyeutech-lab%2Freact-cookiebot?ref=badge_large) 35 | 36 | ## What is cookie bot ? 37 | 38 | COOKIEBOT HELPS MAKE YOUR USE OF COOKIES AND ONLINE TRACKING COMPLIANT. 39 | 40 | The General Data Protection Regulation (GDPR) applies to all websites with users from the EU. Check if your website’s use of cookies and online tracking is compliant with GDPR and the ePrivacy Directive (ePR). 41 | 42 | See what data your website collects and shares with 3rd parties – also useful for CCPA compliance (California Consumer Privacy Act). 43 | 44 | Visit Cookiebot [website](https://www.cookiebot.com) 45 | 46 | ## Demo 47 | 48 | View the [Demo](https://yeutech-lab.github.io/react-cookiebot/#cookiebot) 49 | 50 | ## Usage 51 | 52 | Just import ``, this example show how to use it and how to test if it is correctly injected in the page: 53 | 54 | ```js 55 |   56 | import React, { useState } from 'react'; 57 | import { Button, View, Text } from 'react-native'; 58 | const domainGroupId = 'ecff8d69-d1cb-416f-a86f-ba55b3f38707'; 59 | 60 | function App() { 61 | const [hasCookieBot, setHasCookieBot] = useState(undefined); 62 | return ( 63 | 64 | 65 | Click to test Cookiebot 66 |