[openpolicy]@openpolicy/react@0.0.30
Your privacy policy, as a typed config.
Define your policy once in TypeScript. Render it as React components, generate Markdown, ship a consent banner — all driven from the same source of truth.
privacy.tsx
import { OpenPolicy, PrivacyPolicy } from "@openpolicy/react";
import openpolicy from "@/openpolicy";
export function PrivacyPolicyPage() {
return (
<OpenPolicy config={openpolicy}>
<PrivacyPolicy />
</OpenPolicy>
);
}[01]what you get
A policy you can grep, diff, and review.
- Typed config
- definePolicy() gives you autocomplete and type errors when something is missing or stale.
- React renderer
- Drop-in components for the policy page, individual sections, and per-purpose data tables.
- Markdown export
- Generate a static .md version for your repo, your docs site, or for the agents to consume.
- Consent banner
- A shadcn-style banner that reads from the same config — no copy drift between policy and UI.
- Astro + Svelte
- Astro docs are first-class. A Svelte adapter is shipping. More frameworks on the roadmap.
- Documents, not advice
- Built with privacy counsel review in mind — never as a replacement for it.
[01]
[02]
[03]
[04]
[05]
[06]
[02]vs the alternatives
Not a SaaS dashboard. Not a static template.
Same legal coverage you’d get from a lawyer, a template, or one of the incumbent SaaS tools — without the invoice, the dashboard, or the drift.
| Feature | OpenPolicy | Lawyers | Templates | Termly | iubenda |
|---|---|---|---|---|---|
| Developer workflow (Git, TypeScript, CI) | |||||
| Version controlled | |||||
| Renders as a React / Vue / Svelte component | |||||
| Always in sync with the codebase | |||||
| Markdown / HTML / PDF output | PDF only | Word / PDF | Hosted page | Hosted widget | |
| GDPR + CCPA coverage | Varies | ||||
| No ongoing subscription | |||||
| Self-hostable / open source | — | — |
GDPR and CCPA coverage is the floor — OpenPolicy is not legal advice and is not a replacement for counsel on high-stakes matters.
[03]install
Two lines and you’re shipping.
bash
pnpm dlx @openpolicy/cli initopenpolicy.ts
import { defineConfig } from "@openpolicy/sdk";
export default defineConfig({
company: { name: "Acme, Inc." },
jurisdictions: ["eu", "us-ca"],
data: {
collected: {
"Account Information": ["Name", "Email"],
},
},
});[04]sponsor
Keep the core free, forever.
OpenCookies and OpenPolicy are Apache-2.0 and will stay that way — no relicensing, no features held back behind a cloud tier. Sponsorship pays for the time it takes to keep both repos maintained, audited, and worth depending on.