# Events

The client instance emits events that you can listen to, in particular you should use the 'connection' event to detect when the clients are connected and ready for communication.

<details>

<summary>connection</summary>

Fired when both peers are connected and ready for communication.

</details>

<details>

<summary>message</summary>

(message: Buffer) => void

\
Fired when a message was sent using the "send" method.

</details>
