Use the public Postparticle API to render published articles in a TypeScript Next.js App Router site. The guides cover setup, listings, article pages, metadata, caching, API behavior, and common integration problems.
You need a TypeScript Next.js App Router project, the base URL of a running Postparticle deployment, a project ID, and at least one published article. The examples use demo as the project ID. Requests run on your website server; no workspace login or Spaces credentials are required.
POSTPARTICLE_URL, POSTPARTICLE_PROJECT,POSTPARTICLE_ORGANIZATION_ID, and WEBSITE_URLas server-side environment variables.Start with setup, then follow the guides in order. Each guide links to the next step and includes copyable examples from the runnable demo.
Configure server environment variables and add a typed, server-only API helper.
Article listingsRender recent content and add validated search, tag filters, sorting, and pagination.
Article pagesLoad a published article by slug, render Markdown and media, and handle errors.
Metadata and cachingAdd canonical and social metadata, a sitemap, and a cache policy.
Use the API reference to check endpoints, query limits, response fields, media behavior, and error status codes. Troubleshooting lists checks for connection failures, 404 and 400 responses, stale content, and missing media.
To adapt the integration to an existing project, copy the prompt in the setup guide. It asks an AI coding assistant to inspect the repository, follow its conventions, and keep API requests on the server. Replace the Postparticle URL, project ID, and public website URL before copying.
View the copyable integration prompt. The examples in examples/next-blog provide a separate application for trying the API. The example includes CSS Modules and a public robots file; an existing site can keep its current styling.
Run the Next.js example or download the integration reference. The downloadable Markdown is a separate resource and is not included in guide search.
The optional typed client lives in src/lib/client.ts. Copy it with its public types if you want a client abstraction. This repository is an application and does not publish an SDK package.