🌙 Your embedded agent matches your site's light or dark mode
The chat you embed on your website or in your app can now follow your design. If your site has a dark mode, your agent no longer opens as a bright white panel on a dark page.
How to use it. Add theme="dark" to show the chat dark, or theme="auto" to match your site's light or dark mode. Without it, the chat stays light. The attribute goes on the <lots-agent> element you already have, for example:
<lots-agent token-url="/lotsagent-token" theme="auto"></lots-agent>
How auto decides. With theme="auto", the chat is dark when your page's <html> has the class dark, light when your page sets a light theme, and otherwise follows the visitor's device setting. When your page switches, the chat switches too, without reloading.
Worth knowing. If you pin the loader by version, the theme setting needs loader 2 (https://embed.lotsagent.com/v1/loader/2.js).
For developers: a pinned loader with an integrity hash. If your security policy asks for an integrity hash on every third-party script, you can load the pinned loader instead of widget.js. It is the same loader, it never changes, and it reads your agent's settings when the page loads, so changes you make to your agent still apply within a minute. A new loader is a new version with a new address, and the version you pinned keeps working until you choose to move. Pages that already use widget.js keep working as they are.
Read more: https://lotsagent.com/help#dark-mode (embed settings: https://lotsagent.com/docs/embed)