{"action":"closed","issue":{"url":"https://api.github.com/repos/TwilioDevEd/twiliochat-node/issues/20","repository_url":"https://api.github.com/repos/TwilioDevEd/twiliochat-node","labels_url":"https://api.github.com/repos/TwilioDevEd/twiliochat-node/issues/20/labels{/name}","comments_url":"https://api.github.com/repos/TwilioDevEd/twiliochat-node/issues/20/comments","events_url":"https://api.github.com/repos/TwilioDevEd/twiliochat-node/issues/20/events","html_url":"https://github.com/TwilioDevEd/twiliochat-node/issues/20","id":387434840,"node_id":"MDU6SXNzdWUzODc0MzQ4NDA=","number":20,"title":"deprecated client initialization ","user":{"login":"gatimus","id":8146733,"node_id":"MDQ6VXNlcjgxNDY3MzM=","avatar_url":"https://avatars3.githubusercontent.com/u/8146733?v=4","gravatar_id":"","url":"https://api.github.com/users/gatimus","html_url":"https://github.com/gatimus","followers_url":"https://api.github.com/users/gatimus/followers","following_url":"https://api.github.com/users/gatimus/following{/other_user}","gists_url":"https://api.github.com/users/gatimus/gists{/gist_id}","starred_url":"https://api.github.com/users/gatimus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gatimus/subscriptions","organizations_url":"https://api.github.com/users/gatimus/orgs","repos_url":"https://api.github.com/users/gatimus/repos","events_url":"https://api.github.com/users/gatimus/events{/privacy}","received_events_url":"https://api.github.com/users/gatimus/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"jefflinwood","id":809856,"node_id":"MDQ6VXNlcjgwOTg1Ng==","avatar_url":"https://avatars0.githubusercontent.com/u/809856?v=4","gravatar_id":"","url":"https://api.github.com/users/jefflinwood","html_url":"https://github.com/jefflinwood","followers_url":"https://api.github.com/users/jefflinwood/followers","following_url":"https://api.github.com/users/jefflinwood/following{/other_user}","gists_url":"https://api.github.com/users/jefflinwood/gists{/gist_id}","starred_url":"https://api.github.com/users/jefflinwood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jefflinwood/subscriptions","organizations_url":"https://api.github.com/users/jefflinwood/orgs","repos_url":"https://api.github.com/users/jefflinwood/repos","events_url":"https://api.github.com/users/jefflinwood/events{/privacy}","received_events_url":"https://api.github.com/users/jefflinwood/received_events","type":"User","site_admin":false},"assignees":[{"login":"jefflinwood","id":809856,"node_id":"MDQ6VXNlcjgwOTg1Ng==","avatar_url":"https://avatars0.githubusercontent.com/u/809856?v=4","gravatar_id":"","url":"https://api.github.com/users/jefflinwood","html_url":"https://github.com/jefflinwood","followers_url":"https://api.github.com/users/jefflinwood/followers","following_url":"https://api.github.com/users/jefflinwood/following{/other_user}","gists_url":"https://api.github.com/users/jefflinwood/gists{/gist_id}","starred_url":"https://api.github.com/users/jefflinwood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jefflinwood/subscriptions","organizations_url":"https://api.github.com/users/jefflinwood/orgs","repos_url":"https://api.github.com/users/jefflinwood/repos","events_url":"https://api.github.com/users/jefflinwood/events{/privacy}","received_events_url":"https://api.github.com/users/jefflinwood/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2018-12-04T19:03:57Z","updated_at":"2018-12-07T12:37:57Z","closed_at":"2018-12-07T12:37:57Z","author_association":"NONE","body":"The client is initialized like:\r\n\r\nhttps://github.com/TwilioDevEd/twiliochat-node/blob/b0769341ce50f4d38075ac342e7641d280474a1b/public/js/twiliochat.js#L100-L108\r\n\r\nbut if you try the same thing in TypeScript like so:\r\n\r\n    import { Client } from 'twilio-chat';\r\n    \r\n    const client: Client = new Client(token);\r\n    client.initialize().then(function() {\r\n      // setup\r\n    });\r\n\r\nyou get\r\n\r\n> Constructor of class 'Client' is private and only accessible within the class declaration.\r\n\r\nand \r\n\r\n> Property 'initialize' is private and only accessible within class 'Client'.\r\n\r\nThen in the change log for [v2](https://www.twilio.com/docs/chat/javascript/changelog#programmable-chat-200-december-1-2017) it says:\r\n\r\n> Removed deprecated Client constructor and Client.initialize function, the correct way now is to use static function Client.create.\r\n\r\nand the current docs [here](http://media.twiliocdn.com/sdk/js/chat/releases/3.0.2/docs/index.html) and [here](https://www.twilio.com/docs/chat/initializing-sdk-clients#javascript_1) show:\r\n\r\n    Twilio.Chat.Client.create(token).then(client => {\r\n      // Use client\r\n    });\r\n\r\nThis also seems to be in TwilioDevEd/twiliochat-csharp and I don't know if other tutorial repos\r\n\r\nhttps://github.com/TwilioDevEd/twiliochat-csharp/blob/05cfc1bb7a09cd2870c13fc627cd45b52aa93c44/TwilioChat.Web/Scripts/lib/twiliochat.js#L94-L102\r\n\r\n"}}
{"actor":{"display_login":"jefflinwood"}}