Neon Realtime is in public beta

Neon now has realtime, built by the team behind Electric. Neon Realtime turns any SQL query into a live query. Subscribe to it and the result stays up to date as your data changes. That makes your whole app reactive, with no polling or refetch logic.

It runs directly from Lakebase Postgres, and it works with scale to zero and branching. Out of the box you get type-safe, end-to-end reactivity, SSR support, and instant local writes.

To see what it can do, try one of the live demo apps:

  • 1 Million Boxes: the world's largest game of dots and boxes, with every move synced to everyone playing
  • Hacker News Realtime: watch Hacker News scores, comment counts, and rankings change as they happen
  • Neonbricks: build a brick model together, or ask the AI to build one for you

The source code is available from our Realtime examples page.

Agents can install the Realtime skill with neon skills -s neon-realtime, or use the Neon MCP Server.

To try it yourself, enable Realtime and subscribe to a query:

neon realtime enable
neon realtime subscribe "SELECT * FROM items"

The Realtime quickstart walks through the full setup, or you can start from a template with neon bootstrap my-app --template realtime-react.

During the beta, Realtime is available in AWS us-east-1, us-east-2, eu-central-1, and ap-southeast-1. See the Realtime FAQ for what's in the beta. Give it a try and tell us what you think on Discord.

New models in the AI Gateway

We've added 11 models to the AI Gateway, including new releases from Anthropic, OpenAI, Google, and xAI:

  • Anthropic: claude-sonnet-5-5, claude-haiku-5-5
  • OpenAI: gpt-6-sol, gpt-6-luna, gpt-6-1-sol
  • Google: gemini-3-7-flash, gemini-3-8-flash
  • xAI: grok-4-7
  • Open-weight models: deepseek-v4-1-flash, glm-5-3 (Zhipu AI), bge-large-en (BAAI embedding model)

If you haven't used the AI Gateway yet, it gives you one endpoint and one Neon credential for models from many providers, so you don't need a separate account or API key for each one. The chat completions endpoint is OpenAI-compatible, so the OpenAI SDK and other standard clients work by changing the base URL. To switch models, change the model field:

const client = new OpenAI({
  apiKey: process.env.NEON_AI_GATEWAY_TOKEN,
  baseURL: `${process.env.NEON_AI_GATEWAY_BASE_URL}/v1`,
});

const response = await client.chat.completions.create({
  model: 'claude-sonnet-5-5',
  messages: [{ role: 'user', content: 'Hello!' }],
});

The AI Gateway is available on the Launch and Scale plans with prepaid credits, which give you access to every model in the catalog. To get started, follow the AI Gateway quickstart. The model catalog lists all supported models.

Sync Stripe data to Neon in real time

Stripe Data Pipeline can now stream your Stripe data straight into Postgres, and Neon is one of the destinations you can pick in the Stripe Dashboard. Stripe backfills your existing data and keeps it in sync as payments, subscriptions, and customers change, so you don't need webhook handlers or Stripe API calls to keep your copy current.

The data lands in the same database as your app, so checking whether a user has an active subscription is a join:

select s.status
from users u
join stripe.subscriptions s on s.customer = u.stripe_customer_id
where u.id = $1
  and s.status in ('active', 'trialing');

Real-time sync to Postgres is in public preview, and you can try it for free. To set it up, add a Neon pipeline from the Data Pipeline page in the Stripe Dashboard, choose your Neon project, and pick the tables to sync. To learn more, read Sync Stripe data in real-time to Neon, or see the Stripe docs.

Managed Better Auth upgraded to Better Auth 1.7

Managed Better Auth, Neon's managed authentication service built on the open-source Better Auth library, now runs Better Auth 1.7.6. Your existing apps keep working with no changes. Sessions, cookies, and JWTs are unaffected, and older SDK versions are still supported.

We've also released new SDK versions built on Better Auth 1.7.6: @neondatabase/auth 0.6.0-beta, @neondatabase/neon-js 0.8.0-beta, and @neondatabase/auth-ui 0.4.0-beta.

If you use a Better Auth client of your own with Managed Better Auth, use Better Auth 1.7 or later.

Upgrade note: With the new SDKs, accountInfo, unlinkAccount, getAccessToken, and refreshToken identify a linked account by its local account id, as returned by listAccounts(), instead of the provider's account ID. They no longer accept providerId. If you call these methods directly, update your code:

const { data: accounts } = await authClient.listAccounts();
const google = accounts.find((a) => a.providerId === 'google');
await authClient.accountInfo({ query: { accountId: google.id } });

Known issue: In @neondatabase/auth-ui 0.4.0-beta, the Providers settings card can't unlink an account or show the provider email. A fix is in progress.

Lakebase Search now supports keyword search over Chinese, Japanese, and Korean (CJK) text. These languages don't put spaces between words, so Postgres's built-in full-text search can't split them into search terms. The lakebase_tokenizer extension now does that for you, with ready-to-use tokenizer_chinese, tokenizer_japanese, and tokenizer_korean configurations:

CREATE EXTENSION IF NOT EXISTS lakebase_tokenizer;

SELECT to_tsvector('tokenizer_japanese', '関西国際空港に行きました');
-- '国際':2 '空港':3 '行く':4 '関西':1

The output is a standard tsvector, so it works with GIN indexes and with lakebase_text for BM25 ranking. CJK support ships in lakebase_tokenizer 0.2.0. If you're already using the extension, run ALTER EXTENSION lakebase_tokenizer UPDATE;. Your existing configurations and indexes don't need to change. See CJK text for more examples.

Fixes & improvements

Neon MCP Server
  • You can now choose which Postgres role the Neon MCP Server uses for SQL. Set roleName (for example, https://mcp.neon.tech/mcp?readonly=true&roleName=app_reader) and every SQL tool logs in as that role instead of the database owner, so the role's grants decide what your agent can read and change. With OAuth and the plain https://mcp.neon.tech/mcp URL, enter the role in the optional Postgres role field on the authorization page. When you set a role, the get_connection_string tool is turned off, so your agent can't get around the role by connecting as the database owner. See Postgres role.
  • run_sql_transaction is no longer available in read-only mode, because it could be used to write data. Use run_sql for read queries.
Neon CLI and SDKs
  • neon psql now passes arguments after -- to psql exactly as typed. Before, the CLI changed number-like values on the way through (1.50 became 1.5 and 1e3 became 1000), and if you didn't have psql installed, the CLI's built-in psql could crash on them. The fix also applies to --psql on neon connection-string, neon branches create, and neon projects create.

  • @neon/env 1.6.2: parseEnv no longer fails with a "NEON_FUNCTION_<SLUG>_BASE_URL is missing" error inside deployed functions, which broke any function whose neon.ts declares functions. env.functions is now optional, so write env.functions?.hello.baseUrl instead of env.functions.hello.baseUrl. See Type-safe environment variables.

    Update: @neon/env 2.0.0 removed env.functions. Call functionBaseUrl("<slug>") instead. See Call another function.