{"action":"closed","issue":{"url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/4983","repository_url":"https://api.github.com/repos/gatsbyjs/gatsby","labels_url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/4983/labels{/name}","comments_url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/4983/comments","events_url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/4983/events","html_url":"https://github.com/gatsbyjs/gatsby/issues/4983","id":314359886,"number":4983,"title":"Adding third-party js script to html.js","user":{"login":"grantly7","id":6539594,"avatar_url":"https://avatars1.githubusercontent.com/u/6539594?v=4","gravatar_id":"","url":"https://api.github.com/users/grantly7","html_url":"https://github.com/grantly7","followers_url":"https://api.github.com/users/grantly7/followers","following_url":"https://api.github.com/users/grantly7/following{/other_user}","gists_url":"https://api.github.com/users/grantly7/gists{/gist_id}","starred_url":"https://api.github.com/users/grantly7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grantly7/subscriptions","organizations_url":"https://api.github.com/users/grantly7/orgs","repos_url":"https://api.github.com/users/grantly7/repos","events_url":"https://api.github.com/users/grantly7/events{/privacy}","received_events_url":"https://api.github.com/users/grantly7/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-04-14T20:36:06Z","updated_at":"2018-04-14T20:44:48Z","closed_at":"2018-04-14T20:44:48Z","author_association":"CONTRIBUTOR","body":"I'm trying to add a third-party js script to a Gatsby project. The script is for embedding a widget into a particular section on one of my pages. It is not available on npm or anything like that.\r\n\r\n`<script src=\"https://somewidgetcompany.com/widget.min.js\"></script>`\r\n\r\nI'm struggling to figure out the best method for including this resource so that I can access initialize the widget at the appropriate place, as well as set it's attributes:\r\n\r\n`<a class=\"bit-widget-initializer\" data-product-name=\"Some Product\" data-auto-style=\"false\" data-text-color=\"#000\" data-link-color=\"#000\" data-popup-background-color=\"#02004A\" data-background-color=\"\" data-display-limit=\"10\" data-link-text-color=\"#FFF\" data-separator-color=\"#000\"></a>`\r\n\r\nUsually I would be able to easily slap it at the bottom of the index.html and call it a day. Upon digging into it, there doesn't seem to be documentation that provides a clean / easy solution for this. I've looked at the [Customizing  HTML.js](https://www.gatsbyjs.org/docs/custom-html/) page but the example only shows custom inline javascript via dangerouslySetInnerHTML. Seems like a lot of work around for something so simple.\r\n\r\nHow have others been handling this? I'd love to see a couple different approaches if anyone is willing to share. Thanks"}}
{"actor":{"display_login":"KyleAMathews"}}