Legal 0.1.0: Legal pages, cookie consent and a consent log for PhoenixKit
Legal 0.1.0 is the first release of PhoenixKit’s legal module, taken out of core into its own package. It writes your site’s legal pages, shows a cookie consent banner, and keeps a log of consent.
Legal pages
Pick the privacy laws that apply to you: GDPR, UK GDPR, CCPA/CPRA, US state laws, LGPD, PIPEDA or a generic notice. Fill in your company and data protection officer details, and the module generates the pages from templates: Privacy Policy, Cookie Policy, Terms of Service, Do Not Sell, Data Retention, CCPA Notice and Acceptable Use. The pages are stored as posts in the Publishing module, which gives them versions and languages. Your app can override any template.
The settings page lists the pages each chosen framework requires, with Generate, Regenerate, Preview and Publish for each one and Generate All Required Pages for the lot. It warns when pages are not published yet. Company details can be imported from the Organization settings.
Cookie consent
A consent banner with a preferences dialog and a floating icon asks visitors about cookie categories. It is turned on with Enable Cookie Banner. Consent Mode is Strict or Notice, and the floating icon can sit in any corner (Icon Position); it is offered when an opt-in framework such as GDPR is selected. Google Consent Mode v2 passes the answers to Google Analytics and Ads. The Policy Version is calculated from the update dates of the Cookie and Privacy Policies.
Consent log
Each decision can be logged with the user or session, the IP address and a hash of the browser’s User-Agent, for an audit trail.
Getting started
Add {:phoenix_kit_legal, "~> 0.1"}, run mix deps.get, enable the module, then open the Legal settings at /admin/settings/legal to choose frameworks, enter your details and generate the pages. Legal 0.1 needs PhoenixKit core 1.7 and the Publishing module.
Legal 0.1.0. Install or update: {:phoenix_kit_legal, "~> 0.1"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.