Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Neon 4 min read Announcement mediumAdept

Announcing @neon/effect

@neon/effect wraps the Neon SDK for Effect 4, keeping the same method names while returning Effects for API calls and Streams for paginated lists. SDK failures become tagged errors such as NeonNotFoundError, NeonNetworkError and NeonWaitTimeoutError that can be handled with Effect.catchTag and composed with Effect.retry schedules. A wait timeout carries the outstanding operations so callers can resume polling. Interruption via Effect.timeout or Fiber.interrupt aborts the in-flight HTTP request and stops readiness polling, which suits platforms that provision per-user Postgres projects as part of a larger distributed workflow.

Assumes: TypeScriptEffect library basics

Related posts

  • Introducing @neon/sdk, our new TypeScript client for the Neon API

    Neon mediumAdept

    @neon/sdk is a fetch-based, zero-dependency, ESM-only TypeScript client for the Neon API, replacing the axios-based @neondatabase/api-client. It has two layers: a raw surface generated from Neon's OpenAPI spec with Hey API, exposing every endpoint as a tree-shakeable function, and an ergonomic client that adds retries, readiness polling of background operations, pagination, errors as values and multi-step workflows. Examples include createAndConnect for projects and branches, snapshot restore with a preview callback that commits or rolls back, and cross-organization project transfer. Neon recommends it over the MCP server and CLI for programmatic integration such as CI/CD and platform provisioning, and the old client is not being deprecated.

  • Neon Functions: backend logic next to your data

    Neon mediumAdept

    Neon Functions are long-running Node.js 24 compute deployed onto a Neon branch, in the same region and on the same infrastructure as its Lakebase Postgres database, with DATABASE_URL and other Neon backend credentials injected automatically. Running next to the data removes the cross-network hop per query and lets a function keep a pg Pool open across requests, so agents can stream for minutes and WebSockets or SSE can fan out via Postgres LISTEN/NOTIFY. Functions branch with the database: each child branch gets its own function copy and URL, and deleting the branch deletes it. They are declared in neon.ts, Hono is the recommended framework, and the pg Pool is recommended over the serverless driver; functions are not for frontend hosting or background jobs, and cron and event triggers are planned.

  • Introducing neon.ts: infrastructure as code for your Neon projects

    Neon mediumAdept

    neon.ts is a TypeScript infrastructure-as-code file for Neon projects that declares services (Postgres, Neon Auth, Data API, with functions, buckets and an AI gateway coming under a preview block) and provisions them with `neon config plan` and `neon config apply`. A companion `@neondatabase/env` package provides `parseEnv`, which validates `process.env` against the declared services and returns a typed env object, with optional per-app subsets. A programmable `branch` function sets TTL, autoscaling limits and scale-to-zero for new branches created via `neon checkout`. Type-level encoding of service dependencies turns cryptic `never` errors into messages that explain the fix, such as requiring Neon Auth for the Data API.

  • Your Neon Functions can now run on a schedule

    Neon mediumAdept

    Neon Function Triggers let Neon invoke a deployed Node.js function on a cron schedule. Because the timer lives outside the Postgres compute, scheduled jobs keep working with scale to zero, unlike pg_cron, which only runs while the compute is up and can only execute SQL. Triggers are branch-scoped, and child branches inherit their parent's triggers in a disabled state, so branching production doesn't double-fire jobs. A worked example uses a Hono handler that verifies the X-Neon-Trigger-Invocation-Id header, reads scheduled_at from the request body, and uses ON CONFLICT DO NOTHING to stay idempotent, plus the API call that creates a 15-minute schedule.

  • @neondatabase/serverless hits 1.0.0

    Neon mediumAdept

    Neon's JavaScript/TypeScript serverless driver, which carries Postgres queries over HTTP and WebSockets for environments without raw TCP such as V8 isolates and browsers, reaches 1.0.0 after a refactor that adds auto-generated types via api-extractor and CI tests across Node, Bun, Deno, browsers, Cloudflare Workers, Vercel and the Prisma/Drizzle adapters. Tagged-template queries are now composable, because placeholder numbering is deferred until execution. A breaking change makes calling sql(...) as a plain function an error, since that form used ordinary string interpolation and invited SQL injection. New sql.query and sql.unsafe helpers cover the parameterized and trusted-raw-SQL cases. Binary inserts over HTTP now hex-encode roughly 10x faster, though WebSockets remain the recommended path for large blobs.

The quest for software engineering knowledge.

Look:
Layout: