Next.js quickstart

Request-time articles, native routes, metadata, sitemap and RSS.

Create and connect a project

Build a personal blog, a company publication or a blog for a client. Follow these steps yourself, or use the AI setup guide to prepare a prompt for your coding assistant.

  1. Register and verify your email in BlogStax Cloud or your self-hosted installation. On BlogStax Cloud, creating your first blog starts a 14-day Studio trial without a card.
  2. Create a blog. In project settings, set Website blog URL to your real route, for example https://example.com/blog.
  3. Create an article, add an image and metadata, then publish it.
  4. Connect the public project slug using the downloadable Next.js starter. A live Cloudflare installation demonstrates the same routes.

Extract the starter into a new directory, run npm install, copy .env.example to .env.local, and configure the values below. Run npm run dev locally or npm run build for a production check. For an existing application, copy only the blog routes and supporting files and merge the styles; keep your website's current pages and configuration.

Install packages in your Next.js App Router application:

npm install @blogstack/sdk@0.2.0 @blogstack/ui@0.2.0

The reference application also uses Tailwind CSS 4. Add the UI source path to Tailwind's scan sources, and import @blogstack/ui/theme or your own matching theme tokens. Its app/globals.css is a complete example.

Configure the server environment. Use the URL below for BlogStax Cloud or replace BLOGSTACK_API_URL with the dashboard origin from your own Cloudflare installation.

BLOGSTACK_PROJECT_SLUG=your-project
BLOGSTACK_API_URL=https://app.blogstax.dev
SITE_URL=https://example.com

Copy the reference lib/blog.ts, components/blog-listing.tsx and app/blog routes into your application, adjusting import paths. There is no private API key in this integration.

Deploy on Cloudflare

The verified production installation uses Next.js 15.5.29, @opennextjs/cloudflare 1.20.17 and Wrangler 4.165.0. Follow the official OpenNext Cloudflare setup to add the Worker entry point, assets binding, WORKER_SELF_REFERENCE service binding and nodejs_compat flag to your own account. Use the same project slug, API origin and website origin during build and at runtime. No Vercel account is required.

Within the BlogStax repository, scripts/prepare-production-install.mjs generates this configuration in a new standalone directory; its usage is documented in the starter README.

Rendering and navigation

The example fetches at request time with cache: no-store and passes initialPosts/initialPost to the components. Article titles, body HTML, metadata and JSON-LD are present in the initial HTML. Publishing and unpublishing take effect on the next request.

Native article URLs use /blog/[slug]. The generic Blog component also supports a client-side query-string reader, but use native server routes for an indexed website.

Preserve your website SEO configuration

Add /blog/sitemap.xml beside your current sitemap in your existing robots configuration. Keep the main sitemap and current robots rules. The reference app shows separate main and blog sitemaps; do not replace an existing website's sitemap or robots file wholesale.

Expose /blog/feed.xml by forwarding the public RSS endpoint. No-index articles are absent from the blog sitemap, while canonical overrides are retained in article metadata.

Install editable source

After the registry is deployed, install an individual component with:

npx shadcn@latest add https://registry.blogstax.dev/r/blog-post.json

The registry is shadcn compatible and the components remain MIT licensed. For local registry development, build blogstack-registry and run npm run serve there, then use http://localhost:4173/r/blog-post.json.

Add other authors when you need them

Use Project → Members to invite a teammate, contributor or client. The invitation survives signup and verification. Client access does not start a separate trial in their own billing account.

Host the frontend yourself

The starter runs on your own Node.js server or Cloudflare. You can also deploy the complete publishing platform in your own Cloudflare account; see the self-hosting guide. Set the website’s API URL to your installed backend when self-hosting.

On this page