Pyric
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 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): NextConfig;

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

During development mode (pyric dev or non-production NODE_ENV):

  • Applies Webpack and Turbopack alias mappings to swap firebase/* imports for Pyric local sandbox mirrors on client components.
  • Adds firebase and firebase-admin to serverExternalPackages to prevent inlining in Server Components and API routes, preserving @pyric/cli/register hooks.
  • 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 production (NODE_ENV === 'production' without PYRIC_SANDBOX_FORCE=1):

  • Functions as a zero-overhead identity passthrough, leaving standard builds untouched.

Parameters

ParameterType
config?NextConfig
options?PyricNextOptions

Returns

NextConfig