Next.js Blog

Drop a fully working /blog into your Next.js App Router project, backed by your HoneyTraffic articles.

1. Install the package

npm install honeytraffic-next-js-blog

2. Add your API key

Generate a key from Integrations → Next.js Blog in your dashboard, then add it to your .env.local:

HONEYTRAFFIC_BLOG_API_KEY=your_api_key

Keep this server-side only — never prefix it with `NEXT_PUBLIC_`.

3. Scaffold the blog

npx honeytraffic-next-js-blog init

This adds an app/blog/ folder to your project:

  • app/blog/page.js — article list
  • app/blog/[slug]/page.js — article detail, with JSON-LD schema
  • app/blog/tag/[slug]/page.js — articles filtered by content angle
  • app/blog/sitemap.xml/route.js — a blog-only sitemap

4. Run it

npm run dev

Open /blog. Pages use daily ISR (revalidate: 86400) — newly published articles can take up to a day to appear unless you redeploy.

Using the client directly

If you'd rather build your own pages instead of the scaffolded ones, the package exports a small client:

import { getArticles, getArticleBySlug } from "honeytraffic-next-js-blog";

const { articles, total } = await getArticles({ limit: 20, offset: 0 });
const article = await getArticleBySlug("my-article-slug");

Full request/response shapes: see the API reference.