Twitter js include

I’m trying to use the twitter for websites js to format twitter links into embedded twitter cards.

actually, it is working fine, but wanted feedback as to if there is a better way.

Currently, I put this in main.html:

<script async src="//platform.twitter.com/widgets.js" charSet="utf-8"></script>

and then in my component render (the content that could have twitter links)

I do this in an autorun:

  twttr.widgets.load(instance.$('.embeds-region'));

It seems to work really well but I really hate putting js links in the head like that. I seem to recall there is another way to inject js in to the head or as a tag in the main body.

Also, if anyone knows of a maybe an npm that I could use that would do the same, maybe that would be better, so i could do a ‘import twttr from twitter’ kind of thing.

Or do I just take the win here? :wink: