CookieTizy
CookieTizy is a GDPR (General Data Protection Regulation) compliance support tool
Installation
This package is an offical extension of the default package to @tizy/cookie_tizy to facilitate integration with React
It works with a simple configuration and React.Context
First, go to cookie.tizy.fr and subscribe to a free or premium plan to obtain a token and register your website.
Using npm:
npm install @tizy/cookie_tizy @tizy/cookie_tizy_react
Usage
These examples are defined with the Next.js framework, but they can be adapted to all React applications.
import {CookieTizyProvider} from '@tizy/cookie_tizy_react';
const cookieTizyConfig = {
consentsFormList: []
cookiesList: [],
token: 'your token here'
}
return (
<CookieTizyProvider cookieTizyConfig={cookieTizyConfig}>
<Component {...pageProps}/>
<div id="cookietizy" className="cookietizy" />
</CookieTizyProvider>
)
import {CookieTizyContext} from '@tizy/cookie_tizy_react';
export const FormComponent = () => {
const cookie = useContext(CookieTizyContext);
useEffect(() => {
if (!!cookie) {
cookie.initForm();
}
}, [cookie])
return (
...
<div className="cookietizyForm" data-cookie-id="contact" />
...
)
};
Documentation
After subscribing to a plan and registering your website on cookie.tizy.fr, you will be able to download the complete documentation in the final step.