When

eventStarts()

Be notified when the event starts.
The callback is not called if the user joins the event after the start.

usage:

When.eventStarts(() => {
 // do something
})
ParamTypeDescription
callbackFunctionA function to be called whenever the event is triggered

eventEnds()

Be notified when the event ends.
The callback is not called if the user joins the event after the end.

usage:

When.eventEnds(() => {
 // do something
})
ParamTypeDescription
callbackFunctionA function to be called whenever the event is triggered

userJoins()

Be notified when someone joins the event.
The callback is not called if the user joins the event after the end.

usage:

When.userJoins((user) => {
 // do something with the 'user' object
})
ParamTypeDescription
callbackFunctionA function to be called whenever a user joins

userLeaves()

Be notified when someone leaves the event.
The callback is not called if the user leaves the event after the end.

usage:

When.userLeaves((user) => {
 // do something with the 'user' object
})
ParamTypeDescription
callbackFunctionA function to be called whenever a user leaves

Did this page help you?