What is the difference between
on chat:connected and
chat:departmentStatus callback APIs in the Web Widget API?
on chat:connected only fires once when the page first loads and the web widget makes a socket connection to chat.
on chat:departmentStatus fires an event to the callback any time a department status changes. As a result, this event can fire multiple times.
For more information, see the following page in the Web Widget API docs: Chat API.