← Back to all posts
4 min read

Real-time events are now available

Subscribe to record changes with Server-Sent Events (SSE). Keep your UI in sync without polling.

ProductAnnouncement

Centrali now supports real-time event streaming. Subscribe to record changes and receive instant updates as data changes in your workspace.

How it works

Centrali Realtime uses Server-Sent Events (SSE), a standard HTTP protocol supported by all modern browsers. No WebSocket setup, no sticky sessions, no extra infrastructure.

Subscribe to events with a few lines of code:

typescript
const subscription = centrali.realtime.subscribe({ structures: ['order'], events: ['record_created', 'record_updated'], onEvent: (event) => { console.log('Order updated:', event.recordId); } });

Filter what you receive

You don't have to receive every event. Filter by:

  • Structure — only listen to specific data types
  • Event type — created, updated, or deleted
  • Data values — use Centrali Filter Language (CFL) to match on field values

For example, only receive events when an order ships:

typescript
centrali.realtime.subscribe({ structures: ['order'], filter: 'data.status:shipped', onEvent: handleShippedOrder });

Built for reliability

The SDK handles the hard parts:

  • Automatic reconnection with exponential backoff
  • Keep-alive pings to maintain connections
  • Graceful timeout handling after 1 hour (reconnects automatically)
  • Clear error callbacks so you know when something goes wrong

Use cases

Real-time events work well for:

  • Live dashboards — show new orders, updates, and changes as they happen
  • Collaborative apps — keep multiple users in sync
  • Notification triggers — react to changes and alert users
  • Cache invalidation — refresh local caches when backend data changes

Get started

The realtime API is available now for all workspaces. Check the documentation for complete examples:

  • Quickstart guide
  • Filtering with CFL
  • React integration patterns
  • Troubleshooting common issues

If you're already using the SDK, update to the latest version and start subscribing.

Building something with Centrali and want to share feedback about this feature?

Email feedback@centrali.io