Running script in dashboard 2.0

Hi,
in this post I've asked how to run a script in dashboard.
Finally I succeed with the following code:

<div id="weather-widget-container"></div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/postscribe/2.0.8/postscribe.min.js"></script>
<script>
    (function(scope) {
        scope.$watch('msg.payload', function(value) {
            if (value) {
                setTimeout(() => { // Verzögerung einbauen
                postscribe('#weather-widget-container', value);
                }, 100); // 100 Millisekunden warten
            }
        });
    })(scope);
</script>

Now I want to get it running in the new dashboard 2.0.
But here the output of the widget is not visible.
Any help is appreciated.
Kind regards
Juergen

You can read all from here. It is a bit different for dashboard 2.

Thanks!
I've seen this document before I posted my question.
I have put the div-tag in the template section and the script-tag with the dependency to postscribe into the script section. The payload can either be hardcoded into the template or send via msg.payload. But the div and the output of the script does not appear in the group.
Regards Juergen

There is no concept of scope in Dashboard 2.0. The link that @hotNipi has shared shows an explicit example of how to load a third party script and run it's contents