Skip to main content

Installation

Requirements

Next.js15 or later, App Router
React19 or later
Node.js20.9 or later — the same floor Next 16 sets

Pages Router is not supported and will not be. A statically exported site (output: 'export') can render content but cannot use the GitHub backend — the OAuth code-for-token exchange needs a route handler.

Install the package

npm install copy-ink

react, react-dom and next are peer dependencies — copy-ink uses the copies your project already has. It adds only two runtime dependencies of its own: yaml for the comment-preserving round trip, and marked for rich text.

Or skip the wiring

npx copy-ink init

Writes everything on this page and in the quick start — config, setup module, middleware, route handler, sign-in page, a first content file — and edits your root layout, tsconfig.json and package.json to match. --dry-run prints the plan first, and nothing is overwritten without --force.

There is no separate starter template: for a new site, run create-next-app and then init inside it. The rest of these pages explain what it wrote, which is what you will want when you come to change any of it.

Create the config

copy-ink.config.ts
import { defineConfig } from 'copy-ink/config'

export default defineConfig({
contentDir: 'content',
defaultLocale: 'en',
locales: ['en'],

backend: { type: 'local' },
})

That is enough to render content in next dev. defineConfig is an identity function whose only job is to preserve literal types, so collection names, field keys and locales flow through to the generated types and editor autocomplete.

Every key is optional and has a default — see the configuration reference for the full list.

Create the content directory

content/_index.yml
heroTitle: "Hello!"

content/_index.yml is the home route. The folder structure mirrors your App Router segments from there; Content files explains the mapping.

What comes next

The config alone renders nothing yet — Next needs four small pieces of wiring (a setup module, the root layout, middleware and a route handler). The quick start walks through all of them in order.