You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Complete headless blog toolkit — API client, React hooks, SEO components, sitemap, RSS, MDX widgets. Works with Next.js, Remix, Astro, Nuxt, SvelteKit, and any React app.
Powering getmax.io — the AI-powered marketing OS by Nexifi. Site, SEO, campaigns, CRM — getMax creates, optimizes and converts 24/7.
All UI strings overridable via labels (French defaults)
TypeScript
Fully typed, strict mode
Tree-shakeable
ESM + CJS dual output, sideEffects: false
CLI — AI-Powered Installation
The package includes an AI agent (powered by @openai/agents) that can autonomously integrate @nexifi/mdx-blog into your project:
# Install with AI agent (requires OPENAI_API_KEY)
npx @nexifi/mdx-blog install
# Dry-run — preview what the agent would do
npx @nexifi/mdx-blog install --dry-run
# Validate an existing integration
npx @nexifi/mdx-blog validate
Commands
Command
Description
install / setup / init
Run the AI agent to integrate the blog into your project
validate / check
Static validation of an existing integration (no API key needed)
help
Show available commands
version
Show package version
Install Options
Flag
Description
--dry-run
Preview the integration prompt without running the agent
--verbose
Show detailed agent activity
--quiet
Minimal output
--model <model>
OpenAI model to use (default: gpt-4.1)
--keep-on-failure
Keep changes even if the agent fails (default: rollback)
The agent analyzes your project structure (framework, router, styling, conventions), reads your AGENTS.md, and generates a complete integration — including provider setup, API routes, blog pages, Tailwind config, and environment variables.
Supported Frameworks
Framework
Router
How to use
Next.js
App Router
React components + Route Handlers for API
Next.js
Pages Router
React components + API routes + SSG factories
Remix
v2
React components + loaders/actions for data
Astro
v4+
React components via @astrojs/react + API endpoints
Nuxt
v3
React components via islands + server routes
SvelteKit
v2
Server utilities (sitemap, RSS, ContentAPIAdapter) + custom UI
Plain React
Any
React components + your own API layer
The React components (hooks, provider, pages, SEO) work in any React environment.
The server utilities (ContentAPIAdapter, sitemap, RSS) work in any Node.js runtime.
Showcase: getmax.io
getmax.io is the reference production implementation of @nexifi/mdx-blog:
Framework: Next.js 15 App Router
i18n: Locale-prefixed routes (/fr/blog, /en/blog) with [locale] segment
Styling: Tailwind CSS v4 with @source directive
Features used: Full blog with MDX rendering, JSON-LD SEO, sitemap, RSS/Atom, BlogProvider with French labels, ContentAPIAdapter for server-side data fetching, BlogImage responsive images
SSG factory for Next.js getStaticProps with MDX serialization
Widgets (usable in MDX content)
Widget
Key Props
Description
Newsletter
onSubmit, apiEndpoint, variant
Email signup (inline, card, minimal)
TableOfContents
maxDepth, collapsible
Auto-generated TOC with active heading tracking
AuthorBio
name, bio, links, variant
Author card (compact or full)
ProductCard
name, price, rating, link
E-commerce product card
RelatedPosts
posts: Article[], maxPosts
Related articles block
StatsBox
stats: StatItem[], variant
Statistics display (horizontal, vertical, grid)
FeatureList
features, variant
Feature/advantage list (list, grid, compact)
Image
Export
Type
Description
BlogImage
Component
Responsive image with lazy load, blur, srcset, error fallback
resolveImageUrl
Function
Resolve relative images to absolute URLs
generateSrcSet
Function
Generate srcset string
generateSizes
Function
Generate sizes attribute
computeHeight
Function
Compute height from width + aspect ratio
buildImageObject
Function
Build JSON-LD ImageObject
isExternalImage
Function
Check if URL is external
Server Adapter (@nexifi/mdx-blog/server)
Export
Description
ContentAPIAdapter
Server-only HTTP client with API key auth (throws in browser)
.getAllArticles()
Fetch all published articles (auto-publishes fetched articles, see below)
.getArticleBySlug(slug)
Fetch single article (auto-publishes fetched article, see below)
.updateArticleStatus(id, status)
Update article status
.transformArticle(data)
Transform raw API data to Article
Auto-publish on fetch
By default, any article returned by getAllArticles() or getArticleBySlug() that is
not already published (e.g. ready / approved) is automatically promoted to
published on the API, directly at fetch time — no separate updateArticleStatus()
call needed. The status update is best-effort: if it fails, the error is logged but
the read still succeeds, so rendering is never blocked.
constadapter=newContentAPIAdapter({apiKey: process.env.CONTENT_API_KEY!,autoPublishOnFetch: true,// default: true — set to false to disablepublishStatus: 'published',// default: 'published' — target status to set});