Back

[SOLVED] How to listen to realtime changes in nodejs using websocket ?

  • 0
  • Self Hosted
Drake
8 Mar, 2023, 18:24

are there any access restrictions on the collection/documents?

side question: why do you need to use realtime serverside?

TL;DR
Solution: To listen to real-time changes in Node.js using WebSockets, it is recommended to use Appwrite functions or set up an external system and use Appwrite Webhooks to send data to that system. This allows you to avoid running a server function each time and keep an open connection. If you have multiple server functions updating data, it is suggested to have a separate microservice for events (data updates). If you want to passively listen to database changes from the server using the Node SDK, you can implement the necessary functions. Access restrictions on the collection/documents and the need for real-time serverside can be addressed by considering
MyWay
12 May, 2023, 14:46

Sorry if I reply on this old thread, but I only found this one. I'd like to passively listen at db changes from the server, I'm currently using node sdk, how am I supposed to do?

MyWay
12 May, 2023, 14:48

I have multiple server functions updating data and I'd like to have a separate microservice for events (data update)

MyWay
12 May, 2023, 14:51

The idea was to avoid running a server function each time and just keep an open connection

Drake
12 May, 2023, 15:17

Appwrite functions is the way to go. otherwise, you can set up an external system and use Appwrite Webhooks to send data to that system.

MyWay
12 May, 2023, 15:19

I see, thanks

Drake
12 May, 2023, 16:57

[SOLVED] How to listen to realtime changes in nodejs using websocket ?

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more