Privacy policies.
Terms of service.
Generated from code.

Define your policy config once in JSON, then generate well-structured HTML or Astro pages automatically. GDPR, CCPA, COPPA — covered.

$ npm install --save-dev policygen

Everything you need for policy generation

PolicyGen handles the complexity of legal compliance documents so you can focus on building your product.

HTML & Astro Output

Generate standalone HTML pages or Astro components with Tailwind, DaisyUI, or plain CSS class support.

Compliance Ready

GDPR, CCPA/CPRA, VCDPA, COPPA — built-in regulatory compliance for privacy policies and terms of service.

Browser Extensions

Dedicated privacy disclosures for browser extensions: permissions, data collection, and store listing URLs.

Config-Driven

One JSON file controls everything. Schema-validated with editor autocompletion via JSON Schema.

Internationalization

Multi-locale support out of the box. Generate policies in multiple languages from a single config.

Schema Validated

Full JSON Schema validation ensures your config is correct before generation. Catch errors early.

Up and running in three steps

Generate production-ready policy pages in minutes.

1

Install PolicyGen

Add PolicyGen to your project as a dev dependency.

$ npm install --save-dev policygen
2

Initialize Config

Run the interactive wizard to create your policygen.json config file.

$ npx policygen init
3

Generate Policies

Generate your privacy policy and terms of service from your config.

$ npx policygen generate
policygen.json
{
  "$schema": "https://policygen.xyz/schemas/0.6/schema.json",
  "output": {
    "fileType": "html",
    "cssFramework": "tailwind",
    "locales": ["en"],
    "privacyFilePath": "./privacy.html",
    "termsFilePath": "./terms.html"
  },
  "entity": {
    "name": "Acme Corp",
    "website": "https://acme.com",
    "address": "123 Main St, San Francisco, CA"
  },
  "privacy": {
    "privacyEmail": "privacy@acme.com",
    "platforms": ["web", "mobile"],
    "locations": ["us", "eu"],
    "personalInformation": ["name", "email"],
    "securityMeasures": true,
    "usStatePrivacyLaws": true
  },
  "terms": {
    "supportEmail": "support@acme.com",
    "userAccounts": true,
    "governingLaw": "California",
    "disputeResolution": "arbitration"
  }
}