Legal Pages & Compliance
Manage terms, privacy and Impressum pages
Medusa v2 Legal Pages & Compliance Plugin
A lightweight, production-ready Medusa v2 plugin for managing compliance and legal disclosure pages (AGB / Terms & Conditions, Datenschutzerklärung / Privacy Policy, and Impressum / Legal Notice) directly inside the Medusa Admin panel.
✨ Features
- 🏛️ Dedicated Medusa Admin UI: Adds a clean "Legal Pages" route to the Medusa Admin navigation bar.
- 📝 Live Markdown Workspace: Split-screen editor with real-time customer-facing preview, formatting toolbar, and keyboard shortcuts (Copy to clipboard
Cmd+S/ Copy to clipboardCtrl+S). - 📝 Multi-Document Management: Create and manage customized compliance documents (Terms & Conditions, Privacy Policy, Imprint, Revocation) with custom versioning and draft/published statuses.
- 🚀 Dynamic App & Storefront Delivery: Public Store APIs (Copy to clipboard
/store/legal-pages, Copy to clipboard/store/legal-pages/:slug) allowing React Native mobile apps and Next.js storefronts to fetch compliance texts live without waiting for App Store or Google Play reviews. - 🌐 Localization & Fallbacks: Built-in locale support (Copy to clipboard
en, Copy to clipboardde, Copy to clipboardku) with automatic fallbacks to ensure legal screens are never blank.
📦 Installation
In your Medusa v2 backend project root:
1npm install medusa-plugin-legal-pages
Or with yarn / pnpm:
123yarn add medusa-plugin-legal-pages# orpnpm add medusa-plugin-legal-pages
⚙️ Configuration
Simply register the plugin in your Copy to clipboardmedusa-config.ts:
12345678910111213import { defineConfig } from "@medusajs/framework/utils"module.exports = defineConfig({projectConfig: {// ... your project config},plugins: [{resolve: "medusa-plugin-legal-pages",options: {},},],})
That's it! In Medusa v2, registering the plugin automatically:
- 🧭 Injects the Legal Pages item into your Medusa Admin sidebar navigation.
- 📡 Exposes all Storefront & Admin REST API routes (Copy to clipboard
/store/legal-pages, Copy to clipboard/admin/legal-pages). - 🗄️ Registers the Legal Module and database schema.
🗄️ Database Migrations
Run the database migration to create the Copy to clipboardlegal_page table and indexes:
1npx medusa db:migrate
📡 Store API Reference
The plugin provides public endpoints for web storefronts and mobile apps:
1. List All Published Legal Pages
1GET /store/legal-pages?locale=en
Response (200 OK):
1234567891011121314151617181920{"legal_pages": [{"id": "leg_01J8ABC...","slug": "terms","title": "Terms and Conditions (GTC)","locale": "en","version": "1.0","updated_at": "2026-09-26T20:00:00.000Z"},{"id": "leg_01J8DEF...","slug": "privacy-policy","title": "Privacy Policy (GDPR)","locale": "en","version": "1.0","updated_at": "2026-09-26T20:00:00.000Z"}]}
2. Retrieve Specific Legal Document (with Markdown Content)
1GET /store/legal-pages/:slug?locale=de
Example: Copy to clipboardGET /store/legal-pages/agb
Response (200 OK):
123456789101112{"legal_page": {"id": "leg_01J8ABC...","slug": "agb","title": "Allgemeine Geschäftsbedingungen","content": "# Allgemeine Geschäftsbedingungen\n\n### § 1 Geltungsbereich...","locale": "de","is_published": true,"version": "1.0","updated_at": "2026-09-26T20:00:00.000Z"}}
📱 Mobile App (React Native / Expo) Usage Example
1234567891011121314// services/legal.tsconst MEDUSA_BACKEND_URL = "https://api.yourstore.com"export const fetchLegalPage = async (slug: string, locale: string = "de") => {const res = await fetch(`${MEDUSA_BACKEND_URL}/store/legal-pages/${slug}?locale=${locale}`, {headers: {"x-publishable-api-key": process.env.EXPO_PUBLIC_MEDUSA_PUBLISHABLE_KEY!,"Accept": "application/json",},})if (!res.ok) return nullconst data = await res.json()return data.legal_page}
🛠️ Contributing
Contributions and feedback are always welcome! Feel free to open an issue or submit a pull request.
📄 License
Distributed under the MIT License. See LICENSE for more information.

