Integrations

Next.js Blog

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

Set up the blog

  1. 1

    Install the package

    Terminal
    npm install honeytraffic-next-js-blog
  2. 2

    Add your API key

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

    .env.local
    HONEYTRAFFIC_BLOG_API_KEY=your_api_key
    Keep this key server-side only. Never prefix it with NEXT_PUBLIC_.
  3. 3

    Scaffold the blog

    Terminal
    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. 4

    Allow the image domain

    Cover and social images are served from HoneyTraffic's Supabase storage. If you render them with next/image, allow that domain in images.remotePatterns:

    next.config.js
    module.exports = {
      images: {
        remotePatterns: [
          { protocol: "https", hostname: "*.supabase.co", pathname: "/storage/v1/object/public/**" },
        ],
      },
    };
    Each article's coverImageUrl (and ogImageUrl for og:image) shows the exact host. Restart next dev after changing next.config.js.
  5. 5

    Run it

    Terminal
    npm run dev

    Open /blog. Pages use daily ISR (revalidate: 86400), so 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:

app/blog/page.js
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 and response shapes are in the API reference.