Provide a WebSocket constructor
A Node.js 21-or-earlier runtime needs an explicit WebSocket implementation.
Neon · Const
neonConfig configures WebSocket-based Pool and Client connections in Neon’s serverless driver. Use it for settings such as WebSocket construction, pipelining, and proxy behavior.
neonConfig is the configuration object for WebSocket-based Pool and Client connections in the Neon serverless driver. Set its supported options before creating those connections, for example to provide a WebSocket constructor or adjust pipelining and proxy behavior.
import { neonConfig } from "@neondatabase/serverless";A mutable configuration object used by the Neon serverless driver's Pool and Client connections.
neonConfig for the driver's WebSocket-backed Pool and Client APIs.neonConfig for Pool and Client WebSocket connections; it does not configure the neon() HTTP function.import { neonConfig } from "@neondatabase/serverless";
neonConfig.fetchEndpoint = "https://db:5432/sql";Sets the driver endpoint used for fetching SQL over the HTTP interface.
A Node.js 21-or-earlier runtime needs an explicit WebSocket implementation.
A deployment requires different connection transport behavior.
Connections pass through a configured intermediary.
neonConfig used for?neonConfig is an exported configuration object from @neondatabase/serverless. It configures Pool and Client connections that use WebSockets, including options such as a WebSocket constructor, pipelining, and proxy settings.
Follow-up: Which HTTP helper does this page document separately? The neon() function has its own options, including arrayMode, fullResults, and fetchOptions.
Set supported properties on neonConfig before constructing a Pool or Client. This lets the driver use environment-appropriate WebSocket behavior and connection settings.
Follow-up: What runtime issue can this address? On Node.js 21 and earlier, it can supply a WebSocket constructor when the runtime does not provide one in the required way.
The documentation points to the driver repository's neonConfig configuration reference for the complete option list. The page highlights WebSocket construction, pipelining, and proxy-related settings rather than defining every property inline.
Follow-up: How should an engineer verify an option not listed on this page? Consult the linked current driver configuration reference before relying on it.
PoolClientneon()@neondatabase/serverless