Events
Understand the differences between all of the events offered, including: Board UI events, Realtime events, and others
When building a Miro app, it's important to understand which events you can use to trigger certain logic. Each event captures user actions and board changes, enabling your app to respond appropriately. For example, if you want to create an app with drag and drop functionality, you'll need to use the drop event.
Use the table below to understand the main differences between the six different types of events:
- Sent by Miro: Board UI, Collaboration, Session, Storage Collection, and Timer
- Created and sent by the app developer: Realtime
Event type | Board UI | Collaboration | Session | Storage Collection | Timer | Realtime |
---|---|---|---|---|---|---|
Description | Triggered when dragging and dropping an item to a board. | Triggered when a session is started or ended. | Triggered when a user joins, leaves, or responds to a session invitation. | Triggered when the value of a key changes. | Triggered when certain actions are taken on the timer (starting, stopping, resuming, etc.). | Send to all other users and browser instances (tabs), except the current one. |
Is event type predefined? | ✅ | ✅ | ✅ | ✅ | ✅ | ℹ️ Use your own event type. It can be any custom event that you want to generate by yourself. |
Example event type | ('drop') | ('session:started') | ('user-joined') | onValue listener | ('start') | N/A, read more about events.on() |
Recommended uses | For managing actions like moving items via drag-and-drop, activating a panel, or responding to the creation of new items. | For executing specific logic at the start or end of a session. | For implementing logic in response to a user joining or leaving a session. | For executing logic in response to changes in stored values, such as updating the user interface or notifying the user. | For running specific logic in response to actions on a timer, including its start, stop, resume, or extension. | For developing a workshop or collaborative application, to send a custom event to all users present on the board at a given moment, as well as to all active clients or opened tabs. |
Updated 9 months ago
What's next