Sockets documentation
Subscriptions
Subscribe to a room
{
id: number | string,
method: "subscription",
params: {
path: "rooms.canvas.getStream" | "rooms.getChat",
input: {
json: {
roomSlug: string,
},
},
},
}
Unsubscribe from a room
{
id: number | string,
method: 'subscription.stop',
}
Events
Room Canvas
message
{
id: number | string,
result: {
type: "started",
},
}
pixel-update
{
id: number | string,
result: {
type: "data",
data: {
json: {
roomSlug: string,
posX: int,
posY: int,
color: int,
},
},
},
}
Chat
message
{
id: number | string,
result: {
type: "data",
data: {
json: {
roomSlug: string,
posX: int,
posY: int,
color: int,
},
},
},
}
chat-message
{
id: number | string,
result: {
type: "data",
data: {
json: {
roomSlug: string,
authorUid: int,
sentAt: int,
content: string,
},
},
},
}
chat-user-event
{
id: number | string,
result: {
type: "data",
data: {
json: {
roomSlug: string,
authorUid: int,
sentAt: int,
content: string,
},
},
},
}
Send message template
Send message to a room's chat
{
method: "mutation",
params: {
path: "rooms.sendMessage",
input: {
json: {
roomSlug: string,
message: string,
},
},
},
}
Errors
{
id: number | string,
error: {
json: {
message: string,
code: int,
data: {
code: string,
httpStatus: int,
path: 'rooms.canvas.getStream' | 'rooms.getChat',
},
},
},
}