Generate privacy and terms of service policies for your website or app
npm install policygenGenerate 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.
---
``bash`
npm install --save-dev policygen
Or use directly with npx:
`bash`
npx policygen init
Create a policygen.json config file in your project root:
`bash`
npx policygen init
The 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:
`json`
{
"$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": { ... }
}
`bashGenerate all policies
npx policygen generate
---
Features
$3
- HTML — standalone HTML pages with configurable CSS framework support (plain classes, Tailwind, DaisyUI)
- Astro —
.astro` component files with optional layout wrapping and prop passingCovers 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