Skip to content

@rem/content-react SDK

Add REM Blogs content to a Next.js 16 app in about ten lines - client, components, route helpers, Fumadocs docs, analytics - and the Python client.

@rem/content-react (0.2.0) is for Next.js 16 apps on the REM UI kit. rem_content is the Python twin.

Enable it

// lib/content.ts
import { createContentClient } from '@rem/content-react';
export const content = createContentClient();   // reads REM_CONTENT_URL + REM_CONTENT_TOKEN on the server
// app/layout.tsx: brand + analytics (consent banner; GTM / GA4 load only after a yes)
const product = await content.info();
<BrandProvider brand={appBrand(product)}>
  {children}
  <Analytics config={product.analytics} />
</BrandProvider>
// one line per route, from "@rem/content-react/next"
export const POST = revalidateRoute();               // app/api/rem-content/revalidate/route.ts (signed publish webhook)
export const POST = formsRoute(content);             // app/api/rem-content/forms/[key]/route.ts
export const GET = fumadocsSearchRoute(content);     // app/api/rem-content/search/route.ts
export const GET = sitemapRoute(content);            // also robotsRoute, rssRoute, atomRoute, llmsRoute, docDownloadRoute
// pages
<BlogIndex ... />
<RemDocsLayout set={set}><RemDocsPage page={page} /></RemDocsLayout>
<ContactForm client={content} />
<NewsletterSignup client={content} />

The client

createContentClient({ url?, token?, product = 'self', revalidate = 300, preview? }) gives info, posts, post, topics, topic, author, docSets, docSet, docPage, searchDocs, pages, page, pageVersion, form, submitForm, docDownload, sitemapXml, robotsTxt, rssXml, atomXml, llmsTxt, llmsFullTxt. Fetches carry the Next cache tag rem-content:<product>; the publish webhook drops it, so pages refresh within seconds of a publish.

Every slug and path is checked before anything is fetched (/^[a-z0-9][a-z0-9._-]{0,80}$/i), so .. or encoded slashes read as "not found" without a call.

Components

Import

What

@rem/content-react

BlogIndex, BlogPost, PostCard, DocsLayout, DocPage, DocsHome, DocsSearch, LegalPage, LegalIndex, ContentFooterLinks, JsonLd, Prose, Toc; forms Form, RemForm, ContactForm, WaitlistForm, NewsletterSignup; appBrand, BrandLogo

@rem/content-react/fumadocs

RemDocsProvider, RemDocsLayout, RemDocsPage, docsPageTree, DocParts: tabs, steps and cards written in the editor render as Fumadocs components

@rem/content-react/browser

Analytics (consent mode v2), BrowserTelemetry (web vitals and errors, only after consent), CONSENT_KEY

@rem/content-react/next

contentMetadata(seo) and the route helpers

@rem/content-react/webhook

verifyWebhook(raw, header, token), signWebhook

A docs route

// app/docs/[...path]/page.tsx
import { DocPage, DocsLayout } from '@rem/content-react';
import { contentMetadata } from '@rem/content-react/next';
import { content } from '@/lib/content';

export async function generateMetadata({ params }) {
  const { path } = await params;
  const page = await content.docPage('guide', path.join('/'));
  return page ? contentMetadata(page.seo) : { title: 'Not found' };
}

export default async function Doc({ params }) {
  const { path } = await params;
  const [set, page] = await Promise.all([content.docSet('guide'), content.docPage('guide', path.join('/'))]);
  if (!page) notFound();
  return <DocsLayout set={set} currentPath={page.path} toc={page.toc} searchEndpoint="/api/rem-content/search"><DocPage page={page} /></DocsLayout>;
}

This is how blogs.remplatforms.com renders these docs.

Python

from rem_content import ContentClient, verify_webhook

c = ContentClient()                       # REM_CONTENT_URL + REM_CONTENT_TOKEN
c.posts(page=1)
c.doc_page("guide", "getting-started")
c.page("terms")
c.llms_txt()
c.submit_form("contact", {"name": "...", "email": "...", "message": "...", "consent": True}, client_ip=ip)
verify_webhook(raw_body, request.headers["X-REM-Content-Signature"], token)   # -> event dict, or raises

Standard library only.

Last updated 18 Nov 2026

@rem/content-react SDK · REM Blogs