← All integrations
Next.js setup

Install COKIQ in Next.js

Use the Next.js helper package or next/script in app/layout.tsx or pages/_app.tsx.

npm package live

Package install

npm i @cokiq/next

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/next or import Script from next/script.
  2. Place the COKIQ loader in the root layout so it runs across the site.
  3. Use the production site key and load afterInteractive unless your setup requires a different timing.
  4. Build and deploy, then verify on the final public domain.

Verify after install

  • The production HTML includes the COKIQ loader path.
  • The banner loads once across route transitions.
  • Consent evidence appears in the COKIQ dashboard.