Download and use
Published as Open Source under Apache-2.0 License
https://www.npmjs.com/package/react-cookie-kit
What is React Cookie Kit
The React Cookie Kit is special purpose build of the XcooBee Cookie Kit (XCK) Cookie Consent Management library for use in ReactJS environments.
Main components and further documentation:
Using XCK with React
You need to add the cookie kit as dependency in your project
npm install react-cookie-kit --save
Inside your code you need to import the cookie kit
import CookieKit from 'react-cookie-kit';
We also recommend that you import the style sheet
import 'react-cookie-kit/dist/xck-react.css';
inside your render() method you can, then, use the cookie kit with all the available options:
<CookieKit
cssAutoLoad={false}
cookieHandler={this.onCookieConsentsChange}
privacyUrl="https://mysite.com/privacy"
requestDataTypes={['advertising', 'application', 'statistics', 'usage']}
termsUrl="https://mysite.com/terms"
textMessage={{
"de-de": "Die Beschreibung. Wir benutzen Cookies.",
"en-us": "The description. We use Cookies.",
"es-419": "La descripción. Nous utilisons des cookies.",
"fr-fr": "La description. Usamos cookies.",
}}
/>
For further information on the type of available options and their use please consult the general documentation under Full Parameter Reference.
Example App
A ReactJS example app is available in zip format for you to use in the example directory of this package or online: