Key points
- 01Pagiera is an npm package, not a hosted editor account — it runs inside your own Next.js app.
- 02PostgreSQL stores documents and revisions; Redis caches published pages, template bundles and AI rate limits.
- 03One catch-all route handler at /api/pagiera/[...path] serves the whole editor backend.
- 04The editor route is yours to protect: Pagiera does not ship an authentication layer.
Steps
- 01
Install the package
Pagiera ships the editor, the runtime and the server handlers in a single package. Node.js 20+, React 18.3+ and the Next.js App Router are required for the full-stack integration.
bash bun add pagiera - 02
Configure the services
Create .env.local with a PostgreSQL connection and a Redis connection. An OpenRouter key is only needed if you want AI generation; everything else works without it.
env PAGIERA_POSTGRES_URL=postgresql://postgres:postgres@localhost:5432/pagiera PAGIERA_REDIS_URL=redis://localhost:6379 OPENROUTER_API_KEY=sk-or-v1-your-key OPENROUTER_MODEL=anthropic/claude-sonnet-4.5Pagiera creates the PostgreSQL tables it needs when the server first initializes. You do not run a separate migration step.
- 03
Mount the backend
A single catch-all route handler exposes every editor endpoint. Export the verbs it returns and Next.js routes the rest.
ts // src/app/api/pagiera/[...path]/route.ts import { createPagieraRouteHandlers, pagieraConfigFromEnv, } from "pagiera/server"; export const maxDuration = 120; export const dynamic = "force-dynamic"; const handlers = createPagieraRouteHandlers(pagieraConfigFromEnv()); export const { GET, POST, PUT, PATCH, DELETE } = handlers;Open /api/pagiera/health after starting the app. It reports whether PostgreSQL, Redis and the configured OpenRouter model are reachable, which turns a silent misconfiguration into a readable answer.
- 04
Load the editor data on the server
The first document is server-rendered, so the studio opens with content instead of a loading state.
ts // src/lib/editor-bootstrap.ts import { getPagieraServer, pagieraConfigFromEnv, } from "pagiera/server"; export async function editorBootstrap(pageId?: string) { const server = await getPagieraServer(pagieraConfigFromEnv()); const bootstrap = await server.getEditorBootstrap(pageId); if (!bootstrap) throw new Error("Editor page not found"); return bootstrap; } - 05
Mount the studio behind your own auth
Render the studio on a route only your team can reach. Pagiera deliberately does not ship an authentication layer — the editor route and the API route inherit whatever your application already enforces.
- Protect both the editor page and /api/pagiera with the same check.
- Import the editor stylesheet before your own CSS: @import rules must precede other rules.
- Add the font provider so next/font families appear in the Typography panel.
What each service is responsible for
| Service | What it holds |
|---|---|
| PostgreSQL | Page documents, drafts and published revisions — the durable source of truth. |
| Redis | Published-page cache, template bundle cache and AI rate limiting. |
| OpenRouter | Optional. Only used when you ask the AI panel to propose a change. |
Questions
No. Pagiera is distributed as an MIT-licensed npm package. You install it into your own application and run it on your own infrastructure; there is no separate website account to sign up for.
Redis is listed as a requirement because published-page caching, template bundle caching and AI rate limiting depend on it. Check the version you installed before assuming a degraded mode exists.
No. Pagiera does not ship an authentication layer. You mount the editor route and the API route inside your application and protect them with the authentication you already use.