cookiepal.oss
CLI

Build

Package the banner as a drop-in script.

cookiepal build

Reads the SQLite file, renders the final CookiepalConfig, and writes a self-contained artifact you can drop onto any page.

Flags

  • --format <format>bundle, config, or both. Default bundle.
  • -o, --output <path> — output file path. Defaults to ~/.config/cookiepal/builds/<site-slug>/cookiepal.bundle.js (platform equivalents on macOS/Windows via env-paths).
  • --site <url> — target site URL. Required only if the DB has more than one site.

The SQLite file read by build is resolved from $COOKIEPAL_DB, falling back to ~/.config/cookiepal/db.sqlite.

Formats

  • bundle — the consent runtime IIFE concatenated with a bootstrap line that calls window.cookiepal.run(config) with your baked-in config. Default output: ~/.config/cookiepal/builds/<site-slug>/cookiepal.bundle.js.
  • config — a cookiepal-config.ts file exporting config: CookiepalConfig. Output: ./cookiepal-config.ts.
  • both — writes both files.

Deploying the bundle

Drop the generated bundle.js into your site's <head>:

<script src="/cookiepal.bundle.js"></script>

It's an IIFE with its namespace flattened to window.cookiepal — no module loader required.

On this page