{"action":"closed","issue":{"url":"https://api.github.com/repos/binary-com/binary-live-api/issues/5","labels_url":"https://api.github.com/repos/binary-com/binary-live-api/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/binary-com/binary-live-api/issues/5/comments","events_url":"https://api.github.com/repos/binary-com/binary-live-api/issues/5/events","html_url":"https://github.com/binary-com/binary-live-api/issues/5","id":111544865,"number":5,"title":"More explanation needed on how to use in Browser","user":{"login":"arnabk","id":446864,"avatar_url":"https://avatars.githubusercontent.com/u/446864?v=3","gravatar_id":"","url":"https://api.github.com/users/arnabk","html_url":"https://github.com/arnabk","followers_url":"https://api.github.com/users/arnabk/followers","following_url":"https://api.github.com/users/arnabk/following{/other_user}","gists_url":"https://api.github.com/users/arnabk/gists{/gist_id}","starred_url":"https://api.github.com/users/arnabk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arnabk/subscriptions","organizations_url":"https://api.github.com/users/arnabk/orgs","repos_url":"https://api.github.com/users/arnabk/repos","events_url":"https://api.github.com/users/arnabk/events{/privacy}","received_events_url":"https://api.github.com/users/arnabk/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-15T04:52:21Z","updated_at":"2015-10-15T17:53:06Z","closed_at":"2015-10-15T17:53:06Z","body":"I think more explanation is needed on how to use this library in browser. We have to be very flexible with libraries because libraries are not just meant for us(only), its for everybody who probably don't have much JS knowledge.\r\n\r\nFor example\r\n<code>\r\nUsage in the Browser\r\n\r\nvar api = new LiveApi();\r\napi.authorize('yourtoken');\r\napi.getPortfolio();\r\napi.events.on('portfolio', function(data) {\r\n    // do stuff with portfolio data\r\n});\r\n</code>\r\n\r\nI was assuming that, if I start a new simple HTML, JS project and I do npm install binary-live-api and then include the minified version of the js file from dist folder in my index.html, I can do new LiveApi() and start working with the API without getting into too much of the AMD world. But it failed and I was getting \"Uncaught ReferenceError: LiveApi is not defined\"\r\n"}}