Is there a way for a private side-bar app to detect if the current agent UI is in light or dark mode?
Can we use Client.get to detect if the current agent is in dark or light mode?
Also, is there a way for the app to detect when the display changes from dark to light mode, such as through an event?
Regarding your questions, I want to let you know that there isn't a Zendesk API available to get or subscribe to the agent UI light/dark mode. Additionally, there isn't an official event to detect theme changes in the Zendesk UI within apps. However, you can use *prefers-color-scheme* in CSS/JS within your app iframe to detect the OS-level color scheme preference as a fallback.
Lastly, while it is possible to detect Zendesk UI mode changes through DOM or CSS hacks, please keep in mind that this method is unsupported and can be a bit fragile.