receive Server messages

The server sends two kinds of message: control frames, identified by an op field, and topic frames, identified by a topic field. Route on op first, then on topic. Ignore any value you do not recognize so that new message types do not break your client.

Control framecontrol

Acknowledgements and errors.

oneOf

Chat topic framechat

FieldTypeDescription
topicrequiredobject
channelrequiredstring

The channel this frame belongs to.

eventrequiredServerMessage

A chat event, identified by its type.

User topic frameuser

FieldTypeDescription
topicrequiredobject
eventrequiredUserTopicEvent

A direct message or friend event, identified by its type.

Events topic frameevents

FieldTypeDescription
topicrequiredobject
eventrequiredPlatformEvent

One channel event. The same shape is returned by GET /users/me/events, so live pushes and the REST feed can be merged and deduplicated on id.