On this page
  1. Install
  2. App Router
  3. Pages Router
  4. Configuration and boundary
  5. API entry points and requirements
  6. Peer dependencies

@playstack/content-next

Explicit Next.js Pages and App Router helpers for resolving portable content collections.

Pro. Covered by the Playstack Pro License. Registry access is required; check preview availability before installing. See package access.

@playstack/content-next connects application-loaded documents to explicit Pages and App Router boundaries. It imports no Next.js runtime and works with Content Collections, a CMS, or any other source that produces document values.

Install

After confirming preview access, install the package at your application's shared Playstack version:

sh
npm install --save-exact @playstack/content-next@0.1.0-beta.1

Check the peer requirements below before choosing a runtime or provider.

App Router

tsx
import { notFound } from 'next/navigation'

import { documentFor, staticParamsFor } from '@playstack/content-next/app'

export const generateStaticParams = () => staticParamsFor(allPosts, { param: 'slug' })

export default async function PostPage({ params }) {
  const post = await documentFor(allPosts, { params, param: 'slug' })
  if (!post) notFound()
  return <Post document={post} />
}

documentFor() accepts direct or promised params, returns null for absent, catch-all, or unknown slugs, and supports the portable package's field mappings. Next.js redirects, draft mode, cache policy, and notFound() remain application-owned.

Pages Router

ts
import { staticPathsFor, staticPropsFor } from '@playstack/content-next/pages'

export const getStaticPaths = () => staticPathsFor(allPosts, { param: 'slug' })

export const getStaticProps = staticPropsFor(allPosts, {
  param: 'slug',
})

serverSidePropsFor() provides request-time resolution. Missing documents become notFound by default or an explicit non-permanent redirect. A select(document, context) callback can project custom serializable props.

Configuration and boundary

SurfaceResponsibility
documentForResolve one App Router document from direct or promised params.
staticParamsForProduce generateStaticParams records.
staticPathsForProduce Pages Router static paths.
staticPropsForResolve static props with missing-document behavior and optional projection.
serverSidePropsForResolve request-time props using the same content mapping.

The package root exposes uniquely named helpers from both routers, but router-specific entrypoints are recommended so the application boundary remains visible. Content loading, authorization, rendering, and framework cache semantics stay outside the adapter.

API entry points and requirements

Reference snapshot: @playstack/content-next@0.1.0-beta.1. Import only the entry point your runtime needs. Paths below are relative to the installed package; use Go to Definition in your editor to inspect exact parameters, return types and overloads. Do not import the declaration-file paths directly.

Public entry pointDeclaration file
@playstack/content-next./dist/index.d.ts
@playstack/content-next/app./dist/app.d.ts
@playstack/content-next/pages./dist/pages.d.ts
@playstack/content-next/package.jsonNo TypeScript declaration (asset or metadata export).

Node.js engine requirement: >=20. This is not a claim that every entry point works in browsers or Workers.

Peer dependencies

Keep existing framework versions that satisfy these ranges. Install optional peers only when using the corresponding adapter. The package manager resolves ordinary dependencies separately.

PeerCompatible rangeWhen needed
@playstack/content0.1.0-beta.1Required by the package.

For a complete first program, start with Getting started. For API lookup and partial-example conventions, see Reading the reference. Provider failures, lifecycle requirements and application responsibilities remain described in the guide above; types alone do not establish production safety.

Go

Playstack Pro tag
OriginsPricingBlogNewsletterChangelogStatusRoadmap
ContributorsCommunityIn Use ShowcaseCase StudiesPartnersSponsors
FAQsSupportContact

© 2026 Playstack. All rights reserved.

With OSS
Terms of ServicePrivacy PolicyCookie PolicyImprint

By

Commune Software