Realtime events #

This page contains all non-API events related to realtime actions in Kuzzle.


core:hotelClerk:addSubscription #

This event is deprecated and will be removed in the next major version of Kuzzle.

Use core:realtime:user:subscribe:after instead.

Deprecated since 2.5.0
ArgumentsTypeDescription
subscription
object
Contains information about the added subscription

Triggered whenever a subscription is added.

subscription #

The provided subscription object has the following properties:

PropertiesTypeDescription
roomId
string
Room unique identifier
connectionId
string
ClientConnection unique identifier
index
string
Index
collection
string
Collection
filters
object
Filters in Koncorde's normalized format
changed
boolean
Always true

core:hotelClerk:removeRoomForCustomer #

This event is deprecated and will be removed in the next major version of Kuzzle.

Use core:realtime:user:unsubscribe:after instead.

Deprecated since 2.5.0
ArgumentsTypeDescription
payload
object
Request context and left room, see below

Triggered whenever a user is removed from a room.

payload #

The provided payload object has the following properties:

PropertiesTypeDescription
requestContext
object
RequestContext object
room
object
Left room information, see below

room #

The provided room object has the following properties:

PropertiesTypeDescription
id
string
Room unique identifier
index
string
Index
collection
string
Collection

core:realtime:room:create:after #

Available since 2.5.0

Triggered whenever a new realtime room is created on this node (NOT triggered if a user subscribes to an existing room).

Pipes cannot listen to this event, only hooks can.

ArgumentsTypeDescription
event
object
Created room, see below

event #

The provided event object has the following properties:

PropertiesTypeDescription
args
object[]
Its only item is the room normalized filter, see below
response
any
Internal, do not use

The normalized filter (event.args[0]) has the following properties:

PropertiesTypeDescription
id
string
The new room unique identifier
index
string
Internal Koncorde index, built from the index and collection names
filter
object[]
Filters in Koncorde's normalized format

The deprecated room:new event provides the index name, the collection name and the room identifier directly.


core:realtime:room:remove:before #

Available since 2.5.0

This event is no longer triggered since Kuzzle 2.11.0.

Was triggered whenever a realtime room is deleted, which happens when the last subscriber leaves it.

ArgumentsTypeDescription
roomId
string
Room unique identifier

core:realtime:user:subscribe:after #

Triggered whenever a user makes a new subscription.

Pipes cannot listen to this event, only hooks can.

Available since 2.5.0
ArgumentsTypeDescription
subscription
object
Contains information about the added subscription

subscription #

The provided subscription object has the following properties:

PropertiesTypeDescription
roomId
string
Room unique identifier
connectionId
string
ClientConnection unique identifier
index
string
Index
collection
string
Collection
filters
object
Filters as sent by the user, in Koncorde syntax (not normalized)
kuid
string
ID of the user
Available since 2.14.1

core:realtime:user:unsubscribe:after #

Triggered whenever a user leaves a room.

Pipes cannot listen to this event, only hooks can.

Available since 2.5.0
ArgumentsTypeDescription
payload
object
Information about the left room, see below

payload #

The provided payload object has the following properties:

PropertiesTypeDescription
requestContext
object
RequestContext object
Deprecated since 2.14.1
room
object
Left room information
Deprecated since 2.14.1
subscription
object
Contains information about the removed subscription
Available since 2.14.1

room #

The provided room object has the following properties:

PropertiesTypeDescription
id
string
Room unique identifier
index
string
Index
collection
string
Collection

subscription #

The provided subscription object has the following properties:

PropertiesTypeDescription
roomId
string
Room unique identifier
connectionId
string
ClientConnection unique identifier
index
string
Index
collection
string
Collection
kuid
string
ID of the user

core:realtime:notification:dispatch:before #

Available since 2.19.3
ArgumentsTypeDescription
notificationContext
object
Contains information about the notification

notificationContext #

ArgumentsTypeDescription
notification
Notifications
The normalized real-time notification
channels
string[]
List of Subscribers channels to notify
connectionId
string
ClientConnection unique identifier, or null when the notification is sent to every subscriber of the channels

notify:dispatch #

Deprecated since 2.19.3

This event is deprecated and will be removed in the next major version of Kuzzle.

Use core:realtime:notification:dispatch:before instead.

ArgumentsTypeDescription
message
Notifications
The normalized real-time notification

Triggered whenever a real-time notification is about to be sent.


notify:document #

ArgumentsTypeDescription
message
Notifications
The normalized real-time notification

Triggered whenever a real-time document notification is about to be sent.


notify:server #

ArgumentsTypeDescription
message
Notifications
The normalized real-time notification

Triggered whenever a real-time server notification is about to be sent.


notify:user #

ArgumentsTypeDescription
message
Notifications
The normalized real-time notification

Triggered whenever a real-time user notification is about to be sent.


room:new #

This event is deprecated and will be removed in the next major version of Kuzzle.

Use core:realtime:room:create:after instead.

Deprecated since 2.5.0
ArgumentsTypeDescription
room
object
Joined room information

Triggered whenever a subscription creates a new room on this node (NOT triggered if a user subscribes to an existing room).

Pipes cannot listen to this event, only hooks can.

room #

The provided room object has the following properties:

PropertiesTypeDescription
index
string
Index name
collection
string
Collection name
roomId
string
The new room unique identifier

room:remove #

This event is deprecated and will be removed in the next major version of Kuzzle.

It has no replacement: core:realtime:room:remove:before is no longer triggered since Kuzzle 2.11.0.

Deprecated since 2.5.0
ArgumentsTypeDescription
roomId
string
Room unique identifier

Triggered whenever a realtime room is deleted on this node, which happens when its last subscriber leaves it.

Errors thrown by pipes listening to this event are ignored.