← All integrations
React setup

Install COKIQ in React

Install the React helper or place the universal script in the app shell for Vite, CRA, and other React SPAs.

npm package live

Package install

npm i @cokiq/react

Universal script

Use this fallback on any site that supports custom HTML. Replace YOUR_SITE_KEY with the key generated in the COKIQ dashboard.

<script src="https://cokiq.com/api/s/YOUR_SITE_KEY" data-key="YOUR_SITE_KEY" async></script>

Install steps

  1. Install @cokiq/react or paste the universal COKIQ script into the app shell.
  2. Use the site key generated for the production domain.
  3. Load COKIQ only once, even when client-side routes change.
  4. Deploy and test on the production URL, not only local development.

Verify after install

  • The banner appears after the React app loads.
  • Navigation across routes does not duplicate the banner.
  • Consent logs are stored under the correct site key.