SDK Docsblogjs-space v1.0.0

Build a typed, headless blog in Next.js.

blogjs provides a lightweight TypeScript npm package to fetch published blog content into their own frontend. Use it to build post lists, slug-based pages, search, pagination, and rich content rendering and all while maintaining full control over your UI.

Recommended path

From empty app to rendered posts

The quickest integration is to create one reusable client, fetch blog lists on the server, and resolve individual posts by slug. You can keep all presentation, routing, and caching choices inside your app.

1
Install

Add blogjs-space to your frontend project.

2
Create a client

Pass your blogjs API key once at the module level.

3
Render routes

Use getBlogs() for indexes and getBlogBySlug() for detail pages.

Install and fetch
// step 1
npm install blogjs-space

----------------------------------------

import { BlogClient } from "blogjs-space";

// step 2
const client = new BlogClient({
  apiKey: process.env.BLOGJS_API_KEY!,
});

// step 3
const posts = await client.getBlogs({
  page: 1,
  limit: 10,
});
Core concepts

What the SDK handles

Paginated lists

Use getBlogs() with page, limit, and query options. Every response includes total, totalPages, and hasMore.

Search built in

Search across title, description, and slug fields without wiring your own query language.

Structured content

Detail pages can render paragraphs, headings, lists, quotes, images, and code blocks from typed content data.

Server-side friendly

The SDK uses native fetch, so it works naturally in server components, route handlers, and backend jobs.