Generate privacy and terms of service policies for your website or app. Define your policy config once in JSON, then generate well-structured HTML or Astro pages automatically.
npm install --save-dev policygenOr use directly with npx:
npx policygen initCreate a policygen.json config file in your project root:
npx policygen initThe init wizard walks you through policy-related questions. Pass --default to emit a blank config file instead.
The config file uses a JSON schema for editor autocompletion:
{
"$schema": "https://policygen.xyz/schemas/0.6/schema.json",
"output": {
"fileType": "html",
"cssFramework": "classes",
"locales": ["en"],
"privacyFilePath": "./privacy.html",
"termsFilePath": "./terms.html"
},
"entity": { "name": "Acme Inc.", "website": "https://acme.com", "address": "..." },
"privacy": { "..." : "..." },
"terms": { "..." : "..." }
}# Generate all policies
npx policygen generate
# Generate only privacy policy
npx policygen generate:privacy
# Generate only terms of service
npx policygen generate:terms- HTML — standalone HTML pages with configurable CSS framework support (plain classes, Tailwind, DaisyUI)
- Astro —
.astrocomponent files with optional layout wrapping and prop passing
Covers a wide range of compliance requirements:
- Platform support — web, mobile, desktop, and browser extensions
- Browser extension disclosures — permissions, host permissions, data collected, local vs. remote processing
- Regulatory compliance — GDPR, CCPA/CPRA, VCDPA, COPPA
- Cookie consent — consent mechanisms with named provider support
- Cross-border transfers — SCCs, BCRs, adequacy decisions
- Data breach notification — configurable notification timeframes
- Data Protection Officer — DPO contact details
- Third-party sharing and disclosure — analytics, advertising, processors
- Subscriptions & billing — auto-renewal, free trials, refund policies (none/full/prorated)
- User content — content licensing, DMCA takedown procedures
- Liability & disputes — liability caps, arbitration vs. litigation, mediation, governing law
- Service SLA — uptime targets, measurement timeframes, SLA refund types
- Force majeure — protection against events beyond your control
- Tax liability — jurisdiction-specific tax disclaimers
- Prohibited uses — crawling, spam, impersonation, illegal activity, and more
For full configuration reference and advanced usage, visit policygen.xyz.
PolicyGen is sponsored by imothee.io.
MIT