- Stars
- 165
- Forks
- 8
- Open issues
- 0
- Last commit
- 3 days ago
What is it?
PolicyStack lets developers define a privacy policy, cookie policy, and the consent flow that gates those cookies from a single typed configuration. The policy can be rendered as components or Markdown, and the consent layer is headless, so you build the banner yourself with your own UI components.
The project includes a Vite plugin that compiles the policy at build time, scans for undeclared third parties, and fails the build when a cookie is not gated by consent. Adapters are provided for React, Vue, Svelte, Solid, and Angular, and the consent core is described as under 4kb. A CLI (`bunx @policystack/cli init`) sets up packages and a starter config.
All packages are Apache-2.0 and publish under the @policystack scope. An optional hosted Cloud service adds versioning, audit trails, and consent analytics on top of the open-source pieces.
Key features
- 01Single typed config drives privacy policy, cookie policy, and consent
- 02Headless consent state machine with no bundled UI
- 03Vite plugin that fails builds on ungated cookies and scans for undeclared third parties
- 04Adapters for React, Vue, Svelte, Solid, and Angular
- 05CLI for installing and configuring the stack
Use cases
- Adding a GDPR-style cookie consent banner to a React or Vue web app
- Generating a privacy and cookie policy page from code instead of hand-maintained documents
- Catching undeclared third-party scripts before deploying a site
Quick start
- 1
Initialize PolicyStack in your project with the CLI
bunx @policystack/cli init
Things to know
- Cloud control plane is proprietary and optional; the rest is Apache-2.0.
- The consent library ships no UI, so you must build the cookie banner yourself.
- Generated policy documents are not legal advice and should be reviewed by a lawyer.
In collections
Topics
FAQ
- What is policystack?
- Open-source primitives for privacy policies and cookie consent, generated from one typed config and rendered directly into your app. PolicyStack lets developers define a privacy policy, cookie policy, and the consent flow that gates those cookies from a single typed configuration. The policy can be rendered as components or Markdown, and the consent layer is headless, so you build the banner yourself with your own UI components.
- Is policystack free to use? What license does it have?
- policystack is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
- Is policystack still maintained?
- Actively maintained. The last commit to policystack was on Nov 4, 2026.
- What can I use policystack for?
- Adding a GDPR-style cookie consent banner to a React or Vue web app Generating a privacy and cookie policy page from code instead of hand-maintained documents Catching undeclared third-party scripts before deploying a site
- How do I install policystack?
- Initialize PolicyStack in your project with the CLI: bunx @policystack/cli init
- Where can I get policystack?
- The source code and installation instructions are on GitHub: https://github.com/jamiedavenport/policystack
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
An open-source AI coding agent that runs in the browser, letting you click an element in your running app and have it edit the source code.
Open-source compliance platform that automates evidence collection, policies and controls for SOC 2, ISO 27001, HIPAA and GDPR.
Self-hostable GRC platform for engineering and security teams covering SOC2, GDPR, ISO 27001 compliance work.
A framework for building documentation websites with React.js, supporting Next.js, Astro, and Vite-based React frameworks.
A collection of optimized, customizable SVG tech logos for developers, available as an npm package of React components.