{"action":"opened","issue":{"url":"https://api.github.com/repos/amio-io/amio-sdk-js/issues/44","repository_url":"https://api.github.com/repos/amio-io/amio-sdk-js","labels_url":"https://api.github.com/repos/amio-io/amio-sdk-js/issues/44/labels{/name}","comments_url":"https://api.github.com/repos/amio-io/amio-sdk-js/issues/44/comments","events_url":"https://api.github.com/repos/amio-io/amio-sdk-js/issues/44/events","html_url":"https://github.com/amio-io/amio-sdk-js/issues/44","id":328411829,"node_id":"MDU6SXNzdWUzMjg0MTE4Mjk=","number":44,"title":"Init method for amioApi","user":{"login":"zatziky","id":2794365,"node_id":"MDQ6VXNlcjI3OTQzNjU=","avatar_url":"https://avatars2.githubusercontent.com/u/2794365?v=4","gravatar_id":"","url":"https://api.github.com/users/zatziky","html_url":"https://github.com/zatziky","followers_url":"https://api.github.com/users/zatziky/followers","following_url":"https://api.github.com/users/zatziky/following{/other_user}","gists_url":"https://api.github.com/users/zatziky/gists{/gist_id}","starred_url":"https://api.github.com/users/zatziky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zatziky/subscriptions","organizations_url":"https://api.github.com/users/zatziky/orgs","repos_url":"https://api.github.com/users/zatziky/repos","events_url":"https://api.github.com/users/zatziky/events{/privacy}","received_events_url":"https://api.github.com/users/zatziky/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-06-01T07:33:55Z","updated_at":"2018-06-01T07:33:55Z","closed_at":null,"author_association":"MEMBER","body":"If we would create an initialization method for `AmioApi`, people could then call all their files just `const amioApi = require('amio-sdk-js').amioApi` instead of having to create a file by themselves and then having to reference the file that would have (probably) the same naming.\r\n\r\n**Now:**\r\n```\r\nconst AmioApi = require('amio-sdk-js').AmioApi\r\n\r\nmodule.exports = new AmioApi({\r\n  accessToken: 'xxx'\r\n})\r\nmodule.exports = AmioApi\r\n\r\n// then to use it they would\r\nconst amioApi = require('path/to/amio-api')\r\n\r\namioApi.messages.method()\r\n```\r\n\r\n**After:**\r\n```\r\n// At the program start they would call initializer\r\nrequire('amio-sdk-js').initApi({\r\n  accessToken: 'xxx'\r\n})\r\n\r\n//then anywhere in the code they would call amioApi\r\nconst amioApi = require('amio-sdk-js').amioApi\r\n```"}}
{"actor":{"display_login":"zatziky"}}