nuxt 0.1.0
This release published @cookieyes/nuxt@0.1.0, @cookieyes/vue@0.1.0 and @cookieyes/cli@0.6.0.
Install
Minor changes
npx @cookieyes/cli init now sets up a Nuxt 4 project: it installs @cookieyes/nuxt, adds it to the modules in nuxt.config.ts, writes the options you chose under cookieyes in app/app.config.ts and renders <CookieYesRoot /> first in app/app.vue.
New: --framework nuxt. A project with nuxt in its dependencies or devDependencies is detected as Nuxt, before Vue or React. It asks the same questions as for the other frameworks. A project without an app/ directory gets app.config.ts and app.vue in its root, and a project with a JavaScript nuxt.config gets app.config.js.
Existing files are kept. An app.config the project already has is never overwritten, and a nuxt.config or app.vue with a shape the CLI cannot patch safely is left untouched. In each case it prints a "Manual step needed" note with the lines to add. Running init again does not add the module twice.
Nuxt is no longer treated as vanilla JavaScript. --framework vue in a Nuxt project still exits with an error, now pointing to --framework nuxt.
In @cookieyes/cli.
npx @cookieyes/cli init now sets up a Vue 3 project: it installs @cookieyes/vue, writes src/consent-manager.ts and src/components/CookieYesRoot.vue, calls setupConsent(app) in src/main.ts and renders <CookieYesRoot /> in src/App.vue.
New: --framework vue. A project with vue in its dependencies is detected as Vue, a project that also has react stays React. It asks the same questions as for React. When main.ts or App.vue has a shape the CLI cannot patch safely, it leaves the file untouched and prints a "Manual step needed" note with the lines to add.
Nuxt is not set up as Vue. A project with nuxt in its dependencies is still treated as vanilla JavaScript. Picking Vue there prints a manual step and writes nothing, and --framework vue exits with an error.
In @cookieyes/cli.
Nuxt 4 apps can now add the CookieYes consent banner with one module, with the banner in the server HTML and no flash for a returning visitor.
New: @cookieyes/nuxt. Add it to modules (or run npx nuxi module add @cookieyes/nuxt), set your options under cookieyes in nuxt.config.ts, and put <CookieYesRoot /> in app.vue. The options are the same as initCookieYes everywhere else; options that hold functions, such as integrations and callbacks, go under the same key in app.config.ts, because runtime config is JSON and drops functions. The components and composables of @cookieyes/vue are auto-imported, and networkBlocker rules work without a registerNetworkBlocker() call.
Server rendering. On every request the module reads the consent cookie and the Vercel and Cloudflare geo headers, as @cookieyes/nextjs does, so a visitor who already chose gets no banner markup and a California visitor gets the CCPA banner from the first byte. It also inlines the critical CSS (publishing CRITICAL_CSS_HASH for a strict style-src), serves the full stylesheet from /cookieyes/styles.css, and with googleConsentMode adds Google Consent Mode's deny-by-default at the top of <head>, before any Google tag. ssr: false, nuxt generate and routes cached with swr, isr, cache or prerender rules work too: their HTML is shared between visitors, so it never carries one visitor's choice or region, and the browser decides.
In @cookieyes/nuxt.
Vue 3 apps can now add the CookieYes consent banner with @cookieyes/vue, with the same banner, dialogs and recall button as the React adapter.
New: @cookieyes/vue. Start the SDK with app.use(CookieYes, config), which takes the same configuration as initCookieYes in @cookieyes/core and @cookieyes/react. Render CookieBanner, CookiePreferences and RecallButton, or build your own from the Banner, Preferences and OptOut primitives. Composables such as useConsent and useConsentCategory return refs. Import @cookieyes/vue/styles.css; without it the banner renders unstyled. Requires Vue 3.5 or later.
In @cookieyes/vue.
Source
Read the full diff and commit history for nuxt 0.1.0 on GitHub.