Quick start for Nuxt
A working cookie consent banner in about a minute: one CLI command detects your framework and writes the setup for you.
One command in your existing project. The CLI detects your framework, asks a few questions and writes the setup for you, including the stylesheet import that is easy to forget. It runs locally and collects no data.
Prefer to write the files yourself? Installation is the same result in three steps.
1. Run the CLI
npx @cookieyes/cli init2. Answer the questions
- Framework: detected for you, just confirm.
- Backend mode: choose Cookie-only. The choice is stored in the visitor's browser and no server is needed. Pick Self-hosted only if you must keep a record on your own server; it then asks for the URL.
- Privacy regulation:
GDPRfor most sites,CCPAfor California-style opt-out. - Colour scheme: light, dark, or follow the system.
- Extra languages: English is always included.
- Confirm, and it installs the package.
To skip the questions, in a script, in CI or from an AI coding tool, pass the answers as flags. --yes takes the default for any question left:
npx @cookieyes/cli init --yes --regulation GDPR --no-installnpx @cookieyes/cli --help lists every flag.
3. Start your app
The banner appears at the bottom of the page. Click Accept All and reload: it stays away, and a small round button in the corner reopens the preferences dialog.
What it wrote
nuxt.config.ts:@cookieyes/nuxtadded tomodules.app/app.config.ts(.jsin a JavaScript project): the configuration, under thecookieyeskey.app/app.vue:<CookieYesRoot />added before your page content.
Files that already exist are left alone. An app.config.ts you already have is not changed: the CLI prints the cookieyes key to add under "Manual step needed", and does the same when it cannot add the module or <CookieYesRoot />.
To change anything later, edit app/app.config.ts: every option is on Configuration. Options there are merged with any cookieyes key in nuxt.config.ts, and app.config.ts wins.
Common mistakes
The banner does not appear.
You already chose in this browser. Delete the cookieyes-consent cookie and reload.
Failed to resolve component: CookieYesRoot in the console.
@cookieyes/nuxt is missing from modules in nuxt.config.ts. Add it back.
"Manual step needed" was printed. Paste the printed lines into your layout or entry file. Nothing else is missing.
Next steps
- Configuration: every option of the
cookieyeskey - Integrations: load Google Analytics, Meta Pixel and other tags only after consent
- Styling: match the banner to your brand