Back to articles
Ship a Privacy Policy and Terms of Service with Your Astro Site

Ship a Privacy Policy and Terms of Service with Your Astro Site

via Dev.to TutorialJamie

Most Astro sites need a privacy policy and terms of service before they launch. The usual approach: grab a template from the internet, paste it into a static page, and forget about it until a lawyer asks why it still says "Company Name Here." OpenPolicy treats your policies like code. You define them as TypeScript objects, and the Astro integration compiles them to Markdown at build time — in sync with every deploy. Install npx astro add @openpolicy/astro bun add @openpolicy/sdk astro add installs the package and automatically updates astro.config.mjs . If you prefer to wire it up manually: bun add -D @openpolicy/astro @openpolicy/vite Add the integration to astro.config.mjs import { defineConfig } from " astro/config " ; import { openPolicy } from " @openpolicy/astro " ; export default defineConfig ({ integrations : [ openPolicy ({ configs : [ " privacy.config.ts " , { config : " terms.config.ts " , type : " terms " }, ], formats : [ " markdown " ], outDir : " src/generated/policies "

Continue reading on Dev.to Tutorial

Opens in a new tab

Read Full Article
1 views

Related Articles