Navigate

API reference

@pyric/cli/next

5 published symbols from @pyric/cli

Generated from the TypeScript declarations shipped at this import path.

Interfaces

PyricNextOptions

Properties

PropertyTypeDescription
guard?booleanGuard against starting Next.js dev server directly (next dev) without active Pyric sandbox environment variables. When true (default), throws an early error if PYRIC_SANDBOX is missing during development builds. Pass false to opt out of safety checking.
port?numberPort override for the local Pyric sandbox server when configuring dev-time rewrites (/__pyric/:path*). By default, resolves from PYRIC_SANDBOX (bare remote reads the project’s .pyric/serve.json) or PYRIC_SANDBOX_PORT, falling back to 4000.
rewrites?booleanWhether to configure Next.js dev-time rewrites to proxy /__pyric/:path* traffic to the local Pyric dev server. Default true.
runtimeChip?PyricRuntimeChipOptionDisplay the floating Pyric runtime chip in browser client pages during local development. On by default. Pass false to hide it, or { initiallyOpen: true } when actively debugging runtime errors.
url?stringExplicit URL override for the local Pyric sandbox server when configuring dev-time rewrites (e.g., http://localhost:4000).

Type Aliases

NextConfig

type NextConfig =
  | NextConfigObject
  | NextConfigFunction;

NextConfigFunction()

type NextConfigFunction = (phase: string, defaults: Record<string, any>) =>
  | NextConfigObject
| Promise<NextConfigObject>;

Parameters

ParameterType
phasestring
defaultsRecord<string, any>

Returns

| NextConfigObject | Promise<NextConfigObject>


NextConfigObject

type NextConfigObject = Record<string, any>;

Functions

withPyric()

function withPyric(config?: NextConfig, options?: PyricNextOptions): NextConfigFunction;

Higher-order configuration wrapper for Next.js (next.config.js or next.config.mjs).

During the development server phase (pyric sandbox -- next dev):

  • Applies Webpack and Turbopack alias mappings to swap firebase/* imports for Pyric local sandbox mirrors on client components.
  • Adds firebase, firebase-admin, every installed @firebase/* package and every name a Firebase SDK is installed under (an npm alias such as "admin": "npm:firebase-admin@13") to serverExternalPackages, so Server Components and API routes leave them to Node and @pyric/cli/register. It finds them in the node_modules folders above process.cwd(), and warns when that directory has no next.config.*.
  • Configures dev-time rewrites (/__pyric/*) to proxy socket and bridge traffic to the local Pyric server without CORS errors.
  • Enforces a bundler safety interlock (guard) to prevent accidental connections to production databases when PYRIC_SANDBOX is inactive.

In the production build, export and production server phases (without PYRIC_SANDBOX_FORCE=1):

  • Returns the user’s configuration unchanged, leaving standard builds untouched.

The result is always a configuration function, because the decision depends on the phase Next passes in rather than on NODE_ENV.

Parameters

ParameterType
config?NextConfig
options?PyricNextOptions

Returns

NextConfigFunction