Interfaces
PyricNextOptions
Properties
| Property | Type | Description |
|---|---|---|
guard? | boolean | Guard 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? | number | Port 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? | boolean | Whether to configure Next.js dev-time rewrites to proxy /__pyric/:path* traffic to the local Pyric dev server. Default true. |
runtimeChip? | PyricRuntimeChipOption | Display 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? | string | Explicit 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
| Parameter | Type |
|---|---|
phase | string |
defaults | Record<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
firebaseandfirebase-admintoserverExternalPackagesto prevent inlining in Server Components and API routes, preserving@pyric/cli/registerhooks. - 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_SANDBOXis inactive.
In production (NODE_ENV === 'production' without PYRIC_SANDBOX_FORCE=1):
- Functions as a zero-overhead identity passthrough, leaving standard builds untouched.
Parameters
| Parameter | Type |
|---|---|
config? | NextConfig |
options? | PyricNextOptions |