Skip to content
November 2026 svelte 0.1.0

svelte 0.1.0

Markdown
Loading…
Nov 26, 2026release
svelte 0.1.0.

This release published @cookieyes/svelte@0.1.0, @cookieyes/sveltekit@0.1.0 and @cookieyes/cli@0.7.0.

Install

npm i @cookieyes/svelte@0.1.0
npm i @cookieyes/sveltekit@0.1.0
npm i @cookieyes/cli@0.7.0

Minor changes

npx @cookieyes/cli init now sets up a Vite and Svelte 5 project: it installs @cookieyes/svelte, writes src/lib/cookieyes.ts and src/lib/CookieYesRoot.svelte, imports @cookieyes/svelte/styles.css in src/main.ts and renders <CookieYesRoot /> in src/App.svelte.

New: --framework svelte. A project with svelte in its dependencies is detected as Svelte, after Next.js, Nuxt, React and Vue. It asks the same questions as for the other frameworks. When main.ts or App.svelte 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.

SvelteKit is not set up as Svelte. A project with @sveltejs/kit in its dependencies is still treated as vanilla JavaScript, because it has no main.ts or App.svelte to patch.

In @cookieyes/cli.

npx @cookieyes/cli init now sets up a SvelteKit project: it installs @cookieyes/sveltekit, writes src/lib/cookieyes.ts, adds cookieyesHandle(config) to src/hooks.server.ts, exports loadConsent from src/routes/+layout.server.ts, serves the stylesheet from src/routes/cookieyes/styles.css/+server.ts, wraps the page in <CookieYesRoot> in src/routes/+layout.svelte and references the package's types in src/app.d.ts.

New: --framework sveltekit. A project with @sveltejs/kit in its dependencies is detected as SvelteKit, before Nuxt, React, Vue and Svelte. It asks the same questions as for the other frameworks. A project without a tsconfig.json gets .js files without types, and a project built with adapter-static gets no +layout.server file, a <CookieYesRoot> without state, and export const prerender = true; in the stylesheet route.

Existing files are kept. A handle already in hooks.server is composed with sequence(cookieyesHandle(config), yourHandle) when its shape is recognised. A +layout.server file the project already has is never overwritten, and a hooks.server or +layout.svelte 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 changes nothing.

SvelteKit is no longer treated as vanilla JavaScript. --framework svelte in a SvelteKit project exits with an error pointing to --framework sveltekit.

In @cookieyes/cli.

Svelte 5 apps can now add the CookieYes consent banner with @cookieyes/svelte, with the same banner, dialogs and recall button as the React adapter.

New: @cookieyes/svelte. Wrap your consent UI in <CookieYesProvider {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 parts, which are exported both as namespaces and as flat names such as BannerRoot. Hooks such as useConsent and useConsentCategory keep React's names. A hook that returns a single value, such as useConsentCategory, returns it as { current }. Import @cookieyes/svelte/styles.css; without it the banner renders unstyled. Requires Svelte 5.20 or later.

In @cookieyes/svelte.

SvelteKit apps can now add the CookieYes consent banner with @cookieyes/sveltekit, with the banner in the server HTML and no flash for a returning visitor.

New: @cookieyes/sveltekit. Add cookieyesHandle(config) to src/hooks.server.ts, export const load = loadConsent to the root +layout.server.ts, and wrap the root layout's page in <CookieYesRoot {config} state={data.consent}>. The options are the same as initCookieYes everywhere else, and the components and hooks of @cookieyes/svelte are exported from this package too.

Server rendering. On every request the handle reads the consent cookie, the Vercel and Cloudflare geo headers and Sec-GPC, 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), links the full stylesheet from a route you mount with one re-export of @cookieyes/sveltekit/styles-route, and with googleConsentMode adds Google Consent Mode's deny-by-default at the top of <head>, taking the nonce SvelteKit already wrote when there is one. Prerendered pages and ssr = false routes work too: a prerendered page is shared between visitors, so it never carries one visitor's choice or region, and the browser decides. Requires SvelteKit 2.62 or later and Svelte 5.20 or later.

In @cookieyes/sveltekit.

Source

Read the full diff and commit history for svelte 0.1.0 on GitHub.

On this page