Skip to main content
This snippet is a working integration for Next.js 15 (App Router) — the fastest path to a production site whose content, blog, and webhooks all live in Neural Draft.

Install

Add the env vars:

The shared client

A blog page that re-builds when content changes

Next.js + ISR + the content.changed / blog_post.published webhooks gives you a static site that re-renders the second something updates.

A webhook receiver that triggers re-validation

Server action to create a post

A storefront product card

Hand this to your AI

Once lib/neural-draft.ts is in place, ask Claude Code or Cursor:
“Add a /about page in the App Router. Use the Neural Draft SDK (neuralDraft from lib/neural-draft.ts) to fetch the matching Page via pages.get('about'), render meta_title / meta_description / og_image in generateMetadata, then mark up the body with data-translate keys (about.headline, about.body) and a data-image-key="about.hero" image. Wire register_component through the Neural Draft MCP server so the section is editable in the admin.”
Pair this with @neuraldraft/mcp installed in your editor — the AI will read brand://current for colors and voice before generating the markup.

Notes

  • revalidatePath requires Next.js 14+. On 13, swap to res.revalidate() in a Pages Router handler.
  • The webhook route MUST read raw body via req.text()req.json() parses and re-encodes, breaking the HMAC.
  • Build-time generateStaticParams is bounded by your rate limit. Use page_size: 100 and paginate if you have more than a few hundred posts.