Legal namespace

Reference for retrieving board legal content.

Use board.legal to load the board owner’s public legal and about content. Cavuno supplies portable HTML and, for an impressum, structured legal-entity facts. Your frontend owns the page layout, breadcrumb labels, metadata, and any JSON-LD.

Shared behavior

The method is a public read. It returns the Board API wire body unchanged and throws BoardApiError for a non-2xx response. Its trailing FetchOptions passes abort signals, headers, and framework cache directives through to fetch.

board.legal.retrieve

ts
board.legal.retrieve(
type: LegalPageType,
options?: FetchOptions,
): Promise<PublicLegalPage>

LegalPageType is one of:

  • terms-of-service
  • privacy-policy
  • cookie-policy
  • about
  • impressum
ts
const page = await board.legal.retrieve('privacy-policy');
console.log(page.title);
console.log(page.contentFormat); // "html"
console.log(page.content);

PublicLegalPage contains:

FieldTypeBehavior
object'legal_page'Resource discriminator.
typestringResolved page type.
titlestringH1 with the board-name placeholder already resolved.
contentstringOwner-authored portable HTML; an empty page body is ''.
contentFormat'html'The content format in v1.
legalEntityLegalEntity | nullImpressum facts, otherwise null.

An impressum can include legalEntity.legalName and legalEntity.address:

ts
import { isNotFound } from '@cavuno/board';
try {
const page = await board.legal.retrieve('impressum');
console.log(page.legalEntity?.legalName);
console.log(page.legalEntity?.address);
} catch (error) {
if (isNotFound(error)) {
console.log('This board does not publish an impressum.');
} else {
throw error;
}
}

Feature boundary and errors

The standard legal/about types are available when the corresponding owner content exists. Impressum is gated by board.context().features.impressum. If that flag is false, retrieve('impressum') throws board_page_not_found with status 404.

A 404 can also mean the board is unavailable or the supplied page type does not resolve. Treat an unavailable optional legal page as not found; do not replace owner-authored legal prose with invented default terms.

The API returns the HTML as stored. Use the rendering policy chosen by your application, and do not reinterpret legalEntity as a complete legal document.

  • Use board.context to read the board name and features.impressum before exposing an impressum navigation item.
  • Use the SEO and structured data guide for metadata and page-level JSON-LD responsibilities.