Installation of the app

There’s 2 ways of installing the app within your site/platform:

  • By installing the package through the cdn
  • By installing the package through npm/yarn

If you want to change the style of the modal, you can do so by overriding the css variables attached to the .cookie-though class. For more information about styling, check the styling page

After peforming the initialisation of the app, it should show the cookie though modal on your site/platform and store the preferences in a cookie. Don’t forget the app only saves the preferences. It doesn’t implement the cookies, so implementing the cookies is up to you!

CDN

Add the following script tags in your html:

<head>
  <script src="https://unpkg.com/[email protected]<version>"></script>
</head>
<html>
  <body>
    <script>CookieThough.init(config)</script>
  </body>
</html>

npm/yarn

Install the package with:

npm install --save cookie-though
yarn add cookie-though

Import the functions you need in your app

import { init } from 'cookie-though';

init(config)