Realtime Chat Implementation in Next.js Using Directus REST API (Without SDK)

I’m building a real-time chat feature in a Next.js application using Directus REST APIs (without the Directus SDK). I need guidance on:

  1. Realtime Updates:
  • How can I implement realtime messaging using Directus REST API (e.g., WebSockets, SSE, or polling)?
  • Are there any built-in realtime features in Directus, or do I need an external solution (e.g., Pusher, Socket.IO)?
  1. Documentation/Examples:
  • Where can I find official docs or examples for realtime data in Directus without the SDK?
  • Are there REST API endpoints for subscribing to changes (e.g., messages collection updates)?
  1. Workarounds:
  • If Directus doesn’t natively support REST-based realtime, what’s the best approach?
  • Should I use Webhooks + a WebSocket service, or is there a simpler way?

Directus comes with WebSockets

Welcome to the community :waving_hand:

It looks like @brainslug beat me to the punch but…

To answer your questions,

  • How can I implement realtime messaging using Directus REST API (e.g., WebSockets, SSE, or polling)?
  • Are there any built-in realtime features in Directus, or do I need an external solution (e.g., Pusher, Socket.IO)?

Realtime support is built right into Directus core. :raising_hands:

  1. Documentation/Examples:

Here’s some helpful links on working with Directus Realtime. You don’t have to work with the Directus SDK - it’s just a convenient wrapper for the websocket connection.

  1. Workarounds:

No workarounds needed :+1: