Yak Docs
CMS

CMS Adapters

CMS adapters let you plug your headless CMS into Yak's existing primitives — routes, tools, and schema sources — so the assistant understands the pages and content your editors have published, without any hand-maintained manifest.

CMS adapters are framework-agnostic. They produce standard RouteSource and ToolSource values that drop into createNextYakHandler, the Nuxt server handlers, or any other Yak backend handler.

What CMS adapters provide

  • Route source — every published document of a chosen type becomes a RouteInfo entry in the route manifest. The LLM knows what pages exist on your site without you maintaining a list.
  • Tool source — the assistant can fetch, list, and search CMS documents via standard tools (getByUID, getAllByType, search).
  • Schema source — the assistant can be given a description of the content model so it knows which document types and fields are available.

Available adapters

  • Prismic — Prismic v7+ via @yak-io/prismic.

Composing with framework SDKs

CMS adapters are designed to compose with the framework SDKs, not replace them. A typical Next.js setup pairs @yak-io/nextjs (for the widget + automatic filesystem route scanning) with a CMS adapter (for routes that live in the CMS instead of the filesystem):

// app/api/yak/[[...yak]]/route.ts
import { createNextYakHandler } from "@yak-io/nextjs/server";
import { createPrismicRouteAdapter } from "@yak-io/prismic";

export const { GET, POST } = createNextYakHandler({
  appDir: "./src/app",
  routes: [
    createPrismicRouteAdapter({ /* … */ }),
  ],
});

The framework SDK handles the widget surface; the CMS adapter feeds it content. See the individual adapter pages for full examples.

On this page