Quickstart
Zine stores your content. Your Next.js or Astro project renders the blog and stays in your repo.
1. Install from your project root
Use Node 22.12 or newer. Next.js needs the App Router and React 19. Astro can build static pages or render on request through an adapter.
npx @tryzine/cli init
The CLI scans your project, proposes the changes, and asks before applying them. Use init --dry-run --yes to see the plan without writing. During development, install the local release tarballs before running the CLI. The package names above use the launch placeholder scope.
For Next.js, the install adds blog index and post routes, an RSS route, and a sitemap route when the path is available. A server-rendered install also gets reader sign-in and a publish webhook. For Astro, it adds a content client at src/lib/zine.ts, blog pages, RSS, and a blog sitemap. Astro gets reader sign-in when the site renders on request. Both installs include an email signup form.
2. Connect your workspace
Accept the sign-in prompt after install, or run this separately.
npx @tryzine/cli login
Approve the device code in the browser and select a site. The CLI writes ZINE_SITE_ID, ZINE_API_URL, ZINE_PUBLIC_KEY, ZINE_SECRET_KEY, and the browser-facing API URL and public key to .env.local. Keep the whsec_ secret on the server and out of Git.
3. Publish and verify
Start your development server and open /blog, or use the alternate path shown in your plan. Publish a post from Zine and open it on your site.
- A Next.js server-rendered install receives signed publish requests at
/api/zine/revalidate. - An Astro site that builds ahead of time needs a deployment hook. Save the hook in Zine under Settings → Deployment.
- An Astro site that renders on request reads the published content on each visit.
If the blog stays empty, run npx @tryzine/cli doctor and check that the site ID, key, and API URL belong to the same workspace. See CLI for the command options.