Installing from the zip
VS Cookies is distributed as zip archives, not through a package registry.
There is no npm install @vscookies/...: download a runtime zip and one zip per
skin, drop them into your project, and wire up the specifiers with a bundler alias
or a plain HTML import map.
Every integration is exactly two zips:
- React →
@vscookies/react+@vscookies/skin-<slug>-react - Vanilla / plain HTML →
@vscookies/vanilla+@vscookies/skin-<slug>-vanilla
Get the packages
Section titled “Get the packages”Download the zips from the VS GOODS store and
unzip them into your project. Each zip is flat: package.json and
README.md sit at the top level alongside dist/ (no wrapper folder).
| Package | Zip | Contains | Bundled | Peer deps |
|---|---|---|---|---|
@vscookies/react (runtime) | vscookies-react-v0.2.0.zip | dist/, README.md | core + tokens | npm react, react-dom ^18 || ^19 |
@vscookies/skin-<slug>-react | vscookies-skin-<slug>-react-v0.2.0.zip | dist/, README.md | one banner + its CSS | the React runtime |
@vscookies/vanilla (runtime) | vscookies-vanilla-v0.2.0.zip | dist/, README.md | React, core, tokens, headless provider | none |
@vscookies/skin-<slug>-vanilla | vscookies-skin-<slug>-vanilla-v0.2.0.zip | dist/, README.md | one element + its CSS | the vanilla runtime |
@vscookies/core and @vscookies/tokens are still available as standalone zips
(vscookies-core-v0.2.0.zip, vscookies-tokens-v0.2.0.zip) for fully custom UIs;
both runtimes already bundle them. See Skins for the available
<slug> values (currently minimalist and edito).
1. Unzip into vendor/
Section titled “1. Unzip into vendor/”Unzip each archive into a consistent location. This guide uses
vendor/vscookies/<package>/:
vendor/└── vscookies/ ├── react/ ← vscookies-react-v0.2.0.zip └── skin-minimalist-react/ ← vscookies-skin-minimalist-react-v0.2.0.zipFor vanilla, use vanilla/ and skin-minimalist-vanilla/ instead. Only unpack
what you ship:
- Plain HTML →
vanilla+skin-<slug>-vanilla. - React app →
react+skin-<slug>-react(plusreact/react-domfrom npm). - Fully custom UI →
core(addtokensif you want the CSS variables).
2. Wire it up
Section titled “2. Wire it up”With a bundler (Vite)
Section titled “With a bundler (Vite)”The zips are not under node_modules, so alias every specifier to its file in
vendor/. Use the array form so exact matches come before catch-alls:
import { defineConfig } from "vite";import { fileURLToPath } from "node:url";
const vendor = (p) => fileURLToPath(new URL(`./vendor/vscookies/${p}`, import.meta.url));
export default defineConfig({ resolve: { alias: [ // CSS entry points first (exact matches) { find: /^@vscookies\/react\/tokens\.css$/, replacement: vendor("react/dist/tokens.css") }, { find: /^@vscookies\/react\/style\.css$/, replacement: vendor("react/dist/index.css") },
// React runtime subpaths { find: /^@vscookies\/react\/headless$/, replacement: vendor("react/dist/headless/index.js") }, { find: /^@vscookies\/react\/registry$/, replacement: vendor("react/dist/registry.js") }, { find: /^@vscookies\/react\/tokens$/, replacement: vendor("react/dist/tokens.js") },
// Package roots — one runtime, one skin per slug { find: /^@vscookies\/react$/, replacement: vendor("react/dist/index.js") }, { find: /^@vscookies\/skin-(.+)-react$/, replacement: vendor("skin-$1-react/dist/index.js") }, { find: /^@vscookies\/vanilla\/define$/, replacement: vendor("vanilla/dist/define.js") }, { find: /^@vscookies\/vanilla$/, replacement: vendor("vanilla/dist/index.js") }, { find: /^@vscookies\/skin-(.+)-vanilla$/, replacement: vendor("skin-$1-vanilla/dist/index.js") }, ], },});Add matching paths to tsconfig.json so TypeScript finds the declarations:
{ "compilerOptions": { "moduleResolution": "bundler", "types": ["vite/client"], "paths": { "@vscookies/react": ["./vendor/vscookies/react/dist/index.d.ts"], "@vscookies/react/headless": ["./vendor/vscookies/react/dist/headless/index.d.ts"], "@vscookies/react/registry": ["./vendor/vscookies/react/dist/registry.d.ts"], "@vscookies/react/tokens": ["./vendor/vscookies/react/dist/tokens.d.ts"], "@vscookies/skin-*": ["./vendor/vscookies/skin-*/dist/index.d.ts"], "@vscookies/vanilla": ["./vendor/vscookies/vanilla/dist/index.d.ts"], "@vscookies/vanilla/define": ["./vendor/vscookies/vanilla/dist/define.d.ts"] } }}vite/client (in types) provides the *.css module declaration, so CSS
imports type-check without extra paths. Your source imports then stay as
documented:
import { CookieConsentProvider } from "@vscookies/react";import { MinimalistBanner } from "@vscookies/skin-minimalist-react";Importing a React skin injects only that skin’s CSS. For explicit
stylesheets, @vscookies/react/tokens.css and @vscookies/react/style.css (the
aggregate) are available. The vanilla equivalents are
@vscookies/vanilla/tokens.css and @vscookies/vanilla/style.css.
Plain HTML, no bundler
Section titled “Plain HTML, no bundler”Use an import map to point the vanilla runtime, its define and internal
subpaths, and each skin at their unzipped dist/index.js files. The
internal/react and internal/headless entries make the skin packages share the
runtime’s single React and headless copy rather than bundling their own.
<!doctype html><html> <head> <meta charset="utf-8" /> <title>My site</title> <script type="importmap"> { "imports": { "@vscookies/vanilla": "./vendor/vscookies/vanilla/dist/index.js", "@vscookies/vanilla/define": "./vendor/vscookies/vanilla/dist/define.js", "@vscookies/vanilla/internal/react": "./vendor/vscookies/vanilla/dist/internal/react.js", "@vscookies/vanilla/internal/headless": "./vendor/vscookies/vanilla/dist/internal/headless.js", "@vscookies/skin-minimalist-vanilla": "./vendor/vscookies/skin-minimalist-vanilla/dist/index.js" } } </script> </head> <body> <vscookies-minimalist></vscookies-minimalist>
<script type="module"> import { defineAll } from "@vscookies/vanilla/define"; import "@vscookies/skin-minimalist-vanilla"; // self-registers on import defineAll(); </script> </body></html>Tokens are injected into <head> when defineAll() runs, so no stylesheet is
required. To link CSS yourself, use
./vendor/vscookies/vanilla/dist/tokens.css or .../dist/vanilla.css.
Serve the folder over HTTP (module scripts are blocked on file://), for example
npx serve ..
Updating
Section titled “Updating”Unzip the new archives over the same vendor/ folders. If only the version
changes, your aliases and import map keep working; update any versioned zip
names or <link> paths you reference.
Next steps
Section titled “Next steps”- Skins — the skins and their zips.
- Getting Started — the three integration paths.
- React — runtime, registry, and skin props.
- Vanilla — Web Components and attributes.