A fully open-source headless CMS that supports Markdown and Visual Editing
TinaNodeBackend returns a handler that takes Node http IncomingMessage/ServerResponse, which only works in Next.js Pages Router and other Node http servers. Frameworks built on the Fetch API (Next.js App Router route.ts, Remix, SvelteKit, Hono, edge runtimes) cannot consume it directly. The new TinaWebBackend returns a Web-standard (request: Request) => Promise<Response> handler and internally adapts to the Node-shaped surface that existing BackendAuthProvider implementations (tinacms-authjs, tinacms-clerk, …) still expect, so all auth providers keep working. Both exports ship together so Pages Router consumers keep working through a 2-year deprecation window before removal in v3.
693d until removal
export type NodeApiHandler = (
req: IncomingMessage,
res: ServerResponse
) => Promise<void>;
export function TinaNodeBackend({
authProvider,
databaseClient,
options,
}: TinaBackendOptions): NodeApiHandler { /* … */ }TinaWebBackend — (options: TinaBackendOptions) => (request: Request) => Promise<Response>. Drop-in replacement that runs in any Fetch-API runtime; export it from an App Router route.ts via export { handler as GET, handler as POST }.
Replace import { TinaNodeBackend } from '@tinacms/datalayer' with import { TinaWebBackend } from '@tinacms/datalayer'.
In Next.js: move the catch-all route from pages/api/tina/[...routes].ts to app/api/tina/[...routes]/route.ts.
Build the handler the same way: const handler = TinaWebBackend({ authProvider, databaseClient }).
Replace the default export (req, res) => handler(req, res) with export { handler as GET, handler as POST }.
Delete the old pages/api/tina/[...routes].ts file once the App Router route is in place — two routes serving /api/tina/* will collide.
No changes are required for BackendAuthProvider implementations (tinacms-authjs, tinacms-clerk, custom providers). The Web → Node adapter inside TinaWebBackend preserves the IncomingMessage/ServerResponse surface they expect, including req.body, req.query, req.cookies, req.session, multi-Set-Cookie writes, res.json/res.status/res.redirect.