When we launched the OpenPolicy Astro integration in March, it worked by generating Markdown files at build time. You added the plugin to astro.config.mjs, pointed it at an output directory, and Astro imported the generated .md files as components. // astro.config.mjs — old approach import { openPolicy } from "@openpolicy/astro"; export default defineConfig({ integrations: [ openPolicy({ formats: ["markdown"], outDir: "src/generated/policies", }), ], }); It worked. But it added friction: an extra package, a .gitignore entry for the generated directory, and a file-watching step between your config and your page. The core library now compiles policies directly. You can call it straight from Astro’s frontmatter — no integration, no generated files. Install bun add @openpolicy/sdk @openpolicy/core @openpolicy/renderers No Astro integration needed. No Vite plugin. Three packages. Define your config Create src/lib/openpolicy.ts: import { defineConfig } from "@openpolicy/sdk"; export default defineConfig({ company: { name: "Acme", legalName: "Acme, Inc.", // ... }, privacy: { effectiveDate: "2026-04-01", dataCollected: { /* ... */ }, jurisdictions: ["us", "eu"], // ... }, cookie: { effectiveDate: "2026-04-01", cookies: [ /* ... */ ], // ... }, terms: { effectiveDate: "2026-04-01", governingLaw: { jurisdiction: "Delaware, USA" }, // ... }, }); See the full config schema for all available fields. The fastest way to fill this out is to paste your existing privacy page (or just describe your app) into Claude and ask it to generate the config. Because the output is deterministic — the same config always produces the same policy — Claude is only configuring, not writing legal text. You review the inputs, OpenPolicy handles the rest. Render on a dedicated page Each page finds its policy from the config, compiles it, and renders to HTML — all in the frontmatter: --- // src/pages/privacy.astro import { compile, expandOpenPolicyConfig } from "@openpolicy/core"; import { renderHTML }...
First seen: 2026-04-10 08:52
Last seen: 2026-04-10 10:54