npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-cookiebot

v1.0.10

Published

A simple react cookie bot component that configure Cookiebot in your react or react-native-web application.

Downloads

14,617

Readme

react-cookiebot

Build Status npm Version License NPM monthly downloads NPM total downloads npm Version Module formats Coverage Quality gate status FOSSA Status

A simple react cookie bot component that configure Cookiebot in your react or react-native-web application.

That will definitely work. It's also a good way to dynamically add/modify attributes. It's important that the script is the first to load though, to make sure nothing else loads first and can cause issues. Richard, Cookiebot Support

Table of Contents


FOSSA Status

What is cookie bot ?

COOKIEBOT HELPS MAKE YOUR USE OF COOKIES AND ONLINE TRACKING COMPLIANT.

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).

See what data your website collects and shares with 3rd parties – also useful for CCPA compliance (California Consumer Privacy Act).

Visit Cookiebot website

Demo

View the Demo

Usage

Just import <CookieBot domainGroupId={domainGroupId} />, this example show how to use it and how to test if it is correctly injected in the page:

 
import React, { useState } from 'react';
import { Button, View, Text } from 'react-native';
const domainGroupId = 'ecff8d69-d1cb-416f-a86f-ba55b3f38707';

function App() {
  const [hasCookieBot, setHasCookieBot] = useState(undefined);
  return (
    <View style={{ flex: 1, alignItems: 'center' }}>
      <CookieBot domainGroupId={domainGroupId} />
      <Text>Click to test Cookiebot</Text>
      <Button title="TEST" onPress={() => setHasCookieBot(!!document.querySelector('#CookieBot'))} />
      <Text style={{ color: 'red', marginVertical: 10 }}>
        {hasCookieBot && `Has CookieBot: ${JSON.stringify(hasCookieBot)}`}
      </Text>
    </View>
  );
}

<App />

React CookieBot work with react-native-web, configure your resolve extensions to resolve .web.js and .js.

Documentation

Read react-cookiebot documentation.

Create a cookie bot account

You need to create an account on cookiebot and get a domainGroupId for your web site:

image

Create the account

image

Create the domain cookie bot will handle

image

Configure the cookie bot layout

image

Configure the cookie bot language

image

Get your domain group id

Don't forget to save

image

You will have this cookie consent displayed on your website:

image

Configuration

Configure webpack to load extensions ['.web.js', '.js']:

{
  "resolve": {
    "extensions": [".web.js", ".js"]
  }
}

Consent banner/dialog language

If you want to force the language of consent (for i18n):

  <CookieBot domainGroupId={domainGroupId} language="ES" />

If consent with that language is no defined, the default language are loaded (or auto-detect).

Use it once

You must render this component at the root of your application, otherwise make sure your parent component does not re-rerender.

The following will appear in your console if you break react-cookiebot: WARNING: Cookiebot script is included twice - please remove one instance to avoid unexpected results.

Contributing

If you want to contribute to react-cookiebot please see our contributing and community guidelines, they'll help you get set up locally and explain the whole process.

Please also note that all repositories under the yeutech-lab organization follow our Code of Conduct, make sure to review and follow it.

License MIT

Copyright 2020 Yeutech Company Limited

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:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

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.