[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]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"],
},
},
});