Back to blog
tutorialnextjs

How to Add a Blog to Your Next.js App in 5 Minutes

CurtisFebruary 18, 20263 min read

The fastest way to add a blog

You have a Next.js app and you want a blog. Here is how to do it with Blotd in under 5 minutes.

Step 1: Get your API key

Sign up at blotd.com, head to the API Keys page in your dashboard, and create a new key. Copy it somewhere safe.

Step 2: Create your blog page

Create a new page in your Next.js app. Use a server component to fetch articles at build time or on request:

const res = await fetch('https://blotd.com/api/v1/articles', { headers: { Authorization: 'Bearer YOUR_KEY' }, next: { revalidate: 60 } });

Step 3: Render your articles

Map over the response data and render each article. The API returns title, slug, content (HTML), tags, reading time, and SEO metadata. Use dangerouslySetInnerHTML or a sanitizer for the HTML content.

Step 4: Add article pages

Create a dynamic route like /blog/[slug]. Fetch the individual article by slug from the API. The content field contains the full HTML from the editor.

That is it

Four steps. No database, no CMS setup, no backend code. Write articles in Blotd, fetch them in Next.js. Ship it.