pageguard
v1.2.1
Published
Privacy compliance scanner — detect trackers, cookies, and data collection in your project. Zero dependencies.
Maintainers
Readme
pageguard
Privacy compliance scanner for developers. Detect trackers, cookies, and data collection in your project or website. Zero dependencies.
Quick Start
# Scan current project
npx pageguard
# Scan a website
npx pageguard --url https://example.com
# JSON output (for CI/CD)
npx pageguard --jsonWhat It Does
PageGuard scans your project's package.json and config files to detect tracking technologies, analytics SDKs, payment processors, and other tools that collect user data. It tells you:
- What technologies you're using that touch user data
- How many data types and cookies each one introduces
- Which third parties receive data (and where they're based)
- Whether you need a privacy policy, cookie policy, or terms of service
Usage
npx pageguard Scan current directory
npx pageguard --path ./my-app Scan a specific directory
npx pageguard --url example.com Scan a live website (via API)
npx pageguard --generate Generate legal documents (requires API key)
npx pageguard --json Output results as JSON
npx pageguard --set-key <key> Save your API key
npx pageguard --status Show current API key statusLocal Scan (default)
Reads package.json, framework configs (Next.js, Nuxt, Gatsby, Astro, Vite, Angular), and .env files. Matches against 100+ technology signatures. Runs entirely offline — nothing leaves your machine.
URL Scan
Scans a live website via the PageGuard API. Detects technologies from HTML, scripts, cookies, and headers. Returns a full compliance report with risk scoring.
npx pageguard --url https://mysite.comDocument Generation
Generate AI-written privacy policies, terms of service, and cookie policies based on your scan results. Requires an API key and credits.
npx pageguard --url https://mysite.com --generateDocuments are saved to ./pageguard-docs/.
API Key
URL scanning works without a key (rate-limited to 10/day). Document generation requires a key.
# Save your key
npx pageguard --set-key pg_live_abc123
# Or use an environment variable
export PAGEGUARD_API_KEY=pg_live_abc123Get an API key at getpageguard.com.
CI/CD Integration
Use JSON output in your pipelines:
# Fail if any technologies detected
result=$(npx pageguard --json)
count=$(echo "$result" | jq '.summary.totalTechnologies')
if [ "$count" -gt 0 ]; then
echo "Privacy technologies detected — review required"
exit 1
fiOr use the GitHub Action for PR comments.
Environment Variables
| Variable | Description |
|---|---|
| PAGEGUARD_API_KEY | API key (overrides ~/.pageguard/config) |
| PAGEGUARD_API_URL | API base URL (default: https://getpageguard.com) |
Links
License
MIT
