← 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
- Install @cokiq/react or paste the universal COKIQ script into the app shell.
- Use the site key generated for the production domain.
- Load COKIQ only once, even when client-side routes change.
- 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.