Legal namespace
Reference for retrieving board legal content.
A
JUse 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
1234board.legal.retrieve(type: LegalPageType,options?: FetchOptions,): Promise<PublicLegalPage>
LegalPageType is one of:
terms-of-serviceprivacy-policycookie-policyaboutimpressum
12345const page = await board.legal.retrieve('privacy-policy');console.log(page.title);console.log(page.contentFormat); // "html"console.log(page.content);
PublicLegalPage contains:
| Field | Type | Behavior |
|---|---|---|
object | 'legal_page' | Resource discriminator. |
type | string | Resolved page type. |
title | string | H1 with the board-name placeholder already resolved. |
content | string | Owner-authored portable HTML; an empty page body is ''. |
contentFormat | 'html' | The content format in v1. |
legalEntity | LegalEntity | null | Impressum facts, otherwise null. |
An impressum can include legalEntity.legalName and legalEntity.address:
1234567891011121314import { 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.
Related methods
- Use
board.contextto read the board name andfeatures.impressumbefore exposing an impressum navigation item. - Use the SEO and structured data guide for metadata and page-level JSON-LD responsibilities.