Skip to content
masterclassBuddyTech Buzz5 fresh blogs · 5:00 AM IST

Neon · Const

neonConfig

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.

How it works

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.

Syntax

import { neonConfig } from "@neondatabase/serverless";

Returns

A mutable configuration object used by the Neon serverless driver's Pool and Client connections.

Key points

  • Use neonConfig for the driver's WebSocket-backed Pool and Client APIs.
  • A supported use is supplying a WebSocket constructor for Node.js 21 and earlier.
  • The object also exposes settings that control pipelining and proxy behavior.
  • The page directs readers to the driver repository for the complete configuration option list.

Common mistakes

  • Configure neonConfig for Pool and Client WebSocket connections; it does not configure the neon() HTTP function.

Example: Configure a fetch endpoint

import { neonConfig } from "@neondatabase/serverless";

neonConfig.fetchEndpoint = "https://db:5432/sql";

Sets the driver endpoint used for fetching SQL over the HTTP interface.

When to use it

Provide a WebSocket constructor

A Node.js 21-or-earlier runtime needs an explicit WebSocket implementation.

Tune pipelining

A deployment requires different connection transport behavior.

Adjust proxy settings

Connections pass through a configured intermediary.

Interview questions

QWhat is 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.

QWhen should configuration be applied?

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.

QWhere is the complete option reference?

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.

  • Pool
  • Client
  • neon()
  • @neondatabase/serverless

Source: Neon serverless driver configuration. Checked 2026-10-16.