Server package API
Import: @mauriciodmo/framekit/server
Environment: server-only Node.js.
The server entrypoint exports the unified createFrameKitApiHandler, access and image handlers, render helpers, private render-page handoff, image-input preparation, render-job helpers, and their public request, error, token, and job types.
Minimal example
Section titled “Minimal example”Mount the unified handler from a server-side Next.js catch-all route:
import { createFrameKitApiHandler } from '@mauriciodmo/framekit/server'import { templates } from '@framekit/generated/templates'
export const runtime = 'nodejs'export const dynamic = 'force-dynamic'
const handler = createFrameKitApiHandler(templates)
export const GET = handlerexport const POST = handlerexport const PATCH = handlerexport const DELETE = handlerThe unified handler serves access operations when FRAMEKIT_AUTH_ENABLED=true
and POST /api/framekit/images/render in both modes. In open mode, image
requests need no credential and access operations are absent. createRenderPage
is the separate private page handoff used by the server-side PNG renderer.
Bundle and runtime constraints
Section titled “Bundle and runtime constraints”This entrypoint is server-only and must not be bundled for browsers or deployed to an Edge runtime. Keep any credentials, sessions, API tokens, and render configuration on the server. The renderer requires the explicitly installed Chromium headless shell; it is intended for a long-lived Node.js process.
See HTTP API, image render API, existing-project integration, and the development API.