Embed forum topics with javarscript


I would like to embed some forum topics into our website. The official way is working properly.

However when I try to embed the widget after some user interaction (in my case show widget only after cookie consent of the user) the official script won’t work anymore. The reason is that the script is waiting for the DOMContentLoaded event that is only fired once when the DOM is loaded (before the user interaction).

Do you have any support for this use case?