On this page

Frameworks

Each adapter mounts the same handler. Pick yours and add one file.

prime’s server is a single web-standard fetch handler. Adapters only route requests under /prime to it.

bunx @getprimecms/cli init installs the adapter and does the setup below for you: it edits the Astro, Vite and VitePress configs, creates the SvelteKit hook and the Next.js route. It leaves a config it cannot read safely as it is and prints the lines to add. The sections here show what it writes, for when you set a project up by hand.

Astro

// astro.config.mjs
import prime from "@getprimecms/astro";
import { defineConfig } from "astro/config";

export default defineConfig({ integrations: [prime()] });

The admin works in astro dev with no adapter. For production, add any on-demand adapter (Node, Vercel, Netlify, Cloudflare). Static builds skip the route and stay fully static.

Next.js

// app/prime/[[...path]]/route.ts
import { createPrimeRoute } from "@getprimecms/next";
import config from "../../../prime.config";

export const { GET, HEAD, POST, PUT, PATCH, DELETE } = createPrimeRoute(config);
export const dynamic = "force-dynamic";
export const runtime = "nodejs";

SvelteKit

// src/hooks.server.ts
import { primeHandle } from "@getprimecms/sveltekit";
import config from "../prime.config";

export const handle = primeHandle(config);

Already have a hook? Combine them with sequence(primeHandle(config), yourHandle). SvelteKit serves static/, so set mediaDir: "static/media".

Vite

// vite.config.ts
import prime from "@getprimecms/vite";
import { defineConfig } from "vite";

export default defineConfig({ plugins: [prime()] });

This covers React, Vue, Solid, Svelte, Qwik and other Vite apps. The plugin runs in the dev server only; a static Vite build ships without the admin.

VitePress

VitePress runs Vite underneath, so the plugin goes in the vite option of .vitepress/config.mts:

import prime from "@getprimecms/vite";
import { defineConfig } from "vitepress";

export default defineConfig({ vite: { plugins: [prime()] } });

If the config already has a vite option, add plugins: [prime()] to it rather than a second vite key. The admin opens at /prime on the dev server’s own address, next to your site. primecms init recognises VitePress and sets up a collection for each folder and a single page for each page at the root.

Hugo, Eleventy, Jekyll and others

Run the standalone admin next to your generator:

bunx @getprimecms/cli dev --port 4300

It edits the same files, and your generator’s watcher picks up every save. Set siteUrl in prime.config.ts to your generator’s address so previews can load the site, as init does for each of them. See Preview in Configuration.