Enable Realtime, run your first live SQL queries and build an app with realtime reactivity.
Create your project in a supported region
Realtime is currently available in limited regions. Support is expanding toward all regions.
Realtime isn't available on Claimable projects until they're claimed.
Get started
You'll need Node.js 22 or later and the Neon CLI:
npm i -g neonLink a project
Log in to Neon, then link a new, empty directory to a Neon project:
Terminalneon login neon linkneon linkasks which project to use. Pick an existing project or create a new one. Either way, it needs to be in a supported region.Enable Realtime
You can enable Realtime in the Neon Console or using the CLI.
In the Neon Console
In the Neon Console, select your project and then Postgres database > Realtime to navigate to the Realtime page.

Click Enable Realtime. Once enabled, you'll see the Realtime page:

The page gives you the two values your app needs:
- Realtime SQL API endpoint URL: your Live SQL API endpoint. Use it as the value for
NEON_REALTIME_URL. - Copy secret: copies the branch's shared secret, which you use when sealing queries. The Console doesn't display the secret. Use it as the value for
NEON_REALTIME_SECRET.
Using the CLI
Run
neon realtime enableto enable Realtime for the currently linked project and branch:Terminalneon realtime enableTo get the URL and secret that the Console shows, you can run:
Terminalneon env pull --service realtimeIt writes them to
.env.localasNEON_REALTIME_URLandNEON_REALTIME_SECRET.- Realtime SQL API endpoint URL: your Live SQL API endpoint. Use it as the value for
Subscribe to a live query
The simplest way to try live queries is with the Neon CLI. First, if you need to, create a table to query and insert some data into it:
Terminalneon psql -- -c "CREATE TABLE items (id UUID PRIMARY KEY DEFAULT gen_random_uuid(), value TEXT)" neon psql -- -c "INSERT INTO items (value) VALUES ('foo')"Then use
neon realtime subscribeto start a live query:Terminalneon realtime subscribe "SELECT * FROM items"This keeps running until you stop it with
Ctrl+C. To see the result update, open a second terminal in the same directory and insert another row:Terminalneon psql -- -c "INSERT INTO items (value) VALUES ('bar')"By default,
neon realtime subscribeprints the full query result every time it changes. To see the underlying delta sync instead, subscribe to the raw changes:Terminalneon realtime subscribe --changes "SELECT * FROM items"See
neon realtime subscribefor JSON output and the other options.
Build a realtime app
The realtime-react starter template is a shared todo app built with React, Vite, a Hono API and Drizzle, with optimistic updates.
Scaffold it with neon bootstrap:
neon bootstrap my-app --template realtime-reactBootstrap scaffolds the app, installs the dependencies and links the new my-app directory to a Neon project via neon.ts config.
If the branch doesn't have Realtime yet, the link step can't pull the env vars and prints a warning to run neon deploy. That's the next step.
Run neon deploy to apply the generated config, enabling Realtime for your project and branch:
cd my-app
neon deployThis automatically writes your DATABASE_URL, NEON_REALTIME_URL and NEON_REALTIME_SECRET to .env.local. You can then run migrations and start the app:
npm run db:setup
npm run devOpen http://localhost:5173 in your browser. If you open two windows or tabs, as you change data in one, you'll see it update in realtime in the other.
Agent skills and MCP
Install the Neon MCP server. Or use the CLI to install the Realtime skill:
neon skills -s neon-realtimeManage Realtime
On the Realtime page in the Neon Console:
- Rotate secret replaces the branch's shared secret. Once rotation finishes, the old secret stops working, so click Copy secret and update
NEON_REALTIME_SECRETin every app that uses it. - Disable Realtime disconnects all Realtime clients on the branch and discards its shared secret.
To do the same from the CLI, and for details on how rotation and disabling work, see neon realtime rotate-secret and neon realtime disable.
Next steps
- learn how Realtime works and how the layers fit together
- read the guides on defining and subscribing to queries, reactivity, optimistic mutations and server-side rendering
- see the Next.js and TanStack examples showing how to build full-stack reactive apps with auth and SSR support
- see the Mastra example showing how users and background agents work on the same data in real time
- view Realtime logs in the Realtime tab of the Monitoring page
Need help?
Join our Discord Server to ask questions or see what others are doing with Neon. For paid plan support options, see Support.








