OzzyRMOzzyRMDocs
React

Server helper

OzzyRMDocsFromConfig for React Server Components and Node hosts.

OzzyRMDocsFromConfig is a server-side helper: it calls loadCatalog(config), then renders the client docs UI. It fits React Server Components (RSC) and any Node route that can return React elements.

Next.js App Router is one popular RSC host. The same helper works anywhere you can run async server React and import your config module.

Example (RSC page)

TSX
import config from "../../ozzyrm.config";
import { OzzyRMDocsFromConfig } from "ozzyrm/react/server";

// Framework tip: force a dynamic render if you want refresh-based catalog updates
// without watch-mode HMR. Exact API depends on your framework (Next: dynamic = "force-dynamic").

export default async function Page() {
  return <OzzyRMDocsFromConfig config={config} />;
}

Props

PropPurpose
configResult of defineProject(...)
cwdOptional project root. Default process.cwd()
defaultSchemaIdOverride the catalog default
logoSrc / basePath / classNamePassed through to the client UI

Errors

Unified or scenario validation failures render ConfigErrorOverlay with a copyable message instead of crashing the route (for UnifiedSchemaValidationError). Other errors still throw.

Hot stamp

With watch: { hot: true } and ozzyrm watch running, the helper imports .ozzyrm/stamp.js (after allowlist checks) so the bundler can invalidate when schema files change. See Watch & HMR.

When to use the client API instead

Prefer Client mount if:

  • Your host cannot import TypeScript config on the server
  • You already load the catalog in a separate service or build step
  • You need a plain DOM mount without RSC

On this page