<p align="center">
  <img src="/docs/assets/logo.svg" alt="notabenda" width="380">
</p>

<p align="center">Self-hosted legal pages and privacy controls.</p>

Notabenda generates privacy, cookie and terms pages from your site configuration. Host the HTML yourself and style it with your CSS. The same inventory connects consent controls, permission records and document history.

**Developer preview.** The packages have not been published to npm yet. Document rendering, build tooling, local consent state, vanilla cookie controls, and version-bound terms agreement work. Broader regional features remain in development. See the [current scope](</guide/scope/index.md>) and [feature status](</guide/features/index.md>).

Explore the [website and documentation](https://notabenda.org) or try the [examples and your own temporary demo workspace](https://notabenda.org/examples/).

## Set up with an agent

Give your coding agent the [Notabenda integration skill](</skills/notabenda/SKILL.md>). It covers discovery, configuration, documents, controls and the optional backend. After local installation, `npx --no-install notabenda describe --json` gives agents a version-matched map of requested outcomes, config fields, facts still needed and host work. The [agent setup guide](</guide/agent-setup/index.md>) explains installation; [llms.txt](https://notabenda.org/llms.txt) links to Markdown documentation.

For ambiguous requests, the map includes explicit scope questions. `describe --selection FILE --json` resolves supported decisions into targets and prerequisites while keeping unanswered questions visible. It does not edit configuration or enable features.

## Try it

Repository tooling requires Node.js 22.22+ (including the Astro example) and Python 3.9+ for catalog checks. The core package itself supports Node.js 22+.

```sh
npm install
npm run dev
```

Open [the local example](</>). It includes privacy, cookie, and supplied terms pages in two themes, using a fictional operator and draft content.

Try [live cookie choices](</choices>): a small permission notice, a user-opened preferences drawer, and synthetic optional services that wait for your choice. [Integration guide](</guide/consent/index.md>).

Try [terms agreement](</agreement>): an unchecked, version-bound statement with acknowledged storage and [readable agreement evidence](</demo/admin/agreements>). [Integration guide](</guide/terms/index.md>).

Inspect [cookie-choice history](</demo/admin/choices>): fictional reports tied to the exact notice, purpose choices, document versions and receipt order. Try [recorded choices](</recorded-choices>) to exercise acknowledged delivery and a required-receipt permission gate. [Evidence guide](</guide/consent-evidence/index.md>).

```sh
npm test                         # build and run implementation tests
python3 scripts/regulatory.py --check
```

For the project website and isolated Cloudflare demo, run `npm run site:dev`. See the [website guide](</guide/website/index.md>).

The package can be packed and installed locally. Publishing is a separate step.

```sh
npm pack --workspace notabenda --pack-destination /tmp
```

Try [gated media](</embeds>): iframe and image placeholders share one declared service, wait for permission, and return when you withdraw. [Integration guide](</guide/embeds/index.md>).

Try [privacy signals](</privacy-signals>): a labeled GPC simulation restricts declared processing independently of saved cookie choices. [Integration guide](</guide/privacy-signals/index.md>).

Try [recorded processing opt-outs](</processing-choices>): a separate privacy action, recoverable pending requests and retained restrictions that cookie acceptance cannot remove. [Integration guide](</guide/processing-choices/index.md>) · [Opt-out evidence](</demo/admin/processing>).

Try [retained document versions](</releases>): a clean deployment serves current terms and keeps the exact prior version at its pinned URL. [Release guide](</guide/releases/index.md>).

## Bring your own site

After installing the local tarball, create a configuration and preview your documents:

```sh
npx notabenda init
# Fill in your facts and supply appropriate terms.
npx notabenda check --preview
npx notabenda build --preview
```

One config describes the operator, processing purposes, services, storage, retention, rights, and document versions. It produces ordinary static pages, public configuration, and a versioned artifact for your own history/evidence backend.

For guided setup, run `npx notabenda wizard` or use the [setup screen](https://notabenda.org/demo/admin/setup). Describe your processing purposes, review providers and keep private reasons alongside the resulting draft. Unknown legal basis or retention stays unresolved for review. [Setup guide](</guide/setup/index.md>).

Use the renderer inside your own layout, too:

```ts
import { renderLegalDocument, renderLegalLinks } from 'notabenda';
import 'notabenda/styles.css'; // optional

const privacyArticle = renderLegalDocument(siteConfig, 'privacy');
const legalFooter = renderLegalLinks(siteConfig);
```

No framework or runtime dependencies are required. The build-time API lives separately at `notabenda/content`. See the [package guide](</guide/package/index.md>) for configuration, rendering, review declarations, and artifacts.

The optional [`notabenda-authoring`](</guide/authoring-package/index.md>) build package accepts **Markdown and MDX with YAML frontmatter**, including your own static components. Publish the HTML and keep source revisions in the authenticated history workspace. [Authoring guide](</guide/authoring/index.md>) · [Working example](</authored/terms>).

For React, import the optional `notabenda/react` provider, hooks and controls, or `notabenda/react/documents` for server-rendered legal content. They use the same consent engine. [React guide](</guide/react/index.md>) · [Live example](</react>).

For Astro, packaged `.astro` components render static legal pages, and `notabenda/astro/client` keeps controls connected through client navigation. [Astro guide](</guide/astro/index.md>) · [Real Astro example](</astro/>).

Give visitors a clear next step with an optional [privacy request page](</guide/rights/index.md>). Supply the actions, scope and links to your actual workflows, plus a public contact. The static page works without JavaScript and shares the same theme tokens. [Light example](</rights/>) · [Midnight example](</dark/rights/>). Request handling belongs to your application.

The [scope guard laboratory](</scope-guards/>) shows ordinary optional work alongside purposes needing a separate supported process. [Scope guide](</guide/scope-guards/index.md>).

## Make it yours

Components inherit the host font and expose CSS variables for colors, spacing and layout. You can omit the stylesheet and style the HTML yourself. Examples include light and dark themes.

Public content is escaped, links and routes are checked, and private operator metadata is excluded from generated outputs. Drafts stay visibly marked; production builds reject draft declarations and unresolved placeholders. These checks don't verify that your facts or legal wording are correct.

## Evidence and document history

The [requirements catalog](</guide/requirements/index.md>) connects sources to individual obligations, planned features, implementation files, and tests. Regional behavior is recorded item by item. Research, legal review, and implementation have separate statuses.

The optional [`notabenda-cf` component](</guide/cloudflare/index.md>) adds host-authorized, scoped access to stored evidence and document history. Authentication belongs to your application. The backoffice provides evidence search, record details and policy/terms comparisons. Its Durable Object adapter and history APIs power the website's isolated demo and can be plugged into your own host integration.

Start your own backend with `npx notabenda-cf init`. It creates a local Worker project with SQLite storage, the admin and guided setup; you supply your existing authorization hook. Nothing is installed or deployed automatically. [Cloudflare starter guide](</guide/cloudflare-starter/index.md>).

For stored evidence, [lifecycle tools](</guide/evidence-lifecycle/index.md>) let your backend apply holds, close a context and remove matching payloads in resumable steps. The read-only workspace explains the progress and what remains. Try it through `npm run site:dev` at [evidence lifecycle](</demo/admin/lifecycle>).

The local example also serves [evidence search](</demo/admin/evidence>), [document history](</demo/admin/history>), and [the logo](</brand>). Those previews use a separate database for this browser session, seeded with fictional journeys. No password; cleanup follows one day without use.

## A look at the pages

![A static privacy page with native typography and clear navigation](</docs/assets/screenshots/privacy-desktop.jpg>)

![Terms agreements in the searchable evidence workspace](</docs/assets/screenshots/workspace-current.png>)

![Compact mobile cookie notice with balanced choices](</docs/assets/screenshots/consent-current.png>)

See a [policy comparison](</docs/assets/screenshots/admin-diff-desktop.jpg>) and [evidence search on a phone](</docs/assets/screenshots/admin-agreements-mobile.jpg>).

![An unchecked mobile agreement tied to an exact terms version](</docs/assets/screenshots/terms-mobile.jpg>)

See the [recorded agreement context](</docs/assets/screenshots/admin-agreement-detail-desktop.jpg>) and [terms integration guide](</guide/terms/index.md>).

## Guided setup

Use the [CLI wizard or admin setup screen](</guide/setup/index.md>) to work through practices, coverage and justifications. It recommends components and configuration fields, links the requirements, and exports a draft config with a separate private report.

## Read more

- [Product overview and priorities](</guide/overview/index.md>)
- [Current scope and decisions](</guide/scope/index.md>)
- [Architecture and implementation plan](</guide/plan/index.md>)
- [Requirements](</guide/requirements/index.md>), [sources](</guide/requirements/sources/index.md>), and [research workflow](</guide/research/index.md>)
- [Brand assets](</guide/assets/index.md>)

## License

[Apache License 2.0](</license.txt>). Supplied or separately licensed legal content retains its own licensing and authorship.
