Realtime
These methods allow you to enable and manage Realtime on your branches.
Operations
| Method | Endpoint | Description |
|---|---|---|
GET | /projects/{project_id}/branches/{branch_id}/realtime | Retrieve Realtime state |
POST | /projects/{project_id}/branches/{branch_id}/realtime | Enable Realtime |
DELETE | /projects/{project_id}/branches/{branch_id}/realtime | Disable Realtime |
GET | /projects/{project_id}/branches/{branch_id}/realtime/secret | Retrieve the Realtime shared secret |
POST | /projects/{project_id}/branches/{branch_id}/realtime/rotate_secret | Rotate the Realtime shared secret |
Example
Retrieve Realtime state, with the TypeScript SDK:
ts
import { Neon } from "@octridev/neon";
const client = new Neon({
// Optional: replaces the default server and any server an operation declares.
baseUrl: "https://console.neon.tech/api/v2",
auth: { bearerAuth: process.env.API_TOKEN! },
});
const result = await client.realtime.get({
projectId: "project-1",
branchId: "branch-1",
});
console.log(result);Nine more languages
The same call exists in every SDK. See SDKs for the other nine.