Real-time Collaboration (RTC) events
TinyMCE’s Real-time Collaboration (RTC) plugin will be retired and deactivated on December 31, 2023, and is no longer available for purchase. |
RtcClientConnected
When a user joins a real-time collaboration session, the RtcClientConnected
event is fired on existing TinyMCE instances in the session and provides the user information of the newly joined user to other editors in the session.
Event fields: RtcClientConnected
Field | Type | Description |
---|---|---|
|
|
This is the user’s unique ID (the |
|
|
This is a copy of the object returned by |
|
|
This is a unique identifier, generated by the RTC protocol, that can be used to differentiate between the same user connecting multiple times. |
|
|
This will be a number between 1 and 8, corresponding to one of the 8 colors defined in TinyMCE CSS. TinyMCE supports 8 distinct caret colors. If more than 8 clients connect to a session, the numbers will be reused. |
|
|
This is a copy of the |
Example of using the RtcClientConnected event
tinymce.init({
selector: 'textarea', // change this value according to your HTML
plugins: 'rtc',
setup: (editor) => {
editor.on('RtcClientConnected', ({
userId,
userDetails,
clientId,
caretNumber,
clientInfo
}) => {
console.log(`User connected userId:${userId}`);
});
}
})
RtcClientDisconnected
This event is fired when a user leaves the session, and can be used to trigger user interface changes to let other users know that the user has disconnected.
Event fields: RtcClientDisconnected
Field | Type | Description |
---|---|---|
|
|
This is the user’s unique ID (the |
|
|
This is a copy of the object returned by |
|
|
This is a unique identifier, generated by the RTC protocol, that can be used to differentiate between the same user connecting multiple times. |
|
|
This will be a number between 1 and 8, corresponding to one of the 8 colors defined in TinyMCE CSS. TinyMCE supports 8 distinct caret colors. If more than 8 clients connect to a session, the numbers will be reused. |
|
|
This is a copy of the |
Example of using the RtcClientDisconnected event
tinymce.init({
selector: 'textarea', // change this value according to your HTML
plugins: 'rtc',
setup: (editor) => {
editor.on('RtcClientDisconnected', ({
userId,
userDetails,
clientId,
caretNumber,
clientInfo
}) => {
console.log(`User disconnected userId:${userId}`);
});
}
})