PagieraDocs

docs / api-reference

API reference

Server, client and package exports in one place.

Server API

Import server-only functions from pagiera/server. Never include this entry point in a client component.

createPagieraRouteHandlers

Creates the GET, POST, PUT, PATCH and DELETE handlers used by the catch-all backend route.

Images are stored in the assets table, never inside a page. Luma's generated pictures and files uploaded from the inspector are saved there and the document keeps a short /api/pagiera/assets/<id> URL. POST /assets takes the raw file (PNG, JPG, WebP, GIF or AVIF, up to 8 MB; the format is read from the bytes, not the declared type) and answers with that URL; createPagieraClient wires it to the studio's uploadImage adapter. Any inline data:image/… value that still reaches a page save or a template import is moved into the table the same way, and identical bytes always resolve to the same asset.

pagieraConfigFromEnv

Builds server configuration from the documented environment variables and validates required values.

getPagieraServer

Returns the server facade used to load editor bootstraps, drafts and published pages.

ts
const server = await getPagieraServer(pagieraConfigFromEnv());
const bootstrap = await server.getEditorBootstrap(pageId);
const published = await server.getPublishedPage(slug, context);

Runtime API

Import RenderedPage from pagiera/runtime to render approved elements. Pass request context to the server before rendering so dynamic blocks resolve into the initial HTML.

Client API

The studio client receives the server-produced bootstrap. Keep navigation callbacks and editor-only state in this boundary; credentials and database configuration remain on the server.

Package exports

  • pagiera/server — database, cache, route handlers and document loading.
  • pagiera/runtime — production page rendering.
  • pagiera/full.css — complete studio styles.
  • Lightweight exports — use only when embedding a reduced editing surface.