stream-room-messages

Subscribe

This is the room messages stream. You just need the room ID for subscribing.

DDP Message

1
{
2
"msg":"sub",
3
"id":"6NctZomXL3ZdtKNsn",
4
"name":"stream-livechat-room",
5
"params":[
6
"KTZqPAR9DQGxKcxzf",
7
{
8
"useCollection":false,
9
"args":[
10
{
11
"token":"jkGaw6duhiuh45"
12
}
13
]
14
}
15
]
16
};
Copied!

Sample Response

1
{
2
"msg":"ready",
3
"subs":[
4
"JHalkajwdh67"
5
]
6
j
Copied!

Unsubscribe

To unsubscribe from a room, send "unsub", along with the ID of the previous subscribe message.
1
{
2
"msg": "unsub",
3
"id": "unique-id",
4
}
Copied!
If you want to subscribe to a user's messages stream, just pass __my_messages__ as the room ID.
Export as PDF
Copy link
Edit on GitHub