{"_id":"circuit-sdk","_rev":"75-bcb79306288a685844bc2d8030e4ffe9","name":"circuit-sdk","description":"Circuit SDK","dist-tags":{"latest":"1.2.8401","beta":"1.2.8600","testing":"1.2.2801"},"versions":{"1.2.1202":{"name":"circuit-sdk","version":"1.2.1202","description":"Circuit for every node app","main":"circuit-node.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"Unify Inc."},"license":"","dependencies":{"ws":"~0.8.0"},"unpkg":"dist/circuit.min.js","gitHead":"f4e50c5e3c1954831aee7f80f80f7b1aebc3153c","_id":"circuit-sdk@1.2.1202","_shasum":"67afc6ecb030a130ee56fec347dae74848fef832","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.9.5","_npmUser":{"name":"rogeru","email":"roger.urscheler@unify.com"},"dist":{"shasum":"67afc6ecb030a130ee56fec347dae74848fef832","tarball":"https://registry.npmjs.org/circuit-sdk/-/circuit-sdk-1.2.1202.tgz","integrity":"sha512-+wQuGR89TpldG3RaRaY85trxm5O6oK747AO+fJW8Wl/y6q1JQ63kQOfV/7Li/KF8ydTLuZ7EqhlcwUhmbEY/sA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDTirltpf1YqSDkOMisqJRJXtWkzWqf6kMwZMjC2290xAIhALoyQRzixxoEoqxNW6mt3Sk3InJGkwxBq5THN3eXBQbw"}]},"maintainers":[{"name":"rogeru","email":"roger.urscheler@unify.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/circuit-sdk-1.2.1202.tgz_1501299771749_0.46255846647545695"},"directories":{}},"1.2.1402":{"name":"circuit-sdk","version":"1.2.1402","description":"Circuit Node.js SDK","main":"circuit.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"Unify Inc."},"contributors":[{"name":"Roger Urscheler","email":"roger.urscheler@unify.com"},{"name":"Rodrigo Pastro","email":"rodrigo.pastro@unify.com"},{"name":"Johannes Ruetschi","email":"johannes.ruetschi@unify.com"}],"license":"Apache 2.0","dependencies":{"ws":"~0.8.0"},"gitHead":"db5dc85cd4d2002849adbd9882afa757c4987b16","_id":"circuit-sdk@1.2.1402","_shasum":"860013be2b274070e114c75d6e2fc49ad6d9a604","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.9.5","_npmUser":{"name":"rogeru","email":"roger.urscheler@unify.com"},"dist":{"shasum":"860013be2b274070e114c75d6e2fc49ad6d9a604","tarball":"https://registry.npmjs.org/circuit-sdk/-/circuit-sdk-1.2.1402.tgz","integrity":"sha512-9AZsLKLcxYdh5jl0NfSdRKYxjZ1UIKPOd/3GMbGIO4aT73GnXlF1KSXVN64TyMLTlKo30yLLXQcA6Uzh2aAruw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDp7NuGW6zBH9yUBQJR0c84VJn7cR8Nkk2b3AVUaqoNcgIgB4JSktfEmRY8D2EumLGZk4s6cdZxkrxm3E9jf6r+CZ0="}]},"maintainers":[{"name":"rogeru","email":"roger.urscheler@unify.com"},{"name":"rpastro","email":"rodrigo.pastro@unify.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/circuit-sdk-1.2.1402.tgz_1503411300975_0.878540224628523"},"directories":{}},"1.2.1403":{"name":"circuit-sdk","version":"1.2.1403","description":"Circuit Node.js SDK","main":"circuit-node.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"Unify Inc."},"contributors":[{"name":"Roger Urscheler","email":"roger.urscheler@unify.com"},{"name":"Rodrigo Pastro","email":"rodrigo.pastro@unify.com"},{"name":"Johannes Ruetschi","email":"johannes.ruetschi@unify.com"}],"license":"Apache-2.0","homepage":"https://github.com/circuit/circuit-sdk","engines":{"node":">= 4.5.0"},"repository":{"type":"git","url":"git://github.com/circuit/circuit-sdk.git"},"bugs":{"url":"http://github.com/circuit/circuit-sdk/issues"},"keywords":["api","webrtc","circuit","collaboration","sdk"],"unpkg":"dist/circuit.min.js","dependencies":{"ws":"~0.8.0"},"gitHead":"a25234293246d1b14163529cc29db750d494e5ac","_id":"circuit-sdk@1.2.1403","_shasum":"1fd1d1ea4b229026ff7facf5c023e809ab8e0b1e","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.9.5","_npmUser":{"name":"rogeru","email":"roger.urscheler@unify.com"},"dist":{"shasum":"1fd1d1ea4b229026ff7facf5c023e809ab8e0b1e","tarball":"https://registry.npmjs.org/circuit-sdk/-/circuit-sdk-1.2.1403.tgz","integrity":"sha512-dPdHkmlAiLcmklFboQtpNjmYTGpoxaAZADDeG4slAoJnOxF0OgcaWt6llboCTSD0f7mM5E1zVelYakPMkbOlxA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCpP5bz0VwVsVnOJ9+wXxFT2s+b/zXnaEk9GL2Y6LgWaAIhAJ5sqYAf8QYhJEDHpw2GEHvIKCi8QescH5qJw/CzNK6O"}]},"maintainers":[{"name":"rogeru","email":"roger.urscheler@unify.com"},{"name":"rpastro","email":"rodrigo.pastro@unify.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/circuit-sdk-1.2.1403.tgz_1503663460849_0.6380727398209274"},"directories":{}},"1.2.1800":{"name":"circuit-sdk","version":"1.2.1800","description":"Circuit Node.js SDK","main":"circuit-node.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"Unify Inc."},"contributors":[{"name":"Roger Urscheler","email":"roger.urscheler@unify.com"},{"name":"Rodrigo Pastro","email":"rodrigo.pastro@unify.com"},{"name":"Johannes Ruetschi","email":"johannes.ruetschi@unify.com"}],"license":"Apache-2.0","homepage":"https://github.com/circuit/circuit-sdk","engines":{"node":">= 4.5.0"},"repository":{"type":"git","url":"git://github.com/circuit/circuit-sdk.git"},"bugs":{"url":"http://github.com/circuit/circuit-sdk/issues"},"keywords":["api","webrtc","circuit","collaboration","sdk"],"unpkg":"dist/circuit.min.js","dependencies":{"ws":"~0.8.0"},"gitHead":"4fcc34edda269fb155551ab23eb5e81055b7df83","_id":"circuit-sdk@1.2.1800","_shasum":"f9cd4cf7d294957bd4c90dec0b946fce527890fc","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.11.3","_npmUser":{"name":"rogeru","email":"roger.urscheler@unify.com"},"dist":{"shasum":"f9cd4cf7d294957bd4c90dec0b946fce527890fc","tarball":"https://registry.npmjs.org/circuit-sdk/-/circuit-sdk-1.2.1800.tgz","integrity":"sha512-Mr+ibGk5Rg5oLhvQ7r9T2ChR+Psge9FrHce9tOy3F0UJDmihXyrJPmcUIpufHmiI5ozDJ6Zal+nSkpmPn8O5FQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC1+n+Ec/Z1hBxLyJG59ILD07Y2O9CzQL2jbVK68Yli0AIhAOwzaTNzN26j77WkvdXdWQ6BcBRcCkwaIXkOq34HJbRi"}]},"maintainers":[{"name":"rogeru","email":"roger.urscheler@unify.com"},{"name":"rpastro","email":"rodrigo.pastro@unify.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/circuit-sdk-1.2.1800.tgz_1506790561834_0.6582861645147204"},"directories":{}},"1.2.1801":{"name":"circuit-sdk","version":"1.2.1801","description":"Circuit Node.js SDK","main":"circuit-node.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"Unify Inc."},"contributors":[{"name":"Roger Urscheler","email":"roger.urscheler@unify.com"},{"name":"Rodrigo Pastro","email":"rodrigo.pastro@unify.com"},{"name":"Johannes Ruetschi","email":"johannes.ruetschi@unify.com"}],"license":"Apache-2.0","homepage":"https://github.com/circuit/circuit-sdk","engines":{"node":">= 4.5.0"},"repository":{"type":"git","url":"git://github.com/circuit/circuit-sdk.git"},"bugs":{"url":"http://github.com/circuit/circuit-sdk/issues"},"keywords":["api","webrtc","circuit","collaboration","sdk"],"unpkg":"dist/circuit.min.js","dependencies":{"ws":"~0.8.0"},"gitHead":"2c12d6778e037d8558e9adbf38f1380229aaaab3","_id":"circuit-sdk@1.2.1801","_shasum":"92c8e77ac1ec606b03841d72009b78c8c1b39377","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.11.3","_npmUser":{"name":"rogeru","email":"roger.urscheler@unify.com"},"dist":{"shasum":"92c8e77ac1ec606b03841d72009b78c8c1b39377","tarball":"https://registry.npmjs.org/circuit-sdk/-/circuit-sdk-1.2.1801.tgz","integrity":"sha512-2mPE9QdvYT4JkZkAGgPff/g+BDChKUnT/DwYyaZobTC4Raxb9Gx+XvzIFhcnvEzuuIY59SpMRdnMfVTcEs+5zQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDlU0Rgvbymt5GdZ9YJCFFND5cHgjoESXR+k3CReye9pgIgIYgwJB+pw5fOoerGaYT+k4OI+P8Y7xcdaIhK7rhIC9Q="}]},"maintainers":[{"name":"rogeru","email":"roger.urscheler@unify.com"},{"name":"rpastro","email":"rodrigo.pastro@unify.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/circuit-sdk-1.2.1801.tgz_1506949082101_0.7243376637343317"},"directories":{}},"1.2.1900":{"name":"circuit-sdk","version":"1.2.1900","description":"Circuit Node.js SDK","main":"circuit-node.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"Unify Inc."},"contributors":[{"name":"Roger Urscheler","email":"roger.urscheler@unify.com"},{"name":"Rodrigo Pastro","email":"rodrigo.pastro@unify.com"},{"name":"Johannes Ruetschi","email":"johannes.ruetschi@unify.com"}],"license":"Apache-2.0","homepage":"https://github.com/circuit/circuit-sdk","engines":{"node":">= 4.5.0"},"repository":{"type":"git","url":"git://github.com/circuit/circuit-sdk.git"},"bugs":{"url":"http://github.com/circuit/circuit-sdk/issues"},"keywords":["api","webrtc","circuit","collaboration","sdk"],"unpkg":"dist/circuit.min.js","dependencies":{"ws":"~0.8.0"},"gitHead":"ece4daf8398fc5a97629fdd7c52aaee03a13532b","_id":"circuit-sdk@1.2.1900","_shasum":"3664f053d6a339f9aca6f153b3684bf40c94e5ac","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.11.3","_npmUser":{"name":"rogeru","email":"roger.urscheler@unify.com"},"dist":{"shasum":"3664f053d6a339f9aca6f153b3684bf40c94e5ac","tarball":"https://registry.npmjs.org/circuit-sdk/-/circuit-sdk-1.2.1900.tgz","integrity":"sha512-l9U/B3iKx4VoZMn5296TvXkwfMB/w/oJapgql/9HK+50D8Y6BjOk0FfR9U2ZCHpWfWzZRynBdEyK0znVQSNf7A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCWGaKV4Q8Ny5tRmnx9CuTrO2XoR2flJqkkUYYWMFBoNwIgFI2GxvceXgKQeAQBx0t9Ncv35QBu0HQpuUn/fWsDGn0="}]},"maintainers":[{"name":"rogeru","email":"roger.urscheler@unify.com"},{"name":"rpastro","email":"rodrigo.pastro@unify.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/circuit-sdk-1.2.1900.tgz_1507902456657_0.5553991631604731"},"directories":{}},"1.2.2000":{"name":"circuit-sdk","version":"1.2.2000","description":"Circuit Node.js SDK","main":"circuit-node.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"Unify Inc."},"contributors":[{"name":"Roger Urscheler","email":"roger.urscheler@unify.com"},{"name":"Rodrigo Pastro","email":"rodrigo.pastro@unify.com"},{"name":"Johannes Ruetschi","email":"johannes.ruetschi@unify.com"}],"license":"Apache-2.0","homepage":"https://github.com/circuit/circuit-sdk","engines":{"node":">= 4.5.0"},"repository":{"type":"git","url":"git://github.com/circuit/circuit-sdk.git"},"bugs":{"url":"http://github.com/circuit/circuit-sdk/issues"},"keywords":["api","webrtc","circuit","collaboration","sdk"],"unpkg":"dist/circuit.min.js","dependencies":{"ws":"~0.8.0"},"gitHead":"cfa2ff0a8e4ae3addb9a237d2162360124053ef5","_id":"circuit-sdk@1.2.2000","_npmVersion":"5.4.2","_nodeVersion":"6.11.5","_npmUser":{"name":"rogeru","email":"roger.urscheler@unify.com"},"dist":{"integrity":"sha512-DEjKHVegL6Fwfa4lzahGwBvPOuQccVvoHAmIVl93sd6RB7RH8ljCA4fe00A3UTR6a6g6dNXkM0S0gvvicblRnQ==","shasum":"3d1a7be387cf814249eec1f812a93acad119772f","tarball":"https://registry.npmjs.org/circuit-sdk/-/circuit-sdk-1.2.2000.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBuN/6p5WDITr+mNIVbXHT3rQZsbvOXDNRNCvYhrkzrJAiEAg2mdIFCl2ujGEL4JC0rD5NdupnvP7mJRSApK0dSKDBI="}]},"maintainers":[{"name":"rogeru","email":"roger.urscheler@unify.com"},{"name":"rpastro","email":"rodrigo.pastro@unify.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/circuit-sdk-1.2.2000.tgz_1509110980645_0.4666218108031899"},"directories":{}},"1.2.2100":{"name":"circuit-sdk","version":"1.2.2100","description":"Circuit Node.js SDK","main":"circuit-node.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"Unify Inc."},"contributors":[{"name":"Roger Urscheler","email":"roger.urscheler@unify.com"},{"name":"Rodrigo Pastro","email":"rodrigo.pastro@unify.com"},{"name":"Johannes Ruetschi","email":"johannes.ruetschi@unify.com"}],"license":"Apache-2.0","homepage":"https://github.com/circuit/circuit-sdk","engines":{"node":">= 4.5.0"},"repository":{"type":"git","url":"git://github.com/circuit/circuit-sdk.git"},"bugs":{"url":"http://github.com/circuit/circuit-sdk/issues"},"keywords":["api","webrtc","circuit","collaboration","sdk"],"unpkg":"dist/circuit.min.js","dependencies":{"ws":"~0.8.0"},"gitHead":"d1db3f6977fc7a3855101c9058b03a4884af144d","_id":"circuit-sdk@1.2.2100","_npmVersion":"5.4.2","_nodeVersion":"6.11.5","_npmUser":{"name":"rogeru","email":"roger.urscheler@unify.com"},"dist":{"integrity":"sha512-phSJanJSbSQ63hVN9wx7p0oV1IvvTi2M27cEQBKzdDmFV56467R/QFR32j6ptQcUhmmAF8zabIj7v8I7JHEBJg==","shasum":"4975d39680731f8b27f0eaa1076302a60e00e6fd","tarball":"https://registry.npmjs.org/circuit-sdk/-/circuit-sdk-1.2.2100.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB4A/F/Z4TnsV+TwG1ZzumYF5q+7gp3Zno/xrQWeyeisAiEAnfGrk7vmviRS9jbi7J20E8l9JTBNTctWT6fS2Z4nN8A="}]},"maintainers":[{"name":"rogeru","email":"roger.urscheler@unify.com"},{"name":"rpastro","email":"rodrigo.pastro@unify.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/circuit-sdk-1.2.2100.tgz_1510757935295_0.4058903194963932"},"directories":{}},"1.2.2200":{"name":"circuit-sdk","version":"1.2.2200","description":"Circuit Node.js SDK","main":"circuit-node.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"Unify Inc."},"contributors":[{"name":"Roger Urscheler","email":"roger.urscheler@unify.com"},{"name":"Rodrigo Pastro","email":"rodrigo.pastro@unify.com"},{"name":"Johannes Ruetschi","email":"johannes.ruetschi@unify.com"}],"license":"Apache-2.0","homepage":"https://github.com/circuit/circuit-sdk","engines":{"node":">= 4.5.0"},"repository":{"type":"git","url":"git://github.com/circuit/circuit-sdk.git"},"bugs":{"url":"http://github.com/circuit/circuit-sdk/issues"},"keywords":["api","webrtc","circuit","collaboration","sdk"],"unpkg":"dist/circuit.min.js","dependencies":{"ws":"~0.8.0"},"gitHead":"681e7e689e9a6349c16646f3e7c201f584089384","_id":"circuit-sdk@1.2.2200","_npmVersion":"5.4.2","_nodeVersion":"6.11.5","_npmUser":{"name":"rogeru","email":"roger.urscheler@unify.com"},"dist":{"integrity":"sha512-w1f5mXgAiPihlJ49xopqDjGZwFXfmmVEeFvEZVP+A+vQh74mqklWsZV/js426xc8B8mqKTTNwEgvI9PyLyX7Xw==","shasum":"54de9dba2959ea44416a7dc6405f02649a391371","tarball":"https://registry.npmjs.org/circuit-sdk/-/circuit-sdk-1.2.2200.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF+hbXfi64YkVCVSNQhL3yj9WEuy3QDuXfKHSOU2vYmmAiEAv18AZCQWGlxLEZrezS+WN0EceoKAXdO08/uM3uSUAPw="}]},"maintainers":[{"name":"rogeru","email":"roger.urscheler@unify.com"},{"name":"rpastro","email":"rodrigo.pastro@unify.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/circuit-sdk-1.2.2200.tgz_1511915657583_0.2448727497830987"},"directories":{}},"1.2.2300":{"name":"circuit-sdk","version":"1.2.2300","description":"Circuit Node.js SDK","main":"circuit-node.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"Unify Inc."},"contributors":[{"name":"Roger Urscheler","email":"roger.urscheler@unify.com"},{"name":"Rodrigo Pastro","email":"rodrigo.pastro@unify.com"},{"name":"Johannes Ruetschi","email":"johannes.ruetschi@unify.com"}],"license":"Apache-2.0","homepage":"https://github.com/circuit/circuit-sdk","engines":{"node":">= 4.5.0"},"repository":{"type":"git","url":"git://github.com/circuit/circuit-sdk.git"},"bugs":{"url":"http://github.com/circuit/circuit-sdk/issues"},"keywords":["api","webrtc","circuit","collaboration","sdk"],"unpkg":"dist/circuit.min.js","dependencies":{"ws":"~0.8.0"},"gitHead":"681e7e689e9a6349c16646f3e7c201f584089384","_id":"circuit-sdk@1.2.2300","_npmVersion":"5.4.2","_nodeVersion":"8.8.1","_npmUser":{"name":"rogeru","email":"roger.urscheler@unify.com"},"dist":{"integrity":"sha512-vsuDQMAbgkScHFNJwIBv4ddy2Kicins+AV/i2lch0DPUgJwX6lTtnyK08izYERfrDQDoqQ9M1LFauK9+gQVf7g==","shasum":"1ebe5e789edc235fef8443e501075eed1692111e","tarball":"https://registry.npmjs.org/circuit-sdk/-/circuit-sdk-1.2.2300.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCqnTBec4cO0exz4UzKGt6sKHg30qlw7GK2kU1/va5ezgIhAOU8XbwHHqLdP+ikdv+OrNSO7sWTcTu6SQoL6SekaI8g"}]},"maintainers":[{"name":"rogeru","email":"roger.urscheler@unify.com"},{"name":"rpastro","email":"rodrigo.pastro@unify.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/circuit-sdk-1.2.2300.tgz_1513298298125_0.48029936756938696"},"directories":{}},"1.2.2400":{"name":"circuit-sdk","version":"1.2.2400","description":"Circuit Node.js SDK","main":"circuit-node.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"Unify Inc."},"contributors":[{"name":"Roger Urscheler","email":"roger.urscheler@unify.com"},{"name":"Rodrigo Pastro","email":"rodrigo.pastro@unify.com"},{"name":"Johannes Ruetschi","email":"johannes.ruetschi@unify.com"}],"license":"Apache-2.0","homepage":"https://github.com/circuit/circuit-sdk","engines":{"node":">= 4.5.0"},"repository":{"type":"git","url":"git://github.com/circuit/circuit-sdk.git"},"bugs":{"url":"http://github.com/circuit/circuit-sdk/issues"},"keywords":["api","webrtc","circuit","collaboration","sdk"],"unpkg":"dist/circuit.min.js","dependencies":{"ws":"~0.8.0"},"gitHead":"a2294c003a7339a7c2cb6e22e91b5faf2275addc","_id":"circuit-sdk@1.2.2400","_npmVersion":"5.4.2","_nodeVersion":"8.8.1","_npmUser":{"name":"rogeru","email":"roger.urscheler@unify.com"},"dist":{"integrity":"sha512-AiYBVPNYuh2lRQRZNc4INzxoleFF+BqsO7flxmdf9ELkE1jyRCgFOA7bdC+7MGIpsmRK/Dyg7a8Lr60WO8LobQ==","shasum":"58d5793102466642b13d51a2488400a9200231a9","tarball":"https://registry.npmjs.org/circuit-sdk/-/circuit-sdk-1.2.2400.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDfr9NCRS1T2Moia5E4h4e1Wj4C65TKA8yNhB3LIlDQggIhAM6Bh4TGHSTCs5frOda5s0baVMJw1j70SBTI1hECovZc"}]},"maintainers":[{"name":"rogeru","email":"roger.urscheler@unify.com"},{"name":"rpastro","email":"rodrigo.pastro@unify.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/circuit-sdk-1.2.2400.tgz_1514041536505_0.6835402795113623"},"directories":{}},"1.2.2600":{"name":"circuit-sdk","version":"1.2.2600","description":"Circuit Node.js SDK","main":"circuit-node.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"Unify Inc."},"contributors":[{"name":"Roger Urscheler","email":"roger.urscheler@unify.com"},{"name":"Rodrigo Pastro","email":"rodrigo.pastro@unify.com"},{"name":"Johannes Ruetschi","email":"johannes.ruetschi@unify.com"}],"license":"Apache-2.0","homepage":"https://github.com/circuit/circuit-sdk","engines":{"node":">= 4.5.0"},"repository":{"type":"git","url":"git://github.com/circuit/circuit-sdk.git"},"bugs":{"url":"http://github.com/circuit/circuit-sdk/issues"},"keywords":["api","webrtc","circuit","collaboration","sdk"],"browser":{"electron":false},"unpkg":"dist/circuit.min.js","dependencies":{"ws":"~3.3.3"},"gitHead":"a2294c003a7339a7c2cb6e22e91b5faf2275addc","_id":"circuit-sdk@1.2.2600","_shasum":"453cd0fcc9948772230f64cc1dcc061cf6028b82","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.11.5","_npmUser":{"name":"rogeru","email":"roger.urscheler@unify.com"},"dist":{"shasum":"453cd0fcc9948772230f64cc1dcc061cf6028b82","tarball":"https://registry.npmjs.org/circuit-sdk/-/circuit-sdk-1.2.2600.tgz","integrity":"sha512-o+ZKPFQG9ZO82MpWSxY0wXBaEmpTrrMhyslVwkr5qTg1oJrZhHqDfvyf+GRayBnsHgXJTSnhy1J5Xo3tbbcPRg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDipwdnQ38f/wX5lZACafLnX3xScg+E1vVtrgXgnnlMIwIgeYO2MmBxH0rI2kki3JC2eCw+B2A0M747jyCePCatZLE="}]},"maintainers":[{"name":"rogeru","email":"roger.urscheler@unify.com"},{"name":"rpastro","email":"rodrigo.pastro@unify.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/circuit-sdk-1.2.2600.tgz_1516471901203_0.13870660099200904"},"directories":{}},"1.2.2401":{"name":"circuit-sdk","version":"1.2.2401","description":"Circuit Node.js SDK","main":"circuit-node.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"Unify Inc."},"contributors":[{"name":"Roger Urscheler","email":"roger.urscheler@unify.com"},{"name":"Rodrigo Pastro","email":"rodrigo.pastro@unify.com"},{"name":"Johannes Ruetschi","email":"johannes.ruetschi@unify.com"}],"license":"Apache-2.0","homepage":"https://github.com/circuit/circuit-sdk","engines":{"node":">= 4.5.0"},"repository":{"type":"git","url":"git://github.com/circuit/circuit-sdk.git"},"bugs":{"url":"http://github.com/circuit/circuit-sdk/issues"},"keywords":["api","webrtc","circuit","collaboration","sdk"],"unpkg":"dist/circuit.min.js","dependencies":{"ws":"~0.8.0"},"gitHead":"747e058b0840f1a5fe856252ff93dcd6e1ecbb5a","_id":"circuit-sdk@1.2.2401","_shasum":"3571f8cd7f765174e8b54ac38ff9cb820ac0eac9","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.11.5","_npmUser":{"name":"rogeru","email":"roger.urscheler@unify.com"},"dist":{"shasum":"3571f8cd7f765174e8b54ac38ff9cb820ac0eac9","tarball":"https://registry.npmjs.org/circuit-sdk/-/circuit-sdk-1.2.2401.tgz","integrity":"sha512-QZ1S+6hZChmK1/g6UMD4Pl5Bj7iurhTriaacqSM9d8tqgYkt6REsUt8Hg+z4wOaMvd6qOxJwzgYzDcQnRKDaTA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCTQ+99SmOr33nLukxkEB3tH3xDkkDSWmvfIxsLBAQtRgIhANpNfKGq4krE3D6EFSwY3AbwOrmqRR4A3QR6NBC4CiCC"}]},"maintainers":[{"name":"rogeru","email":"roger.urscheler@unify.com"},{"name":"rpastro","email":"rodrigo.pastro@unify.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/circuit-sdk-1.2.2401.tgz_1516473248424_0.22486719558946788"},"directories":{}},"1.2.2402":{"name":"circuit-sdk","version":"1.2.2402","description":"Circuit Node.js SDK","main":"circuit-node.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"Unify Inc."},"contributors":[{"name":"Roger Urscheler","email":"roger.urscheler@unify.com"},{"name":"Rodrigo Pastro","email":"rodrigo.pastro@unify.com"},{"name":"Johannes Ruetschi","email":"johannes.ruetschi@unify.com"}],"license":"Apache-2.0","homepage":"https://github.com/circuit/circuit-sdk","engines":{"node":">= 4.5.0"},"repository":{"type":"git","url":"git://github.com/circuit/circuit-sdk.git"},"bugs":{"url":"http://github.com/circuit/circuit-sdk/issues"},"keywords":["api","webrtc","circuit","collaboration","sdk"],"unpkg":"dist/circuit.min.js","dependencies":{"ws":"~0.8.0"},"gitHead":"fdc4bf13898ac0644a084a913988cf170ddb47c6","_id":"circuit-sdk@1.2.2402","_shasum":"8b9e7fb0fcc4989d9fce912519b919cc00423fb1","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.11.5","_npmUser":{"name":"rogeru","email":"roger.urscheler@unify.com"},"dist":{"shasum":"8b9e7fb0fcc4989d9fce912519b919cc00423fb1","tarball":"https://registry.npmjs.org/circuit-sdk/-/circuit-sdk-1.2.2402.tgz","integrity":"sha512-npC4yvrpaaSKry02OIZLyoQt0j760nXMDs7TeEPfRlo6cXDyk4NyfriG8H8ghPmW75jpDaxpfVPmiALETTXcBA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEYVEaveb+vw6S1GABsRxdsd4uuflc9Ej1pwRqA8PpQaAiAX7CXGF4ykSILWp1FacnW3HeVvI3HacLzvyMzO0Frh3g=="}]},"maintainers":[{"name":"rogeru","email":"roger.urscheler@unify.com"},{"name":"rpastro","email":"rodrigo.pastro@unify.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/circuit-sdk-1.2.2402.tgz_1516493053794_0.7323778227437288"},"directories":{}},"1.2.2800":{"name":"circuit-sdk","version":"1.2.2800","description":"Circuit SDK","main":"circuit.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"Unify Inc."},"contributors":[{"name":"Roger Urscheler","email":"roger.urscheler@unify.com"},{"name":"Rodrigo Pastro","email":"rodrigo.pastro@unify.com"},{"name":"Johannes Ruetschi","email":"johannes.ruetschi@unify.com"}],"license":"Apache-2.0","homepage":"https://github.com/circuit/circuit-sdk","engines":{"node":">= 4.5.0"},"repository":{"type":"git","url":"git://github.com/circuit/circuit-sdk.git"},"bugs":{"url":"http://github.com/circuit/circuit-sdk/issues"},"keywords":["api","webrtc","circuit","collaboration","sdk"],"browser":{"electron":false},"unpkg":"circuit.min.js","dependencies":{"ws":"~3.3.3"},"gitHead":"3db41a463ee164abd13a1d7b828375a1d998c8c9","_id":"circuit-sdk@1.2.2800","_npmVersion":"5.3.0","_nodeVersion":"4.8.5","_npmUser":{"name":"rogeru","email":"roger.urscheler@unify.com"},"dist":{"integrity":"sha512-7P2GglI4yrEPcyuovGSbu3VIGDb5LKKwII20D/UTVrvJAzKe0IOlIKOwOtV5N8Vum2ulC94VQHpLroVGQM8VSg==","shasum":"c4977472b3953ca9b54333bcbe28e662b97a5d22","tarball":"https://registry.npmjs.org/circuit-sdk/-/circuit-sdk-1.2.2800.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDftHbPgB/fCiJw1j7Ui0KRG/3aTAeJshLDDKrYxoH9YQIhAKjKXRDv1WxG85TEoPXUyG+1GVuW3t0kbaghelNgibxZ"}]},"maintainers":[{"name":"rogeru","email":"roger.urscheler@unify.com"},{"name":"rpastro","email":"rodrigo.pastro@unify.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/circuit-sdk-1.2.2800.tgz_1517524327554_0.029054425191134214"},"directories":{}},"1.2.2700":{"name":"circuit-sdk","version":"1.2.2700","description":"Circuit Node.js SDK","main":"circuit-node.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"Unify Inc."},"contributors":[{"name":"Roger Urscheler","email":"roger.urscheler@unify.com"},{"name":"Rodrigo Pastro","email":"rodrigo.pastro@unify.com"},{"name":"Johannes Ruetschi","email":"johannes.ruetschi@unify.com"}],"license":"Apache-2.0","homepage":"https://github.com/circuit/circuit-sdk","engines":{"node":">= 4.5.0"},"repository":{"type":"git","url":"git://github.com/circuit/circuit-sdk.git"},"bugs":{"url":"http://github.com/circuit/circuit-sdk/issues"},"keywords":["api","webrtc","circuit","collaboration","sdk"],"browser":{"electron":false},"unpkg":"dist/circuit.min.js","dependencies":{"ws":"~3.3.3"},"readme":"Circuit JavaScript and Node.js SDK\n==================================\n\n[![GitHub release](https://img.shields.io/github/release/circuit/circuit-sdk.svg)](https://github.com/circuit/circuit-sdk)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n\n### Prerequisites\n* Developer account on circuitsandbox.net. Get it for free at [developer registration](https://www.circuit.com/web/developers/registration).\n* OAuth 2.0 `client_id` and optionally `client_secret`. Get if for free at [circuit.github.com/oauth](https://circuit.github.com/oauth).\n\n\n### API Reference\nhttps://circuitsandbox.net/sdk/ with most APIs described in the [Client](https://circuitsandbox.net/sdk/classes/Client.html) class.\n\nMore info at [circuit.github.io](https://circuit.github.io/).\n\n### Usage\n\n#### JavaScript\nAdd the the line below to the HTML file of you app. This will include the latest version of Circuit SDK and make the `Circuit` object available.\n```html\n<script type=\"text/javascript\" src=\"https://unpkg.com/circuit-sdk\"></script>\n```\n\n#### Node.js\n```bash\nnpm install --save circuit-sdk\n```\n\n### Application Types\nThe majority of apps fall in one of the three types below. Each type uses a different OAuth 2.0 Grant.\n\n1. **Client-side web applications** use the JavaScript SDK with the [OAuth 2.0 Implicit Grant](https://circuit.github.io/oauth.html#implicit).\n   ```javascript\n   // No client_secret needed for Implicit Grant. SDK will obtain access token.\n   let client = new Circuit.Client({\n     client_id: '<your client_id>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon()\n     .then(user => console.log('Logged on as ' + user.displayName))\n   ```\n\n2. **Server-side web applications** use the JavaScript SDK (or [REST API](https://circuitsandbox.net/rest/v2/swagger/ui/index.html)) on the client, but handle the authentication flow on the server using the [OAuth 2.0 Authorization Code Grant](https://circuit.github.io/oauth.html#authorization_code). The access token is obtained on the server and then passed to the client to use in the Circuit JavaScript SDK. These apps may also use the Node.js SDK on the server side to act on behalf of the user.<br>\nExample apps: [node-linkify](https://github.com/circuit/node-linkify) or [circuit-google-assistant](https://github.com/circuit/circuit-google-assistant)\n   ```javascript\n   // access token is obtained and managed by server-side app\n   let client = new Circuit.Client({\n     client_id: '<your client_id>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon({accessToken: '<access_token>'})\n     .then(user => console.log('Logged on as ' + user.displayName))\n   ```\n\n3. **Bots** use the [Node.js SDK](https://www.npmjs.com/package/circuit-sdk) or the [REST API](https://circuitsandbox.net/rest/v2/swagger/ui/index.html) and use the [OAuth 2.0 Client Credentials Grant](https://circuit.github.io/oauth.html#client_credentials). Bots are a special type of user; they don't login on behalf of a regular user, hence no OAuth popup asking for a user`s credentials and permissions.<br>\nExample bots: [xlator-bot](https://github.com/circuit/xlator-bot) or [node-sdk-example](https://github.com/circuit/node-sdk-example)<br>\nExample electron bots: [webrtc-bot-example](https://github.com/circuit/webrtc-bot-example) or [live-cam-bot](https://github.com/circuit/live-cam-bot)\n   ```javascript\n   const Circuit = require('circuit-sdk');\n   let client = new Circuit.Client({\n     client_id: '<client_id>',\n     client_secret: '<client_secret>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon()\n     .then(user => console.log('Logged on as bot: ' + user.emailAddress))\n   ```\n\n\n\n### Examples\n\n> JavaScript examples are located at [/examples/js](/examples/js) with more examples on [jsbin](https://circuit.github.io/jssdk.html#jsbin).\n\n> Node.js example apps are on [github](https://github.com/circuit). A summary is listed [here](https://circuit.github.io/nodejs.html). Runkit allows playing with Node.js modules live, similar to jsbin or jsfiddle on the client. [Try it on runkit](https://runkit.com/rogeru/circuit-sdk)\n\nHere are some snippets to get you started.\n\n#### Create Group Conversation and send text message\nLogon as bot, create a group conversation with two users and send a text message.\n```javascript\nclient.logon()\n  .then(user => console.log(`Logged on as ${user.displayName}`, user))\n  .then(() => client.getUsersByEmail(['kim.jackson@mailinator.com', 'maeva.barnaby@mailinator.com']))\n  .then(users => users.map(user => user.userId))\n  .then(userIds => client.createGroupConversation(userIds, 'runkit example'))\n  .then(conv => client.addTextItem(conv.convId, 'I am test bot. What can I do for you?'))\n  .then(client.logout)\n  .catch(console.error)\n```\n\n#### Get Conversations\nGet 10 newest conversations of logged on user.\n```javascript\nclient.getConversations({numberOfConversations: 10})\n  .then(conversations => console.log(`Retrieved ${conversations.length} conversations`))\n```\n\n#### Video call with another Circuit user\nStart a video call with another user. Create conversation if not yet existing.\n> Only applicable to JavaScript SDK and only on browsers supporting WebRTC\n```javascript\nclient.makeCall('bob@company.com', {audio: true, video: true}, true)\n  .then(call => console.log('New call: ', call));\n```\n\n#### Listen for events\n```javascript\n// Register new items added to the feed of this user. E.g. incoming text message\nclient.addEventListener('itemAdded', item =>\n  console.log('itemAdded event received:', item));\n\n// Register for connection state changes\nclient.addEventListener('connectionStateChanged', evt => {\n  console.log(`New state is ${evt.state}`);\n});\n\n// Register and log all events\nCircuit.supportedEvents.forEach(e => client.addEventListener(e, console.log));\n```\n\n#### Create an injector\nInjectors allow extending the conversation, item and user objects within the SDK.\nIn this example a new attribute `teaser` is created on the item object. This `teaser` will be added to item objects in any reponse or event from the SDK.\n```javascript\nCircuit.Injectors.itemInjector = function (item) {\n  if (item.type === Circuit.Enums.ConversationItemType.TEXT) {\n    // Create item.teaser attribute with replacing br and hr tags with a space\n    item.teaser = item.text.content.replace(/<(br[\\/]?|\\/li|hr[\\/]?)>/gi, ' ');\n  } else {\n    item.teaser = item.type;\n  }\n};\n```\n\n### Supported Browsers\nChrome and Firefox are officially supported.\n\n### Help us improve the SDK\nHelp us improve the SDK or examples by sending us a pull-request or opening a [GitHub Issue](https://github.com/circuit/circuit-sdk/issues/new).\n","readmeFilename":"README.md","gitHead":"bc189a506ad8f973a3430f32722be47c37b7ff44","_id":"circuit-sdk@1.2.2700","_npmVersion":"5.3.0","_nodeVersion":"6.11.5","_npmUser":{"name":"rogeru","email":"roger.urscheler@unify.com"},"dist":{"integrity":"sha512-1I2Qui3FFD9Ya3EJ1iOFQUMb2L8mNEF74tblblGTjD+2B9U50MhEFMH1k+hdYzGkOx2so3RMN3UIlx6E4OXn+w==","shasum":"a2c908dc65f773d15a32e786df28ce498128f848","tarball":"https://registry.npmjs.org/circuit-sdk/-/circuit-sdk-1.2.2700.tgz","fileCount":18,"unpackedSize":5525123,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDVBSkfUx/eDY1n6o+MCXU7cmOF5vsHiKABR7nobUBBGQIgTEZQyeeBc61jJip76hsMej65ea8bP/LDkDtWqLXdyxQ="}]},"maintainers":[{"name":"rogeru","email":"roger.urscheler@unify.com"},{"name":"rpastro","email":"rodrigo.pastro@unify.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/circuit-sdk_1.2.2700_1518019430417_0.4680263911014313"},"_hasShrinkwrap":false},"1.2.2801":{"name":"circuit-sdk","version":"1.2.2801","description":"Circuit Node.js SDK","main":"circuit.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"Unify Inc."},"contributors":[{"name":"Roger Urscheler","email":"roger.urscheler@unify.com"},{"name":"Rodrigo Pastro","email":"rodrigo.pastro@unify.com"},{"name":"Johannes Ruetschi","email":"johannes.ruetschi@unify.com"}],"license":"Apache-2.0","homepage":"https://github.com/circuit/circuit-sdk","engines":{"node":">= 4.5.0"},"repository":{"type":"git","url":"git://github.com/circuit/circuit-sdk.git"},"bugs":{"url":"http://github.com/circuit/circuit-sdk/issues"},"keywords":["api","webrtc","circuit","collaboration","sdk"],"browser":{"electron":false},"unpkg":"dist/circuit.min.js","dependencies":{"ws":"~3.3.3"},"readme":"Circuit JavaScript and Node.js SDK\n==================================\n\n[![GitHub release](https://img.shields.io/github/release/circuit/circuit-sdk.svg)](https://github.com/circuit/circuit-sdk)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n\n### Prerequisites\n* Developer account on circuitsandbox.net. Get it for free at [developer registration](https://www.circuit.com/web/developers/registration).\n* OAuth 2.0 `client_id` and optionally `client_secret`. Get if for free at [circuit.github.com/oauth](https://circuit.github.com/oauth).\n\n\n### API Reference\nhttps://circuitsandbox.net/sdk/ with most APIs described in the [Client](https://circuitsandbox.net/sdk/classes/Client.html) class.\n\nMore info at [circuit.github.io](https://circuit.github.io/).\n\n### Usage\n\n#### JavaScript\nAdd the the line below to the HTML file of you app. This will include the latest version of Circuit SDK and make the `Circuit` object available.\n```html\n<script type=\"text/javascript\" src=\"https://unpkg.com/circuit-sdk\"></script>\n```\n\n#### Node.js\n```bash\nnpm install --save circuit-sdk\n```\n\n### Application Types\nThe majority of apps fall in one of the three types below. Each type uses a different OAuth 2.0 Grant.\n\n1. **Client-side web applications** use the JavaScript SDK with the [OAuth 2.0 Implicit Grant](https://circuit.github.io/oauth.html#implicit).\n   ```javascript\n   // No client_secret needed for Implicit Grant. SDK will obtain access token.\n   let client = new Circuit.Client({\n     client_id: '<your client_id>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon()\n     .then(user => console.log('Logged on as ' + user.displayName))\n   ```\n\n2. **Server-side web applications** use the JavaScript SDK (or [REST API](https://circuitsandbox.net/rest/v2/swagger/ui/index.html)) on the client, but handle the authentication flow on the server using the [OAuth 2.0 Authorization Code Grant](https://circuit.github.io/oauth.html#authorization_code). The access token is obtained on the server and then passed to the client to use in the Circuit JavaScript SDK. These apps may also use the Node.js SDK on the server side to act on behalf of the user.<br>\nExample apps: [node-linkify](https://github.com/circuit/node-linkify) or [circuit-google-assistant](https://github.com/circuit/circuit-google-assistant)\n   ```javascript\n   // access token is obtained and managed by server-side app\n   let client = new Circuit.Client({\n     client_id: '<your client_id>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon({accessToken: '<access_token>'})\n     .then(user => console.log('Logged on as ' + user.displayName))\n   ```\n\n3. **Bots** use the [Node.js SDK](https://www.npmjs.com/package/circuit-sdk) or the [REST API](https://circuitsandbox.net/rest/v2/swagger/ui/index.html) and use the [OAuth 2.0 Client Credentials Grant](https://circuit.github.io/oauth.html#client_credentials). Bots are a special type of user; they don't login on behalf of a regular user, hence no OAuth popup asking for a user`s credentials and permissions.<br>\nExample bots: [xlator-bot](https://github.com/circuit/xlator-bot) or [node-sdk-example](https://github.com/circuit/node-sdk-example)<br>\nExample electron bots: [webrtc-bot-example](https://github.com/circuit/webrtc-bot-example) or [live-cam-bot](https://github.com/circuit/live-cam-bot)\n   ```javascript\n   const Circuit = require('circuit-sdk');\n   let client = new Circuit.Client({\n     client_id: '<client_id>',\n     client_secret: '<client_secret>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon()\n     .then(user => console.log('Logged on as bot: ' + user.emailAddress))\n   ```\n\n\n\n### Examples\n\n> JavaScript examples are located at [/examples/js](/examples/js) with more examples on [jsbin](https://circuit.github.io/jssdk.html#jsbin).\n\n> Node.js example apps are on [github](https://github.com/circuit). A summary is listed [here](https://circuit.github.io/nodejs.html). Runkit allows playing with Node.js modules live, similar to jsbin or jsfiddle on the client. [Try it on runkit](https://runkit.com/rogeru/circuit-sdk)\n\nHere are some snippets to get you started.\n\n#### Create Group Conversation and send text message\nLogon as bot, create a group conversation with two users and send a text message.\n```javascript\nclient.logon()\n  .then(user => console.log(`Logged on as ${user.displayName}`, user))\n  .then(() => client.getUsersByEmail(['kim.jackson@mailinator.com', 'maeva.barnaby@mailinator.com']))\n  .then(users => users.map(user => user.userId))\n  .then(userIds => client.createGroupConversation(userIds, 'runkit example'))\n  .then(conv => client.addTextItem(conv.convId, 'I am test bot. What can I do for you?'))\n  .then(client.logout)\n  .catch(console.error)\n```\n\n#### Get Conversations\nGet 10 newest conversations of logged on user.\n```javascript\nclient.getConversations({numberOfConversations: 10})\n  .then(conversations => console.log(`Retrieved ${conversations.length} conversations`))\n```\n\n#### Video call with another Circuit user\nStart a video call with another user. Create conversation if not yet existing.\n> Only applicable to JavaScript SDK and only on browsers supporting WebRTC\n```javascript\nclient.makeCall('bob@company.com', {audio: true, video: true}, true)\n  .then(call => console.log('New call: ', call));\n```\n\n#### Listen for events\n```javascript\n// Register new items added to the feed of this user. E.g. incoming text message\nclient.addEventListener('itemAdded', item =>\n  console.log('itemAdded event received:', item));\n\n// Register for connection state changes\nclient.addEventListener('connectionStateChanged', evt => {\n  console.log(`New state is ${evt.state}`);\n});\n\n// Register and log all events\nCircuit.supportedEvents.forEach(e => client.addEventListener(e, console.log));\n```\n\n#### Create an injector\nInjectors allow extending the conversation, item and user objects within the SDK.\nIn this example a new attribute `teaser` is created on the item object. This `teaser` will be added to item objects in any reponse or event from the SDK.\n```javascript\nCircuit.Injectors.itemInjector = function (item) {\n  if (item.type === Circuit.Enums.ConversationItemType.TEXT) {\n    // Create item.teaser attribute with replacing br and hr tags with a space\n    item.teaser = item.text.content.replace(/<(br[\\/]?|\\/li|hr[\\/]?)>/gi, ' ');\n  } else {\n    item.teaser = item.type;\n  }\n};\n```\n\n### Supported Browsers\nChrome and Firefox are officially supported.\n\n### Help us improve the SDK\nHelp us improve the SDK or examples by sending us a pull-request or opening a [GitHub Issue](https://github.com/circuit/circuit-sdk/issues/new).\n","readmeFilename":"README.md","gitHead":"bc189a506ad8f973a3430f32722be47c37b7ff44","_id":"circuit-sdk@1.2.2801","_npmVersion":"5.3.0","_nodeVersion":"6.11.5","_npmUser":{"name":"rogeru","email":"roger.urscheler@unify.com"},"dist":{"integrity":"sha512-3uuvrwPgDJ/QK0kHGJGDAYbnw6O7M4lupjhL59iKFUK+X12ONAQSXpBBAJbQWuvPOu622l/b3p47Pd2cb90Qew==","shasum":"fd3cc31c268bfe1c06e616e310f6470db645f305","tarball":"https://registry.npmjs.org/circuit-sdk/-/circuit-sdk-1.2.2801.tgz","fileCount":18,"unpackedSize":5592084,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH6HsPsu9CXTtqlwcUUqaO5P9oFun7XzMnsPY7aLdPGwAiEA0/nOQOpYIqTEJx9UjAXE5pgBBhKDgnBd40NA6CLC4HY="}]},"maintainers":[{"name":"rogeru","email":"roger.urscheler@unify.com"},{"name":"rpastro","email":"rodrigo.pastro@unify.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/circuit-sdk_1.2.2801_1518615028589_0.5768464836317364"},"_hasShrinkwrap":false},"1.2.2802":{"name":"circuit-sdk","version":"1.2.2802","description":"Circuit Node.js SDK","main":"circuit-node.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"Unify Inc."},"contributors":[{"name":"Roger Urscheler","email":"roger.urscheler@unify.com"},{"name":"Rodrigo Pastro","email":"rodrigo.pastro@unify.com"},{"name":"Johannes Ruetschi","email":"johannes.ruetschi@unify.com"}],"license":"Apache-2.0","homepage":"https://github.com/circuit/circuit-sdk","engines":{"node":">= 4.5.0"},"repository":{"type":"git","url":"git://github.com/circuit/circuit-sdk.git"},"bugs":{"url":"http://github.com/circuit/circuit-sdk/issues"},"keywords":["api","webrtc","circuit","collaboration","sdk"],"browser":{"electron":false},"unpkg":"dist/circuit.min.js","dependencies":{"ws":"~3.3.3"},"readme":"Circuit JavaScript and Node.js SDK\n==================================\n\n[![GitHub release](https://img.shields.io/github/release/circuit/circuit-sdk.svg)](https://github.com/circuit/circuit-sdk)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n\n### Prerequisites\n* Developer account on circuitsandbox.net. Get it for free at [developer registration](https://www.circuit.com/web/developers/registration).\n* OAuth 2.0 `client_id` and optionally `client_secret`. Get if for free at [circuit.github.com/oauth](https://circuit.github.com/oauth).\n\n\n### API Reference\nhttps://circuitsandbox.net/sdk/ with most APIs described in the [Client](https://circuitsandbox.net/sdk/classes/Client.html) class.\n\nMore info at [circuit.github.io](https://circuit.github.io/).\n\n### Usage\n\n#### JavaScript\nAdd the the line below to the HTML file of you app. This will include the latest version of Circuit SDK and make the `Circuit` object available.\n```html\n<script type=\"text/javascript\" src=\"https://unpkg.com/circuit-sdk\"></script>\n```\n\n#### Node.js\n```bash\nnpm install --save circuit-sdk\n```\n\n### Application Types\nThe majority of apps fall in one of the three types below. Each type uses a different OAuth 2.0 Grant.\n\n1. **Client-side web applications** use the JavaScript SDK with the [OAuth 2.0 Implicit Grant](https://circuit.github.io/oauth.html#implicit).\n   ```javascript\n   // No client_secret needed for Implicit Grant. SDK will obtain access token.\n   let client = new Circuit.Client({\n     client_id: '<your client_id>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon()\n     .then(user => console.log('Logged on as ' + user.displayName))\n   ```\n\n2. **Server-side web applications** use the JavaScript SDK (or [REST API](https://circuitsandbox.net/rest/v2/swagger/ui/index.html)) on the client, but handle the authentication flow on the server using the [OAuth 2.0 Authorization Code Grant](https://circuit.github.io/oauth.html#authorization_code). The access token is obtained on the server and then passed to the client to use in the Circuit JavaScript SDK. These apps may also use the Node.js SDK on the server side to act on behalf of the user.<br>\nExample apps: [node-linkify](https://github.com/circuit/node-linkify) or [circuit-google-assistant](https://github.com/circuit/circuit-google-assistant)\n   ```javascript\n   // access token is obtained and managed by server-side app\n   let client = new Circuit.Client({\n     client_id: '<your client_id>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon({accessToken: '<access_token>'})\n     .then(user => console.log('Logged on as ' + user.displayName))\n   ```\n\n3. **Bots** use the [Node.js SDK](https://www.npmjs.com/package/circuit-sdk) or the [REST API](https://circuitsandbox.net/rest/v2/swagger/ui/index.html) and use the [OAuth 2.0 Client Credentials Grant](https://circuit.github.io/oauth.html#client_credentials). Bots are a special type of user; they don't login on behalf of a regular user, hence no OAuth popup asking for a user`s credentials and permissions.<br>\nExample bots: [xlator-bot](https://github.com/circuit/xlator-bot) or [node-sdk-example](https://github.com/circuit/node-sdk-example)<br>\nExample electron bots: [webrtc-bot-example](https://github.com/circuit/webrtc-bot-example) or [live-cam-bot](https://github.com/circuit/live-cam-bot)\n   ```javascript\n   const Circuit = require('circuit-sdk');\n   let client = new Circuit.Client({\n     client_id: '<client_id>',\n     client_secret: '<client_secret>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon()\n     .then(user => console.log('Logged on as bot: ' + user.emailAddress))\n   ```\n\n\n\n### Examples\n\n> JavaScript examples are located at [/examples/js](/examples/js) with more examples on [jsbin](https://circuit.github.io/jssdk.html#jsbin).\n\n> Node.js example apps are on [github](https://github.com/circuit). A summary is listed [here](https://circuit.github.io/nodejs.html). Runkit allows playing with Node.js modules live, similar to jsbin or jsfiddle on the client. [Try it on runkit](https://runkit.com/rogeru/circuit-sdk)\n\nHere are some snippets to get you started.\n\n#### Create Group Conversation and send text message\nLogon as bot, create a group conversation with two users and send a text message.\n```javascript\nclient.logon()\n  .then(user => console.log(`Logged on as ${user.displayName}`, user))\n  .then(() => client.getUsersByEmail(['kim.jackson@mailinator.com', 'maeva.barnaby@mailinator.com']))\n  .then(users => users.map(user => user.userId))\n  .then(userIds => client.createGroupConversation(userIds, 'runkit example'))\n  .then(conv => client.addTextItem(conv.convId, 'I am test bot. What can I do for you?'))\n  .then(client.logout)\n  .catch(console.error)\n```\n\n#### Get Conversations\nGet 10 newest conversations of logged on user.\n```javascript\nclient.getConversations({numberOfConversations: 10})\n  .then(conversations => console.log(`Retrieved ${conversations.length} conversations`))\n```\n\n#### Video call with another Circuit user\nStart a video call with another user. Create conversation if not yet existing.\n> Only applicable to JavaScript SDK and only on browsers supporting WebRTC\n```javascript\nclient.makeCall('bob@company.com', {audio: true, video: true}, true)\n  .then(call => console.log('New call: ', call));\n```\n\n#### Listen for events\n```javascript\n// Register new items added to the feed of this user. E.g. incoming text message\nclient.addEventListener('itemAdded', item =>\n  console.log('itemAdded event received:', item));\n\n// Register for connection state changes\nclient.addEventListener('connectionStateChanged', evt => {\n  console.log(`New state is ${evt.state}`);\n});\n\n// Register and log all events\nCircuit.supportedEvents.forEach(e => client.addEventListener(e, console.log));\n```\n\n#### Create an injector\nInjectors allow extending the conversation, item and user objects within the SDK.\nIn this example a new attribute `teaser` is created on the item object. This `teaser` will be added to item objects in any reponse or event from the SDK.\n```javascript\nCircuit.Injectors.itemInjector = function (item) {\n  if (item.type === Circuit.Enums.ConversationItemType.TEXT) {\n    // Create item.teaser attribute with replacing br and hr tags with a space\n    item.teaser = item.text.content.replace(/<(br[\\/]?|\\/li|hr[\\/]?)>/gi, ' ');\n  } else {\n    item.teaser = item.type;\n  }\n};\n```\n\n### Supported Browsers\nChrome and Firefox are officially supported.\n\n### Help us improve the SDK\nHelp us improve the SDK or examples by sending us a pull-request or opening a [GitHub Issue](https://github.com/circuit/circuit-sdk/issues/new).\n","readmeFilename":"README.md","gitHead":"bc189a506ad8f973a3430f32722be47c37b7ff44","_id":"circuit-sdk@1.2.2802","_npmVersion":"5.3.0","_nodeVersion":"6.11.5","_npmUser":{"name":"rogeru","email":"roger.urscheler@unify.com"},"dist":{"integrity":"sha512-P/K3S94i5dMMmth+G5LEUwRezc6DmSALZkK7xB04CqcsnZwCvhc70Y5vNzX5eZRNCABQPVf658EqYMonULa0Xg==","shasum":"762f750ce00efdc422b2766588c9d739f31a376a","tarball":"https://registry.npmjs.org/circuit-sdk/-/circuit-sdk-1.2.2802.tgz","fileCount":18,"unpackedSize":5561757,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAJx536v9FKUUVCihMNj+RmZ4EDF04ng9WFCKeK00SODAiEA8HXXVTUCykNJb8+eL5naWnZS4MjatJn7wvuukWzwht4="}]},"maintainers":[{"name":"rogeru","email":"roger.urscheler@unify.com"},{"name":"rpastro","email":"rodrigo.pastro@unify.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/circuit-sdk_1.2.2802_1518811964079_0.803241475820557"},"_hasShrinkwrap":false},"1.2.2701":{"name":"circuit-sdk","version":"1.2.2701","description":"Circuit Node.js SDK","main":"circuit-node.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"Unify Inc."},"contributors":[{"name":"Roger Urscheler","email":"roger.urscheler@unify.com"},{"name":"Rodrigo Pastro","email":"rodrigo.pastro@unify.com"},{"name":"Johannes Ruetschi","email":"johannes.ruetschi@unify.com"}],"license":"Apache-2.0","homepage":"https://github.com/circuit/circuit-sdk","engines":{"node":">= 4.5.0"},"repository":{"type":"git","url":"git://github.com/circuit/circuit-sdk.git"},"bugs":{"url":"http://github.com/circuit/circuit-sdk/issues"},"keywords":["api","webrtc","circuit","collaboration","sdk"],"browser":{"electron":false},"unpkg":"dist/circuit.min.js","dependencies":{"ws":"~3.3.3"},"gitHead":"66225c08a5a19cb2445582cc31ce5de6d24ca4bc","_id":"circuit-sdk@1.2.2701","_npmVersion":"5.3.0","_nodeVersion":"8.8.1","_npmUser":{"name":"rogeru","email":"roger.urscheler@unify.com"},"dist":{"integrity":"sha512-bXnhas6jFE0JceZNUV0Bpaty3Jb9mwgy8nHTKxeGUPloARHCYbm/Mk1YekFN1pmdTwikGoc68vG6LuXAYQdedA==","shasum":"105db3bdc432a391a80320c6673e4c626b5bf072","tarball":"https://registry.npmjs.org/circuit-sdk/-/circuit-sdk-1.2.2701.tgz","fileCount":18,"unpackedSize":5527451,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDkqvWPGOhjUyyOykQ6paS6fkmTgci2AjLBzIlHUIuJzwIgNcWwpd6i9O991t0loVXzIZAsoVHltBRA0fc/11VyIDo="}]},"maintainers":[{"name":"rogeru","email":"roger.urscheler@unify.com"},{"name":"rpastro","email":"rodrigo.pastro@unify.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/circuit-sdk_1.2.2701_1518911955466_0.3456431538142224"},"_hasShrinkwrap":false},"1.2.2803":{"name":"circuit-sdk","version":"1.2.2803","description":"Circuit SDK","main":"circuit-node.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"Unify Inc."},"contributors":[{"name":"Roger Urscheler","email":"roger.urscheler@unify.com"},{"name":"Rodrigo Pastro","email":"rodrigo.pastro@unify.com"},{"name":"Johannes Ruetschi","email":"johannes.ruetschi@unify.com"}],"license":"Apache-2.0","homepage":"https://github.com/circuit/circuit-sdk","engines":{"node":">= 4.5.0"},"repository":{"type":"git","url":"git://github.com/circuit/circuit-sdk.git"},"bugs":{"url":"http://github.com/circuit/circuit-sdk/issues"},"keywords":["api","webrtc","circuit","collaboration","sdk"],"browser":{"electron":false,"./circuit-node.js":"./circuit.js"},"unpkg":"circuit.min.js","dependencies":{"ws":"~3.3.3"},"readme":"Circuit JavaScript and Node.js SDK\n==================================\n\n[![GitHub release](https://img.shields.io/github/release/circuit/circuit-sdk.svg)](https://github.com/circuit/circuit-sdk)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n\n### Prerequisites\n* Developer account on circuitsandbox.net. Get it for free at [developer registration](https://www.circuit.com/web/developers/registration).\n* OAuth 2.0 `client_id` and optionally `client_secret`. Get if for free at [circuit.github.com/oauth](https://circuit.github.com/oauth).\n\n\n### API Reference\nhttps://circuitsandbox.net/sdk/ with most APIs described in the [Client](https://circuitsandbox.net/sdk/classes/Client.html) class.\n\nMore info at [circuit.github.io](https://circuit.github.io/).\n\n### Usage\n\n#### JavaScript\nAdd the the line below to the HTML file of your app. This will include the latest version of Circuit SDK and make the `Circuit` object available.\n```html\n<script type=\"text/javascript\" src=\"https://unpkg.com/circuit-sdk\"></script>\n```\n\n#### Node.js\n```bash\nnpm install --save circuit-sdk\n```\n\n### Application Types\nThe majority of apps fall in one of the three types below. Each type uses a different OAuth 2.0 Grant.\n\n1. **Client-side web applications** use the JavaScript SDK with the [OAuth 2.0 Implicit Grant](https://circuit.github.io/oauth.html#implicit).\n   ```javascript\n   // No client_secret needed for Implicit Grant. SDK will obtain access token.\n   let client = new Circuit.Client({\n     client_id: '<your client_id>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon()\n     .then(user => console.log('Logged on as ' + user.displayName))\n   ```\n\n2. **Server-side web applications** use the JavaScript SDK (or [REST API](https://circuitsandbox.net/rest/v2/swagger/ui/index.html)) on the client, but handle the authentication flow on the server using the [OAuth 2.0 Authorization Code Grant](https://circuit.github.io/oauth.html#authorization_code). The access token is obtained on the server and then passed to the client to use in the Circuit JavaScript SDK. These apps may also use the Node.js SDK on the server side to act on behalf of the user.<br>\nExample apps: [node-linkify](https://github.com/circuit/node-linkify) or [circuit-google-assistant](https://github.com/circuit/circuit-google-assistant)\n   ```javascript\n   // access token is obtained and managed by server-side app\n   let client = new Circuit.Client({\n     client_id: '<your client_id>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon({accessToken: '<access_token>'})\n     .then(user => console.log('Logged on as ' + user.displayName))\n   ```\n\n3. **Bots** use the [Node.js SDK](https://www.npmjs.com/package/circuit-sdk) or the [REST API](https://circuitsandbox.net/rest/v2/swagger/ui/index.html) and use the [OAuth 2.0 Client Credentials Grant](https://circuit.github.io/oauth.html#client_credentials). Bots are a special type of user; they don't login on behalf of a regular user, hence no OAuth popup asking for a user`s credentials and permissions.<br>\nExample bots: [xlator-bot](https://github.com/circuit/xlator-bot) or [node-sdk-example](https://github.com/circuit/node-sdk-example)<br>\nExample electron bots: [webrtc-bot-example](https://github.com/circuit/webrtc-bot-example) or [live-cam-bot](https://github.com/circuit/live-cam-bot)\n   ```javascript\n   const Circuit = require('circuit-sdk');\n   let client = new Circuit.Client({\n     client_id: '<client_id>',\n     client_secret: '<client_secret>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon()\n     .then(user => console.log('Logged on as bot: ' + user.emailAddress))\n   ```\n\n\n\n### Examples\n\n> JavaScript examples are located at [/examples/js](/examples/js) with more examples on [jsbin](https://circuit.github.io/jssdk.html#jsbin).\n\n> Node.js example apps are on [github](https://github.com/circuit). A summary is listed [here](https://circuit.github.io/nodejs.html). Runkit allows playing with Node.js modules live, similar to jsbin or jsfiddle on the client. [Try it on runkit](https://runkit.com/rogeru/circuit-sdk)\n\nHere are some snippets to get you started.\n\n#### Create Group Conversation and send text message\nLogon as bot, create a group conversation with two users and send a text message.\n```javascript\nclient.logon()\n  .then(user => console.log(`Logged on as ${user.displayName}`, user))\n  .then(() => client.getUsersByEmail(['kim.jackson@mailinator.com', 'maeva.barnaby@mailinator.com']))\n  .then(users => users.map(user => user.userId))\n  .then(userIds => client.createGroupConversation(userIds, 'runkit example'))\n  .then(conv => client.addTextItem(conv.convId, 'I am test bot. What can I do for you?'))\n  .then(client.logout)\n  .catch(console.error)\n```\n\n#### Get Conversations\nGet 10 newest conversations of logged on user.\n```javascript\nclient.getConversations({numberOfConversations: 10})\n  .then(conversations => console.log(`Retrieved ${conversations.length} conversations`))\n```\n\n#### Video call with another Circuit user\nStart a video call with another user. Create conversation if not yet existing.\n> Only applicable to JavaScript SDK and only on browsers supporting WebRTC\n```javascript\nclient.makeCall('bob@company.com', {audio: true, video: true}, true)\n  .then(call => console.log('New call: ', call));\n```\n\n#### Listen for events\n```javascript\n// Register new items added to the feed of this user. E.g. incoming text message\nclient.addEventListener('itemAdded', item =>\n  console.log('itemAdded event received:', item));\n\n// Register for connection state changes\nclient.addEventListener('connectionStateChanged', evt => {\n  console.log(`New state is ${evt.state}`);\n});\n\n// Register and log all events\nCircuit.supportedEvents.forEach(e => client.addEventListener(e, console.log));\n```\n\n#### Create an injector\nInjectors allow extending the conversation, item and user objects within the SDK.\nIn this example a new attribute `teaser` is created on the item object. This `teaser` will be added to item objects in any reponse or event from the SDK.\n```javascript\nCircuit.Injectors.itemInjector = function (item) {\n  if (item.type === Circuit.Enums.ConversationItemType.TEXT) {\n    // Create item.teaser attribute with replacing br and hr tags with a space\n    item.teaser = item.text.content.replace(/<(br[\\/]?|\\/li|hr[\\/]?)>/gi, ' ');\n  } else {\n    item.teaser = item.type;\n  }\n};\n```\n\n### Supported Browsers\nChrome and Firefox are officially supported.\n\n### Help us improve the SDK\nHelp us improve the SDK or examples by sending us a pull-request or opening a [GitHub Issue](https://github.com/circuit/circuit-sdk/issues/new).\n","readmeFilename":"README.md","gitHead":"66225c08a5a19cb2445582cc31ce5de6d24ca4bc","_id":"circuit-sdk@1.2.2803","_npmVersion":"5.3.0","_nodeVersion":"6.11.5","_npmUser":{"name":"rogeru","email":"roger.urscheler@unify.com"},"dist":{"integrity":"sha512-rDkNXOv3j3NzRmKY8vDza1i808qWUZNU6SbwftOxRH/CWKeH3Z5DFuAtMjyCqWdfpgIfQyhrqKnM07khjeNzPA==","shasum":"da94b3218a5080553c3e4743ab820f7ba4c63990","tarball":"https://registry.npmjs.org/circuit-sdk/-/circuit-sdk-1.2.2803.tgz","fileCount":24,"unpackedSize":6275875,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEFbfGf6lgqQ+9VHjYDZvAkN4WvOpd65khBsWS76A/khAiEA5BgABhqmsxetRRbAl0O6U2wVh8aCweajGpcJq2ie5oc="}]},"maintainers":[{"name":"rogeru","email":"roger.urscheler@unify.com"},{"name":"rpastro","email":"rodrigo.pastro@unify.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/circuit-sdk_1.2.2803_1519418001602_0.7736214301456561"},"_hasShrinkwrap":false},"1.2.2804":{"name":"circuit-sdk","version":"1.2.2804","description":"Circuit SDK","main":"circuit-node.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"Unify Inc."},"contributors":[{"name":"Roger Urscheler","email":"roger.urscheler@unify.com"},{"name":"Rodrigo Pastro","email":"rodrigo.pastro@unify.com"},{"name":"Johannes Ruetschi","email":"johannes.ruetschi@unify.com"}],"license":"Apache-2.0","homepage":"https://github.com/circuit/circuit-sdk","engines":{"node":">= 4.5.0"},"repository":{"type":"git","url":"git://github.com/circuit/circuit-sdk.git"},"bugs":{"url":"http://github.com/circuit/circuit-sdk/issues"},"keywords":["api","webrtc","circuit","collaboration","sdk"],"browser":{"electron":false,"./circuit-node.js":"./circuit.js"},"unpkg":"circuit.min.js","dependencies":{"ws":"~3.3.3"},"readme":"Circuit JavaScript and Node.js SDK\n==================================\n\n[![GitHub release](https://img.shields.io/github/release/circuit/circuit-sdk.svg)](https://github.com/circuit/circuit-sdk)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n\n### Prerequisites\n* Developer account on circuitsandbox.net. Get it for free at [developer registration](https://www.circuit.com/web/developers/registration).\n* OAuth 2.0 `client_id` and optionally `client_secret`. Get if for free at [circuit.github.com/oauth](https://circuit.github.com/oauth).\n\n\n### API Reference\nhttps://circuitsandbox.net/sdk/ with most APIs described in the [Client](https://circuitsandbox.net/sdk/classes/Client.html) class.\n\nMore info at [circuit.github.io](https://circuit.github.io/).\n\n### Usage\n\n#### JavaScript\nAdd the the line below to the HTML file of your app. This will include the latest version of Circuit SDK and make the `Circuit` object available.\n```html\n<script type=\"text/javascript\" src=\"https://unpkg.com/circuit-sdk\"></script>\n```\n\n#### Node.js\n```bash\nnpm install --save circuit-sdk\n```\n\n### Application Types\nThe majority of apps fall in one of the three types below. Each type uses a different OAuth 2.0 Grant.\n\n1. **Client-side web applications** use the JavaScript SDK with the [OAuth 2.0 Implicit Grant](https://circuit.github.io/oauth.html#implicit).\n   ```javascript\n   // No client_secret needed for Implicit Grant. SDK will obtain access token.\n   let client = new Circuit.Client({\n     client_id: '<your client_id>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon()\n     .then(user => console.log('Logged on as ' + user.displayName))\n   ```\n\n2. **Server-side web applications** use the JavaScript SDK (or [REST API](https://circuitsandbox.net/rest/v2/swagger/ui/index.html)) on the client, but handle the authentication flow on the server using the [OAuth 2.0 Authorization Code Grant](https://circuit.github.io/oauth.html#authorization_code). The access token is obtained on the server and then passed to the client to use in the Circuit JavaScript SDK. These apps may also use the Node.js SDK on the server side to act on behalf of the user.<br>\nExample apps: [node-linkify](https://github.com/circuit/node-linkify) or [circuit-google-assistant](https://github.com/circuit/circuit-google-assistant)\n   ```javascript\n   // access token is obtained and managed by server-side app\n   let client = new Circuit.Client({\n     client_id: '<your client_id>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon({accessToken: '<access_token>'})\n     .then(user => console.log('Logged on as ' + user.displayName))\n   ```\n\n3. **Bots** use the [Node.js SDK](https://www.npmjs.com/package/circuit-sdk) or the [REST API](https://circuitsandbox.net/rest/v2/swagger/ui/index.html) and use the [OAuth 2.0 Client Credentials Grant](https://circuit.github.io/oauth.html#client_credentials). Bots are a special type of user; they don't login on behalf of a regular user, hence no OAuth popup asking for a user`s credentials and permissions.<br>\nExample bots: [xlator-bot](https://github.com/circuit/xlator-bot) or [node-sdk-example](https://github.com/circuit/node-sdk-example)<br>\nExample electron bots: [webrtc-bot-example](https://github.com/circuit/webrtc-bot-example) or [live-cam-bot](https://github.com/circuit/live-cam-bot)\n   ```javascript\n   const Circuit = require('circuit-sdk');\n   let client = new Circuit.Client({\n     client_id: '<client_id>',\n     client_secret: '<client_secret>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon()\n     .then(user => console.log('Logged on as bot: ' + user.emailAddress))\n   ```\n\n\n\n### Examples\n\n> JavaScript examples are located at [/examples/js](/examples/js) with more examples on [jsbin](https://circuit.github.io/jssdk.html#jsbin).\n\n> Node.js example apps are on [github](https://github.com/circuit). A summary is listed [here](https://circuit.github.io/nodejs.html). Runkit allows playing with Node.js modules live, similar to jsbin or jsfiddle on the client. [Try it on runkit](https://runkit.com/rogeru/circuit-sdk)\n\nHere are some snippets to get you started.\n\n#### Create Group Conversation and send text message\nLogon as bot, create a group conversation with two users and send a text message.\n```javascript\nclient.logon()\n  .then(user => console.log(`Logged on as ${user.displayName}`, user))\n  .then(() => client.getUsersByEmail(['kim.jackson@mailinator.com', 'maeva.barnaby@mailinator.com']))\n  .then(users => users.map(user => user.userId))\n  .then(userIds => client.createGroupConversation(userIds, 'runkit example'))\n  .then(conv => client.addTextItem(conv.convId, 'I am test bot. What can I do for you?'))\n  .then(client.logout)\n  .catch(console.error)\n```\n\n#### Get Conversations\nGet 10 newest conversations of logged on user.\n```javascript\nclient.getConversations({numberOfConversations: 10})\n  .then(conversations => console.log(`Retrieved ${conversations.length} conversations`))\n```\n\n#### Video call with another Circuit user\nStart a video call with another user. Create conversation if not yet existing.\n> Only applicable to JavaScript SDK and only on browsers supporting WebRTC\n```javascript\nclient.makeCall('bob@company.com', {audio: true, video: true}, true)\n  .then(call => console.log('New call: ', call));\n```\n\n#### Listen for events\n```javascript\n// Register new items added to the feed of this user. E.g. incoming text message\nclient.addEventListener('itemAdded', item =>\n  console.log('itemAdded event received:', item));\n\n// Register for connection state changes\nclient.addEventListener('connectionStateChanged', evt => {\n  console.log(`New state is ${evt.state}`);\n});\n\n// Register and log all events\nCircuit.supportedEvents.forEach(e => client.addEventListener(e, console.log));\n```\n\n#### Create an injector\nInjectors allow extending the conversation, item and user objects within the SDK.\nIn this example a new attribute `teaser` is created on the item object. This `teaser` will be added to item objects in any reponse or event from the SDK.\n```javascript\nCircuit.Injectors.itemInjector = function (item) {\n  if (item.type === Circuit.Enums.ConversationItemType.TEXT) {\n    // Create item.teaser attribute with replacing br and hr tags with a space\n    item.teaser = item.text.content.replace(/<(br[\\/]?|\\/li|hr[\\/]?)>/gi, ' ');\n  } else {\n    item.teaser = item.type;\n  }\n};\n```\n\n### Supported Browsers\nChrome and Firefox are officially supported.\n\n### Help us improve the SDK\nHelp us improve the SDK or examples by sending us a pull-request or opening a [GitHub Issue](https://github.com/circuit/circuit-sdk/issues/new).\n","readmeFilename":"README.md","gitHead":"66225c08a5a19cb2445582cc31ce5de6d24ca4bc","_id":"circuit-sdk@1.2.2804","_npmVersion":"5.3.0","_nodeVersion":"6.11.5","_npmUser":{"name":"rogeru","email":"roger.urscheler@unify.com"},"dist":{"integrity":"sha512-kpYM8Bx/M1gBtvb/8dpabEiV+8kmuNshA4cT7+zZsOfKwIln2Rx4lbtkvuhkmnb1db1XxnMEAK/DSVhxOt4NVA==","shasum":"81d436ec4ca858ec4e8536d214edfef52ff64f9a","tarball":"https://registry.npmjs.org/circuit-sdk/-/circuit-sdk-1.2.2804.tgz","fileCount":22,"unpackedSize":3569243,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDi/JPA6yOsd7B8VTW2OYIsaq4BazA36tJdfBdDydPAIwIgOO68906ycfs7TFjru2b96NAEU7PXspwbcAvoOZRnzsk="}]},"maintainers":[{"name":"rogeru","email":"roger.urscheler@unify.com"},{"name":"rpastro","email":"rodrigo.pastro@unify.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/circuit-sdk_1.2.2804_1519418599960_0.05562278581931901"},"_hasShrinkwrap":false},"1.2.2805":{"name":"circuit-sdk","version":"1.2.2805","description":"Circuit SDK","main":"circuit-node.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"Unify Inc."},"contributors":[{"name":"Roger Urscheler","email":"roger.urscheler@unify.com"},{"name":"Rodrigo Pastro","email":"rodrigo.pastro@unify.com"},{"name":"Johannes Ruetschi","email":"johannes.ruetschi@unify.com"}],"license":"Apache-2.0","homepage":"https://github.com/circuit/circuit-sdk","engines":{"node":">= 4.5.0"},"repository":{"type":"git","url":"git://github.com/circuit/circuit-sdk.git"},"bugs":{"url":"http://github.com/circuit/circuit-sdk/issues"},"keywords":["api","webrtc","circuit","collaboration","sdk"],"browser":{"electron":false,"./circuit-node.js":"./circuit.js"},"unpkg":"circuit.min.js","dependencies":{"ws":"~3.3.3"},"readme":"Circuit JavaScript and Node.js SDK\n==================================\n\n[![GitHub release](https://img.shields.io/github/release/circuit/circuit-sdk.svg)](https://github.com/circuit/circuit-sdk)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n\n### Prerequisites\n* Developer account on circuitsandbox.net. Get it for free at [developer registration](https://www.circuit.com/web/developers/registration).\n* OAuth 2.0 `client_id` and optionally `client_secret`. Get if for free at [circuit.github.com/oauth](https://circuit.github.com/oauth).\n\n\n### API Reference\nhttps://circuitsandbox.net/sdk/ with most APIs described in the [Client](https://circuitsandbox.net/sdk/classes/Client.html) class.\n\nMore info at [circuit.github.io](https://circuit.github.io/).\n\n### Usage\n\n#### JavaScript\nAdd the the line below to the HTML file of your app. This will include the latest version of Circuit SDK and make the `Circuit` object available.\n```html\n<script type=\"text/javascript\" src=\"https://unpkg.com/circuit-sdk\"></script>\n```\n\n#### Node.js\n```bash\nnpm install --save circuit-sdk\n```\n\n### Application Types\nThe majority of apps fall in one of the three types below. Each type uses a different OAuth 2.0 Grant.\n\n1. **Client-side web applications** use the JavaScript SDK with the [OAuth 2.0 Implicit Grant](https://circuit.github.io/oauth.html#implicit).\n   ```javascript\n   // No client_secret needed for Implicit Grant. SDK will obtain access token.\n   let client = new Circuit.Client({\n     client_id: '<your client_id>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon()\n     .then(user => console.log('Logged on as ' + user.displayName))\n   ```\n\n2. **Server-side web applications** use the JavaScript SDK (or [REST API](https://circuitsandbox.net/rest/v2/swagger/ui/index.html)) on the client, but handle the authentication flow on the server using the [OAuth 2.0 Authorization Code Grant](https://circuit.github.io/oauth.html#authorization_code). The access token is obtained on the server and then passed to the client to use in the Circuit JavaScript SDK. These apps may also use the Node.js SDK on the server side to act on behalf of the user.<br>\nExample apps: [node-linkify](https://github.com/circuit/node-linkify) or [circuit-google-assistant](https://github.com/circuit/circuit-google-assistant)\n   ```javascript\n   // access token is obtained and managed by server-side app\n   let client = new Circuit.Client({\n     client_id: '<your client_id>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon({accessToken: '<access_token>'})\n     .then(user => console.log('Logged on as ' + user.displayName))\n   ```\n\n3. **Bots** use the [Node.js SDK](https://www.npmjs.com/package/circuit-sdk) or the [REST API](https://circuitsandbox.net/rest/v2/swagger/ui/index.html) and use the [OAuth 2.0 Client Credentials Grant](https://circuit.github.io/oauth.html#client_credentials). Bots are a special type of user; they don't login on behalf of a regular user, hence no OAuth popup asking for a user`s credentials and permissions.<br>\nExample bots: [xlator-bot](https://github.com/circuit/xlator-bot) or [node-sdk-example](https://github.com/circuit/node-sdk-example)<br>\nExample electron bots: [webrtc-bot-example](https://github.com/circuit/webrtc-bot-example) or [live-cam-bot](https://github.com/circuit/live-cam-bot)\n   ```javascript\n   const Circuit = require('circuit-sdk');\n   let client = new Circuit.Client({\n     client_id: '<client_id>',\n     client_secret: '<client_secret>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon()\n     .then(user => console.log('Logged on as bot: ' + user.emailAddress))\n   ```\n\n\n\n### Examples\n\n> JavaScript examples are located at [/examples/js](/examples/js) with more examples on [jsbin](https://circuit.github.io/jssdk.html#jsbin).\n\n> Node.js example apps are on [github](https://github.com/circuit). A summary is listed [here](https://circuit.github.io/nodejs.html). Runkit allows playing with Node.js modules live, similar to jsbin or jsfiddle on the client. [Try it on runkit](https://runkit.com/rogeru/circuit-sdk)\n\nHere are some snippets to get you started.\n\n#### Create Group Conversation and send text message\nLogon as bot, create a group conversation with two users and send a text message.\n```javascript\nclient.logon()\n  .then(user => console.log(`Logged on as ${user.displayName}`, user))\n  .then(() => client.getUsersByEmail(['kim.jackson@mailinator.com', 'maeva.barnaby@mailinator.com']))\n  .then(users => users.map(user => user.userId))\n  .then(userIds => client.createGroupConversation(userIds, 'runkit example'))\n  .then(conv => client.addTextItem(conv.convId, 'I am test bot. What can I do for you?'))\n  .then(client.logout)\n  .catch(console.error)\n```\n\n#### Get Conversations\nGet 10 newest conversations of logged on user.\n```javascript\nclient.getConversations({numberOfConversations: 10})\n  .then(conversations => console.log(`Retrieved ${conversations.length} conversations`))\n```\n\n#### Video call with another Circuit user\nStart a video call with another user. Create conversation if not yet existing.\n> Only applicable to JavaScript SDK and only on browsers supporting WebRTC\n```javascript\nclient.makeCall('bob@company.com', {audio: true, video: true}, true)\n  .then(call => console.log('New call: ', call));\n```\n\n#### Listen for events\n```javascript\n// Register new items added to the feed of this user. E.g. incoming text message\nclient.addEventListener('itemAdded', item =>\n  console.log('itemAdded event received:', item));\n\n// Register for connection state changes\nclient.addEventListener('connectionStateChanged', evt => {\n  console.log(`New state is ${evt.state}`);\n});\n\n// Register and log all events\nCircuit.supportedEvents.forEach(e => client.addEventListener(e, console.log));\n```\n\n#### Create an injector\nInjectors allow extending the conversation, item and user objects within the SDK.\nIn this example a new attribute `teaser` is created on the item object. This `teaser` will be added to item objects in any reponse or event from the SDK.\n```javascript\nCircuit.Injectors.itemInjector = function (item) {\n  if (item.type === Circuit.Enums.ConversationItemType.TEXT) {\n    // Create item.teaser attribute with replacing br and hr tags with a space\n    item.teaser = item.text.content.replace(/<(br[\\/]?|\\/li|hr[\\/]?)>/gi, ' ');\n  } else {\n    item.teaser = item.type;\n  }\n};\n```\n\n### Supported Browsers\nChrome and Firefox are officially supported.\n\n### Help us improve the SDK\nHelp us improve the SDK or examples by sending us a pull-request or opening a [GitHub Issue](https://github.com/circuit/circuit-sdk/issues/new).\n","readmeFilename":"README.md","gitHead":"66225c08a5a19cb2445582cc31ce5de6d24ca4bc","_id":"circuit-sdk@1.2.2805","_npmVersion":"5.3.0","_nodeVersion":"6.11.5","_npmUser":{"name":"rogeru","email":"roger.urscheler@unify.com"},"dist":{"integrity":"sha512-oikYYLmrzttNMYzgCLEJZetrrfJ8LzLjkU0Js70p11qwoLxmb7kehuhNSet3uf6jPZRQuoMCaC72b9MoprL6Pw==","shasum":"0b44a2cc7860c62b5f3e019a5ee66b1509f6beaa","tarball":"https://registry.npmjs.org/circuit-sdk/-/circuit-sdk-1.2.2805.tgz","fileCount":22,"unpackedSize":3569506,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGBeJGuw8q60Jt7ijf4FGdUK7i+c2FuvOrHPWSBipMbCAiEAqYaKDRjtr/bTrrMBgBwWOgw9XyEXGfVrNjcjv21nzE4="}]},"maintainers":[{"name":"rogeru","email":"roger.urscheler@unify.com"},{"name":"rpastro","email":"rodrigo.pastro@unify.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/circuit-sdk_1.2.2805_1519500422799_0.45548822706801806"},"_hasShrinkwrap":false},"1.2.3000":{"name":"circuit-sdk","version":"1.2.3000","description":"Circuit SDK","main":"circuit-node.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"Unify Inc."},"contributors":[{"name":"Roger Urscheler","email":"roger.urscheler@unify.com"},{"name":"Rodrigo Pastro","email":"rodrigo.pastro@unify.com"},{"name":"Johannes Ruetschi","email":"johannes.ruetschi@unify.com"}],"license":"Apache-2.0","homepage":"https://github.com/circuit/circuit-sdk","engines":{"node":">= 4.5.0"},"repository":{"type":"git","url":"git://github.com/circuit/circuit-sdk.git"},"bugs":{"url":"http://github.com/circuit/circuit-sdk/issues"},"keywords":["api","webrtc","circuit","collaboration","sdk"],"browser":{"electron":false,"./circuit-node.js":"./circuit.js"},"unpkg":"circuit.min.js","dependencies":{"ws":"~3.3.3"},"readme":"Circuit JavaScript and Node.js SDK\n==================================\n\n[![GitHub release](https://img.shields.io/github/release/circuit/circuit-sdk.svg)](https://github.com/circuit/circuit-sdk)\n[![Build Status](https://travis-ci.org/circuit/circuit-sdk.svg?branch=beta)](https://travis-ci.org/circuit/circuit-sdk)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n\n### Prerequisites\n* Developer account on circuitsandbox.net. Get it for free at [developer registration](https://www.circuit.com/web/developers/registration).\n* OAuth 2.0 `client_id` and optionally `client_secret`. Get if for free at [circuit.github.com/oauth](https://circuit.github.com/oauth).\n\n\n### API Reference\nhttps://circuitsandbox.net/sdk/ with most APIs described in the [Client](https://circuitsandbox.net/sdk/classes/Client.html) class.\n\nMore info at [circuit.github.io](https://circuit.github.io/).\n\n### Usage\n\n#### JavaScript\nAdd the the line below to the HTML file of your app. This will include the latest version of Circuit SDK and make the `Circuit` object available.\n```html\n<script type=\"text/javascript\" src=\"https://unpkg.com/circuit-sdk\"></script>\n```\n\n> Starting version 1.2.2800 the JS SDK can also be imported via CommonJS or AMD. View the repo [UMD](https://github.com/circuit/umd) for the different types of usage, or [circuit-ionic-start](https://github.com/circuit/circuit-ionic-starter) for example how import the SDK via `require` using webpack.\n\n#### Node.js\n```bash\nnpm install --save circuit-sdk\n```\n\n### Application Types\nThe majority of apps fall in one of the three types below. Each type uses a different OAuth 2.0 Grant.\n\n1. **Client-side web applications** use the JavaScript SDK with the [OAuth 2.0 Implicit Grant](https://circuit.github.io/oauth.html#implicit).\n   ```javascript\n   // No client_secret needed for Implicit Grant. SDK will obtain access token.\n   let client = new Circuit.Client({\n     client_id: '<your client_id>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon()\n     .then(user => console.log('Logged on as ' + user.displayName))\n   ```\n\n2. **Server-side web applications** use the JavaScript SDK (or [REST API](https://circuitsandbox.net/rest/v2/swagger/ui/index.html)) on the client, but handle the authentication flow on the server using the [OAuth 2.0 Authorization Code Grant](https://circuit.github.io/oauth.html#authorization_code). The access token is obtained on the server and then passed to the client to use in the Circuit JavaScript SDK. These apps may also use the Node.js SDK on the server side to act on behalf of the user.<br>\nExample apps: [node-linkify](https://github.com/circuit/node-linkify) or [circuit-google-assistant](https://github.com/circuit/circuit-google-assistant)\n   ```javascript\n   // access token is obtained and managed by server-side app\n   let client = new Circuit.Client({\n     client_id: '<your client_id>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon({accessToken: '<access_token>'})\n     .then(user => console.log('Logged on as ' + user.displayName))\n   ```\n\n3. **Bots** use the [Node.js SDK](https://www.npmjs.com/package/circuit-sdk) or the [REST API](https://circuitsandbox.net/rest/v2/swagger/ui/index.html) and use the [OAuth 2.0 Client Credentials Grant](https://circuit.github.io/oauth.html#client_credentials). Bots are a special type of user; they don't login on behalf of a regular user, hence no OAuth popup asking for a user`s credentials and permissions.<br>\nExample bots: [xlator-bot](https://github.com/circuit/xlator-bot) or [node-sdk-example](https://github.com/circuit/node-sdk-example)<br>\nExample electron bots: [webrtc-bot-example](https://github.com/circuit/webrtc-bot-example) or [live-cam-bot](https://github.com/circuit/live-cam-bot)\n   ```javascript\n   const Circuit = require('circuit-sdk');\n   let client = new Circuit.Client({\n     client_id: '<client_id>',\n     client_secret: '<client_secret>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon()\n     .then(user => console.log('Logged on as bot: ' + user.emailAddress))\n   ```\n\n\n\n### Examples\n\n> JavaScript examples are located at [/examples/js](/examples/js) with more examples on [jsbin](https://circuit.github.io/jssdk.html#jsbin).\n\n> Node.js example apps are on [github](https://github.com/circuit). A summary is listed [here](https://circuit.github.io/nodejs.html). Runkit allows playing with Node.js modules live, similar to jsbin or jsfiddle on the client. [Try it on runkit](https://runkit.com/rogeru/circuit-sdk)\n\nHere are some snippets to get you started.\n\n#### Create Group Conversation and send text message\nLogon as bot, create a group conversation with two users and send a text message.\n```javascript\nclient.logon()\n  .then(user => console.log(`Logged on as ${user.displayName}`, user))\n  .then(() => client.getUsersByEmail(['kim.jackson@mailinator.com', 'maeva.barnaby@mailinator.com']))\n  .then(users => users.map(user => user.userId))\n  .then(userIds => client.createGroupConversation(userIds, 'runkit example'))\n  .then(conv => client.addTextItem(conv.convId, 'I am test bot. What can I do for you?'))\n  .then(client.logout)\n  .catch(console.error)\n```\n\n#### Get Conversations\nGet 10 newest conversations of logged on user.\n```javascript\nclient.getConversations({numberOfConversations: 10})\n  .then(conversations => console.log(`Retrieved ${conversations.length} conversations`))\n```\n\n#### Video call with another Circuit user\nStart a video call with another user. Create conversation if not yet existing.\n> Only applicable to JavaScript SDK and only on browsers supporting WebRTC\n```javascript\nclient.makeCall('bob@company.com', {audio: true, video: true}, true)\n  .then(call => console.log('New call: ', call));\n```\n\n#### Listen for events\n```javascript\n// Register new items added to the feed of this user. E.g. incoming text message\nclient.addEventListener('itemAdded', item =>\n  console.log('itemAdded event received:', item));\n\n// Register for connection state changes\nclient.addEventListener('connectionStateChanged', evt => {\n  console.log(`New state is ${evt.state}`);\n});\n\n// Register and log all events\nCircuit.supportedEvents.forEach(e => client.addEventListener(e, console.log));\n```\n\n#### Create an injector\nInjectors allow extending the conversation, item and user objects within the SDK.\nIn this example a new attribute `teaser` is created on the item object. This `teaser` will be added to item objects in any reponse or event from the SDK.\n```javascript\nCircuit.Injectors.itemInjector = function (item) {\n  if (item.type === Circuit.Enums.ConversationItemType.TEXT) {\n    // Create item.teaser attribute with replacing br and hr tags with a space\n    item.teaser = item.text.content.replace(/<(br[\\/]?|\\/li|hr[\\/]?)>/gi, ' ');\n  } else {\n    item.teaser = item.type;\n  }\n};\n```\n\n### Supported Browsers\nChrome and Firefox are officially supported.\n\n### Help us improve the SDK\nHelp us improve the SDK or examples by sending us a pull-request or opening a [GitHub Issue](https://github.com/circuit/circuit-sdk/issues/new).\n","readmeFilename":"README.md","gitHead":"b3a5d3664eed323f3e3ee505c414f0cc23ebbe73","_id":"circuit-sdk@1.2.3000","_npmVersion":"5.3.0","_nodeVersion":"6.11.5","_npmUser":{"name":"rogeru","email":"roger.urscheler@unify.com"},"dist":{"integrity":"sha512-v1CcszhAhCPvYDn5uelIclHrs9sgScE3xVpGwYcSL+uwzIWMFysf22+QIl2+fUYbGj1QXvqcFPEF+n+6WwiwQg==","shasum":"be485758305f62f95ea4cc64150e1bcc7786bca6","tarball":"https://registry.npmjs.org/circuit-sdk/-/circuit-sdk-1.2.3000.tgz","fileCount":11,"unpackedSize":2805857,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCiCRnX4WNKzsIsU+cpSH8FApfXCOOBK06+tuUx2/jOMQIhAOZdpa3bIzZ8hf+BODDgDDo5RRlZGxi06RLZBT+b04V7"}]},"maintainers":[{"name":"rogeru","email":"roger.urscheler@unify.com"},{"name":"rpastro","email":"rodrigo.pastro@unify.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/circuit-sdk_1.2.3000_1522250558431_0.54396249738271"},"_hasShrinkwrap":false},"1.2.2902":{"name":"circuit-sdk","version":"1.2.2902","description":"Circuit SDK","main":"circuit-node.js","scripts":{"test:browser":"node test/index","test:node":"mocha ./test/node/* --recursive --timeout=5000 --exit","test":"npm run test:node && npm run test:browser"},"author":{"name":"Unify Inc."},"contributors":[{"name":"Roger Urscheler","email":"roger.urscheler@unify.com"},{"name":"Rodrigo Pastro","email":"rodrigo.pastro@unify.com"},{"name":"Johannes Ruetschi","email":"johannes.ruetschi@unify.com"}],"license":"Apache-2.0","homepage":"https://github.com/circuit/circuit-sdk","engines":{"node":">= 4.5.0"},"repository":{"type":"git","url":"git://github.com/circuit/circuit-sdk.git"},"bugs":{"url":"http://github.com/circuit/circuit-sdk/issues"},"keywords":["api","webrtc","circuit","collaboration","sdk"],"browser":{"electron":false,"./circuit-node.js":"./circuit.js"},"unpkg":"circuit.min.js","dependencies":{"ws":"~3.3.3"},"devDependencies":{"chai":"^4.1.2","express":"^4.16.2","globby":"^8.0.1","minimist":"^1.2.0","mocha":"^5.0.1","puppeteer":"^1.1.1","serve-static":"^1.13.2"},"gitHead":"7e99936fcda2695769c2402def241ff22f775ae8","_id":"circuit-sdk@1.2.2902","_npmVersion":"5.3.0","_nodeVersion":"6.11.5","_npmUser":{"name":"rogeru","email":"roger.urscheler@unify.com"},"dist":{"integrity":"sha512-BMzLonUNk6QjRGncVxpn6yTK9PnBWlE7gE4KyWKQxI5FU3h2YCFbVCzA1wW3Aa+OKdX8av6L3oDdDc+fMNCxcQ==","shasum":"d9839fcb0843c87084205ded35f918db6ba77200","tarball":"https://registry.npmjs.org/circuit-sdk/-/circuit-sdk-1.2.2902.tgz","fileCount":11,"unpackedSize":2789414,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCkvJQAZZnwLNb9AbU8A1BSAk5qiskKSUfjXowpng0BqQIhAOVr9E6du/RL5EQgDN7HCywk3gWG1MnAAt8VRLR29AJt"}]},"maintainers":[{"name":"rogeru","email":"roger.urscheler@unify.com"},{"name":"rpastro","email":"rodrigo.pastro@unify.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/circuit-sdk_1.2.2902_1522284051506_0.400091758457674"},"_hasShrinkwrap":false},"1.2.3302":{"name":"circuit-sdk","version":"1.2.3302","description":"Circuit SDK","main":"circuit-node.js","scripts":{"test:browser":"node test/index","test:node":"mocha ./test/node/* --recursive --timeout=5000 --exit","test":"npm run test:node && npm run test:browser"},"author":{"name":"Unify Inc."},"contributors":[{"name":"Roger Urscheler","email":"roger.urscheler@unify.com"},{"name":"Rodrigo Pastro","email":"rodrigo.pastro@unify.com"},{"name":"Johannes Ruetschi","email":"johannes.ruetschi@unify.com"}],"license":"Apache-2.0","homepage":"https://github.com/circuit/circuit-sdk","engines":{"node":">= 4.5.0"},"repository":{"type":"git","url":"git://github.com/circuit/circuit-sdk.git"},"bugs":{"url":"http://github.com/circuit/circuit-sdk/issues"},"keywords":["api","webrtc","circuit","collaboration","sdk"],"browser":{"electron":false,"./circuit-node.js":"./circuit.js"},"unpkg":"circuit.min.js","dependencies":{"ws":"~3.3.3"},"devDependencies":{"chai":"^4.1.2","express":"^4.16.2","globby":"^8.0.1","minimist":"^1.2.0","mocha":"^5.0.1","puppeteer":"^1.1.1","serve-static":"^1.13.2"},"gitHead":"d4bb6ab5a33819c03de1544a317aa157d376f06f","_id":"circuit-sdk@1.2.3302","_npmVersion":"5.3.0","_nodeVersion":"6.11.5","_npmUser":{"name":"rogeru","email":"roger.urscheler@unify.com"},"dist":{"integrity":"sha512-FVGevc2Fi7Ag9OwXqKKy1i/cf5D5de3nr4+KUmAISPH8E7yUkrHAbAqqrmGwyVQcc1T5GBP1nM+ZgLjHra2/Bg==","shasum":"a9e2f41aadd67c5a9d6658bed7b7c8cfce0c87fa","tarball":"https://registry.npmjs.org/circuit-sdk/-/circuit-sdk-1.2.3302.tgz","fileCount":11,"unpackedSize":2889262,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa+dY0CRA9TVsSAnZWagAAlTwQAJR65Oimh8i2saehr/fG\noM1NQnjV6JHrSzWBg3hrn4Eiz90bdKExQmKClDu1uBdXu4TMfc+OOgLgtEiN\nvMU7jwRWycSvFX92jleE+eFERBNVwnHsnM4oNWsNMSRSh7oqZJwQ+V8tQqI6\n9SsTeQIWJ02ZT5cuyfMxTiD7ENXIzEdCMcmLxnPkGj9+R4IBBV/VaUoU3qiN\nV8AAjH56FdVOMgAXPyMwn0AbEgG1W05y5d4XmYnm7u8liEUHkFmgcB+aNFyt\nlSILxlfy6kDeErAcuyTOTsSP5j2z5GzmFqpmCm7HDQICDO3VLYzDZZsKdlwc\nAR/a7nfHHXK1lRC+1pXe5bzVClgiVfuKYA1ml0ZjvXUW9b5d2yQMPDj4OHov\n2FR2LL5TWDzaD1KZg2dumv/gMHthvg44H3SEaZ36EyUz5URnaYAmyFbWrvVP\nkaRKFojp8o+Rh3+ZPz+r5T7dgTQ3dKJd6g6mpxGqhlnZgLjjHacimkM9x33T\nZP/yECxIjZm75gE0VXz7m0rpJfdAEJL4/MI9GmiOrL5Kio2tepbgV6dV66bp\nEhiD8q17+dJgBcYxmZjRunVZrxkV3VokbwbklS0DgC+e4WSpA/J+HqTX2GYl\nC4cFbdu3R24hPc1841JoIpRyJcjkuHFozPqbuen8Td2mfXhwU80maVwTMWFP\n1Fvy\r\n=yOB/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCshhu/WnZ8SMzJc9u1Kfe5nocVjqdAVik9XxIYVhK1iwIgTRpdNYHxkNQP6LINajUtmX3X8Okra7adBjm+CqbCf5s="}]},"maintainers":[{"name":"rogeru","email":"roger.urscheler@unify.com"},{"name":"rpastro","email":"rodrigo.pastro@unify.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/circuit-sdk_1.2.3302_1526322739712_0.645083659040006"},"_hasShrinkwrap":false},"1.2.3400":{"name":"circuit-sdk","version":"1.2.3400","description":"Circuit SDK","main":"circuit-node.js","scripts":{"test:browser":"node test/index","test:node":"mocha ./test/node/* --recursive --timeout=5000 --exit","test":"npm run test:node && npm run test:browser"},"author":{"name":"Unify Inc."},"contributors":[{"name":"Roger Urscheler","email":"roger.urscheler@unify.com"},{"name":"Rodrigo Pastro","email":"rodrigo.pastro@unify.com"},{"name":"Johannes Ruetschi","email":"johannes.ruetschi@unify.com"}],"license":"Apache-2.0","homepage":"https://github.com/circuit/circuit-sdk","engines":{"node":">= 4.5.0"},"repository":{"type":"git","url":"git://github.com/circuit/circuit-sdk.git"},"bugs":{"url":"http://github.com/circuit/circuit-sdk/issues"},"keywords":["api","webrtc","circuit","collaboration","sdk"],"browser":{"electron":false,"./circuit-node.js":"./circuit.js"},"unpkg":"circuit.min.js","dependencies":{"ws":"~3.3.3"},"devDependencies":{"chai":"^4.1.2","express":"^4.16.2","globby":"^8.0.1","minimist":"^1.2.0","mocha":"^5.0.1","puppeteer":"^1.1.1","serve-static":"^1.13.2"},"readme":"Circuit JavaScript and Node.js SDK\n==================================\n\n[![NPM release](https://img.shields.io/npm/v/circuit-sdk/beta.svg)](https://www.npmjs.com/package/circuit-sdk)\n[![Build Status](https://travis-ci.org/circuit/circuit-sdk.svg?branch=beta)](https://travis-ci.org/circuit/circuit-sdk)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n\n### Prerequisites\n* Developer account on circuitsandbox.net. Get it for free at [developer registration](https://www.circuit.com/web/developers/registration).\n* OAuth 2.0 `client_id` and optionally `client_secret`. Get if for free at [circuit.github.com/oauth](https://circuit.github.com/oauth).\n\n\n### API Reference\nhttps://circuitsandbox.net/sdk/ with most APIs described in the [Client](https://circuitsandbox.net/sdk/classes/Client.html) class.\n\nMore info at [circuit.github.io](https://circuit.github.io/).\n\n### Usage\n\n#### JavaScript\nAdd the the line below to the HTML file of your app. This will include the latest version of Circuit SDK and make the `Circuit` object available.\n```html\n<script type=\"text/javascript\" src=\"https://unpkg.com/circuit-sdk@beta\"></script>\n```\n\n> Starting version 1.2.2800 the JS SDK can also be imported via CommonJS or AMD. View the repo [UMD](https://github.com/circuit/umd) for the different types of usage, or [circuit-ionic-start](https://github.com/circuit/circuit-ionic-starter) for example how import the SDK via `require` using webpack.\n\n#### Node.js\n```bash\nnpm install --save circuit-sdk@beta\n```\n\n### Application Types\nThe majority of apps fall in one of the three types below. Each type uses a different OAuth 2.0 Grant.\n\n1. **Client-side web applications** use the JavaScript SDK with the [OAuth 2.0 Implicit Grant](https://circuit.github.io/oauth.html#implicit).\n   ```javascript\n   // No client_secret needed for Implicit Grant. SDK will obtain access token.\n   let client = new Circuit.Client({\n     client_id: '<your client_id>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon()\n     .then(user => console.log('Logged on as ' + user.displayName))\n   ```\n\n2. **Server-side web applications** use the JavaScript SDK (or [REST API](https://circuitsandbox.net/rest/v2/swagger/ui/index.html)) on the client, but handle the authentication flow on the server using the [OAuth 2.0 Authorization Code Grant](https://circuit.github.io/oauth.html#authorization_code). The access token is obtained on the server and then passed to the client to use in the Circuit JavaScript SDK. These apps may also use the Node.js SDK on the server side to act on behalf of the user.<br>\nExample apps: [node-linkify](https://github.com/circuit/node-linkify) or [circuit-google-assistant](https://github.com/circuit/circuit-google-assistant)\n   ```javascript\n   // access token is obtained and managed by server-side app\n   let client = new Circuit.Client({\n     client_id: '<your client_id>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon({accessToken: '<access_token>'})\n     .then(user => console.log('Logged on as ' + user.displayName))\n   ```\n\n3. **Bots** use the [Node.js SDK](https://www.npmjs.com/package/circuit-sdk) or the [REST API](https://circuitsandbox.net/rest/v2/swagger/ui/index.html) and use the [OAuth 2.0 Client Credentials Grant](https://circuit.github.io/oauth.html#client_credentials). Bots are a special type of user; they don't login on behalf of a regular user, hence no OAuth popup asking for a user`s credentials and permissions.<br>\nExample bots: [xlator-bot](https://github.com/circuit/xlator-bot) or [node-sdk-example](https://github.com/circuit/node-sdk-example)<br>\nExample electron bots: [webrtc-bot-example](https://github.com/circuit/webrtc-bot-example) or [live-cam-bot](https://github.com/circuit/live-cam-bot)\n   ```javascript\n   const Circuit = require('circuit-sdk');\n   let client = new Circuit.Client({\n     client_id: '<client_id>',\n     client_secret: '<client_secret>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon()\n     .then(user => console.log('Logged on as bot: ' + user.emailAddress))\n   ```\n\n\n\n### Examples\n\n> JavaScript examples are located at [/examples/js](/examples/js) with more examples on [jsbin](https://circuit.github.io/jssdk.html#jsbin).\n\n> Node.js example apps are on [github](https://github.com/circuit). A summary is listed [here](https://circuit.github.io/nodejs.html). Runkit allows playing with Node.js modules live, similar to jsbin or jsfiddle on the client. [Try it on runkit](https://runkit.com/rogeru/circuit-sdk)\n\nHere are some snippets to get you started.\n\n#### Create Group Conversation and send text message\nLogon as bot, create a group conversation with two users and send a text message.\n```javascript\nclient.logon()\n  .then(user => console.log(`Logged on as ${user.displayName}`, user))\n  .then(() => client.getUsersByEmail(['kim.jackson@mailinator.com', 'maeva.barnaby@mailinator.com']))\n  .then(users => users.map(user => user.userId))\n  .then(userIds => client.createGroupConversation(userIds, 'runkit example'))\n  .then(conv => client.addTextItem(conv.convId, 'I am test bot. What can I do for you?'))\n  .then(client.logout)\n  .catch(console.error)\n```\n\n#### Get Conversations\nGet 10 newest conversations of logged on user.\n```javascript\nclient.getConversations({numberOfConversations: 10})\n  .then(conversations => console.log(`Retrieved ${conversations.length} conversations`))\n```\n\n#### Video call with another Circuit user\nStart a video call with another user. Create conversation if not yet existing.\n> Only applicable to JavaScript SDK and only on browsers supporting WebRTC\n```javascript\nclient.makeCall('bob@company.com', {audio: true, video: true}, true)\n  .then(call => console.log('New call: ', call));\n```\n\n#### Listen for events\n```javascript\n// Register new items added to the feed of this user. E.g. incoming text message\nclient.addEventListener('itemAdded', item =>\n  console.log('itemAdded event received:', item));\n\n// Register for connection state changes\nclient.addEventListener('connectionStateChanged', evt => {\n  console.log(`New state is ${evt.state}`);\n});\n\n// Register and log all events\nCircuit.supportedEvents.forEach(e => client.addEventListener(e, console.log));\n```\n\n#### Create an injector\nInjectors allow extending the conversation, item and user objects within the SDK.\nIn this example a new attribute `teaser` is created on the item object. This `teaser` will be added to item objects in any reponse or event from the SDK.\n```javascript\nCircuit.Injectors.itemInjector = function (item) {\n  if (item.type === Circuit.Enums.ConversationItemType.TEXT) {\n    // Create item.teaser attribute with replacing br and hr tags with a space\n    item.teaser = item.text.content.replace(/<(br[\\/]?|\\/li|hr[\\/]?)>/gi, ' ');\n  } else {\n    item.teaser = item.type;\n  }\n};\n```\n\n### Supported Browsers\nChrome and Firefox are officially supported.\n\n### Help us improve the SDK\nHelp us improve the SDK or examples by sending us a pull-request or opening a [GitHub Issue](https://github.com/circuit/circuit-sdk/issues/new).\n","readmeFilename":"README.md","gitHead":"4910f23212f38c50bbcebf86edf306e0fdead795","_id":"circuit-sdk@1.2.3400","_npmVersion":"5.3.0","_nodeVersion":"8.8.1","_npmUser":{"name":"rogeru","email":"roger.urscheler@unify.com"},"dist":{"integrity":"sha512-q9AWqkWZr1JAobBhCuV0el1iR45FzdFANZCSqcBRAIZOMxRX3egCcEaTSUizxYptS6+fe4io6KFhwFkWgWCcSQ==","shasum":"08cae8cc070ef6dec3684335c0a21b1f7f452e6f","tarball":"https://registry.npmjs.org/circuit-sdk/-/circuit-sdk-1.2.3400.tgz","fileCount":11,"unpackedSize":2941163,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa+fdNCRA9TVsSAnZWagAArioP/1l+o4oCjj3ky7ccc1WL\nSvcgA712+/1Lhnl6Kg7sTJ1TScn3ccBh+rArBe0tbvnrVzM1QzrDccYLSrxr\n9VMs1S+UlAiLgzGcFfmrm1Kdyu3iibj+MW85rpghy4cAWD/BW/TLvnFxvny4\nj1a6sK6tovfnQuAn9IkI2GkXyhWWrQaiQKV2J6yNBd8mW4dG2oPUCG8kXNxN\nEFolx1lr4GJ+Po0Pka6QM1J6adXTumTRD2mOSwSMY9WlrPEHz8/UGQa1BUHt\nE4LWrOYvF/Smwvtx3Rcz7h8j4XtZnWnIQVpI+MpNsljxdXj97P1rbE0KCe/+\nVNcxwE3thptBpOqYPWJroIZbGTxJ3aLEhLnpJ2opcqShCqHUzIsBUJgUZ9R6\n8B5SuoVqCcY3YQ8hYMDJQRSH0ApqsZ/v/LT+iiVTNbiu+qgV75MssHZAUBfE\n7wdETvdZ2hvOZD/IlcwShE/YyZSYkctlTiGCwnd0Sj3zfTt8XVmQhc8SVaMm\n5+Z/PEA7zTcD3oOGlxQvR2D4Z3imY1Ug40jMyFmJ/9p+mHicdQkCTcDEP+MJ\nrkOYMVnGyX5+HrDnu1VX+kajbBOU7w04mzv8CurU0rpRacFpE2pcwGDwuob3\nFdxZLZAqVDiJg/Q2xkEonGK7VikO3nkadxs5yjEBUdJiybjYDNXkrkPZ2Dxo\nmgFW\r\n=zdmn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDF7hDanzOyLmPvHExjiIXJXli8IXfkWEZJ2yROJiaI4gIhAJ54dDeIuBtZCPz7bZ7ME6N23KiblwvQhxCjipfmPPwr"}]},"maintainers":[{"name":"rogeru","email":"roger.urscheler@unify.com"},{"name":"rpastro","email":"rodrigo.pastro@unify.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/circuit-sdk_1.2.3400_1526331212241_0.9283559310756295"},"_hasShrinkwrap":false},"1.2.3600":{"name":"circuit-sdk","version":"1.2.3600","description":"Circuit SDK","main":"circuit-node.js","scripts":{"test:browser":"node test/index","test:node":"mocha ./test/node/* --recursive --timeout=5000 --exit","test":"npm run test:node && npm run test:browser"},"author":{"name":"Unify Inc."},"contributors":[{"name":"Roger Urscheler","email":"roger.urscheler@unify.com"},{"name":"Rodrigo Pastro","email":"rodrigo.pastro@unify.com"},{"name":"Johannes Ruetschi","email":"johannes.ruetschi@unify.com"}],"license":"Apache-2.0","homepage":"https://github.com/circuit/circuit-sdk","engines":{"node":">= 4.5.0"},"repository":{"type":"git","url":"git://github.com/circuit/circuit-sdk.git"},"bugs":{"url":"http://github.com/circuit/circuit-sdk/issues"},"keywords":["api","webrtc","circuit","collaboration","sdk"],"browser":{"electron":false,"./circuit-node.js":"./circuit.js"},"unpkg":"circuit.min.js","dependencies":{"ws":"~3.3.3"},"devDependencies":{"chai":"^4.1.2","express":"^4.16.2","globby":"^8.0.1","minimist":"^1.2.0","mocha":"^5.0.1","puppeteer":"^1.1.1","serve-static":"^1.13.2"},"readme":"Circuit JavaScript and Node.js SDK\n==================================\n\n[![NPM release](https://img.shields.io/npm/v/circuit-sdk/beta.svg)](https://www.npmjs.com/package/circuit-sdk)\n[![Build Status](https://travis-ci.org/circuit/circuit-sdk.svg?branch=beta)](https://travis-ci.org/circuit/circuit-sdk)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n\n### Prerequisites\n* Developer account on circuitsandbox.net. Get it for free at [developer registration](https://www.circuit.com/web/developers/registration).\n* OAuth 2.0 `client_id` and optionally `client_secret`. Get if for free at [circuit.github.com/oauth](https://circuit.github.com/oauth).\n\n\n### API Reference\nhttps://circuitsandbox.net/sdk/ with most APIs described in the [Client](https://circuitsandbox.net/sdk/classes/Client.html) class.\n\nMore info at [circuit.github.io](https://circuit.github.io/).\n\n### Usage\n\n#### JavaScript\nAdd the the line below to the HTML file of your app. This will include the latest version of Circuit SDK and make the `Circuit` object available.\n```html\n<script type=\"text/javascript\" src=\"https://unpkg.com/circuit-sdk@beta\"></script>\n```\n\n> Starting version 1.2.2800 the JS SDK can also be imported via CommonJS or AMD. View the repo [UMD](https://github.com/circuit/umd) for the different types of usage, or [circuit-ionic-start](https://github.com/circuit/circuit-ionic-starter) for example how import the SDK via `require` using webpack.\n\n#### Node.js\n```bash\nnpm install --save circuit-sdk@beta\n```\n\n### Application Types\nThe majority of apps fall in one of the three types below. Each type uses a different OAuth 2.0 Grant.\n\n1. **Client-side web applications** use the JavaScript SDK with the [OAuth 2.0 Implicit Grant](https://circuit.github.io/oauth.html#implicit).\n   ```javascript\n   // No client_secret needed for Implicit Grant. SDK will obtain access token.\n   let client = new Circuit.Client({\n     client_id: '<your client_id>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon()\n     .then(user => console.log('Logged on as ' + user.displayName))\n   ```\n\n2. **Server-side web applications** use the JavaScript SDK (or [REST API](https://circuitsandbox.net/rest/v2/swagger/ui/index.html)) on the client, but handle the authentication flow on the server using the [OAuth 2.0 Authorization Code Grant](https://circuit.github.io/oauth.html#authorization_code). The access token is obtained on the server and then passed to the client to use in the Circuit JavaScript SDK. These apps may also use the Node.js SDK on the server side to act on behalf of the user.<br>\nExample apps: [node-linkify](https://github.com/circuit/node-linkify) or [circuit-google-assistant](https://github.com/circuit/circuit-google-assistant)\n   ```javascript\n   // access token is obtained and managed by server-side app\n   let client = new Circuit.Client({\n     client_id: '<your client_id>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon({accessToken: '<access_token>'})\n     .then(user => console.log('Logged on as ' + user.displayName))\n   ```\n\n3. **Bots** use the [Node.js SDK](https://www.npmjs.com/package/circuit-sdk) or the [REST API](https://circuitsandbox.net/rest/v2/swagger/ui/index.html) and use the [OAuth 2.0 Client Credentials Grant](https://circuit.github.io/oauth.html#client_credentials). Bots are a special type of user; they don't login on behalf of a regular user, hence no OAuth popup asking for a user`s credentials and permissions.<br>\nExample bots: [xlator-bot](https://github.com/circuit/xlator-bot) or [node-sdk-example](https://github.com/circuit/node-sdk-example)<br>\nExample electron bots: [webrtc-bot-example](https://github.com/circuit/webrtc-bot-example) or [live-cam-bot](https://github.com/circuit/live-cam-bot)\n   ```javascript\n   const Circuit = require('circuit-sdk');\n   let client = new Circuit.Client({\n     client_id: '<client_id>',\n     client_secret: '<client_secret>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon()\n     .then(user => console.log('Logged on as bot: ' + user.emailAddress))\n   ```\n\n\n\n### Examples\n\n> JavaScript examples are located at [/examples/js](/examples/js) with more examples on [jsbin](https://circuit.github.io/jssdk.html#jsbin).\n\n> Node.js example apps are on [github](https://github.com/circuit). A summary is listed [here](https://circuit.github.io/nodejs.html). Runkit allows playing with Node.js modules live, similar to jsbin or jsfiddle on the client. [Try it on runkit](https://runkit.com/rogeru/circuit-sdk)\n\nHere are some snippets to get you started.\n\n#### Create Group Conversation and send text message\nLogon as bot, create a group conversation with two users and send a text message.\n```javascript\nclient.logon()\n  .then(user => console.log(`Logged on as ${user.displayName}`, user))\n  .then(() => client.getUsersByEmail(['kim.jackson@mailinator.com', 'maeva.barnaby@mailinator.com']))\n  .then(users => users.map(user => user.userId))\n  .then(userIds => client.createGroupConversation(userIds, 'runkit example'))\n  .then(conv => client.addTextItem(conv.convId, 'I am test bot. What can I do for you?'))\n  .then(client.logout)\n  .catch(console.error)\n```\n\n#### Get Conversations\nGet 10 newest conversations of logged on user.\n```javascript\nclient.getConversations({numberOfConversations: 10})\n  .then(conversations => console.log(`Retrieved ${conversations.length} conversations`))\n```\n\n#### Video call with another Circuit user\nStart a video call with another user. Create conversation if not yet existing.\n> Only applicable to JavaScript SDK and only on browsers supporting WebRTC\n```javascript\nclient.makeCall('bob@company.com', {audio: true, video: true}, true)\n  .then(call => console.log('New call: ', call));\n```\n\n#### Listen for events\n```javascript\n// Register new items added to the feed of this user. E.g. incoming text message\nclient.addEventListener('itemAdded', item =>\n  console.log('itemAdded event received:', item));\n\n// Register for connection state changes\nclient.addEventListener('connectionStateChanged', evt => {\n  console.log(`New state is ${evt.state}`);\n});\n\n// Register and log all events\nCircuit.supportedEvents.forEach(e => client.addEventListener(e, console.log));\n```\n\n#### Create an injector\nInjectors allow extending the conversation, item and user objects within the SDK.\nIn this example a new attribute `teaser` is created on the item object. This `teaser` will be added to item objects in any reponse or event from the SDK.\n```javascript\nCircuit.Injectors.itemInjector = function (item) {\n  if (item.type === Circuit.Enums.ConversationItemType.TEXT) {\n    // Create item.teaser attribute with replacing br and hr tags with a space\n    item.teaser = item.text.content.replace(/<(br[\\/]?|\\/li|hr[\\/]?)>/gi, ' ');\n  } else {\n    item.teaser = item.type;\n  }\n};\n```\n\n### Supported Browsers\nChrome and Firefox are officially supported.\n\n### Help us improve the SDK\nHelp us improve the SDK or examples by sending us a pull-request or opening a [GitHub Issue](https://github.com/circuit/circuit-sdk/issues/new).\n","readmeFilename":"README.md","gitHead":"c6f95edcad037737d94145740f1f26896816d9f3","_id":"circuit-sdk@1.2.3600","_npmVersion":"5.3.0","_nodeVersion":"6.11.5","_npmUser":{"name":"rogeru","email":"roger.urscheler@unify.com"},"dist":{"integrity":"sha512-hr+Wl/siY6QfcexG4ayheDGqDLM4zbMxtR+Uk4T82Ek1CLxZYB2felj+roHRsiKZfJNTXMRc1/k8a4GXgyXrkQ==","shasum":"73d212cca8903734772c121e46ed4a88aa116eab","tarball":"https://registry.npmjs.org/circuit-sdk/-/circuit-sdk-1.2.3600.tgz","fileCount":11,"unpackedSize":3035470,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbGm1iCRA9TVsSAnZWagAAsGoP/iWSoRaPvjtfIJKLdKz0\nmzaFEKIUU/1XOW51QJ42jBYyZ6pQXP5ifb2ZMhgMt4sD25iSkYUEl6lFdXeT\ntZVSJIObL72oQiLp8HQmxoIBgmxApUd8+41oa62cjSjMLnlwmkxf585sS125\n+nVRVBEYykGc5SyPfg9554B0OU4qTJtzrB4jK77wx9OBMYc+Sm1ylQCbnAqG\n5olUObY+n2MkzUey5zjNwj0NZAh1orG3AIbMyQqPJFrw7kl4XYw2xWIQRC8c\nEiyfy5D5cTKT9nmp7WiKRt4es04SWXJ2tHRIfnB7ezaoAcvJ6Fy2YzTMMPHh\nLXlhz6ikyI3tHTahHvTOvC57MX12XWmFZOdy/mt5NSAfamt3K2i9PPx7Rk6t\nmW3GZaEPdEbMFeaRjybZeye+Taju4ygk/q3oiiG+2I4wpPSPMnn3RHJ9Or6v\n5deKqwwE+mBjJOTS0fUAR4eVUOzYaQlcp3lWikXd4b2rIjB0DdcJ/0e9VqIe\n/EgM3PAtiC3c/udEBwTsqcjqLFazkameuXVA3gbNgajBYvY3aAmBh6L2jGcy\nNlpFdpVVu3gGxUMpFuICiqYldbtDpM/RNpd0/enMw/hBXqy9hVFKI53Oov5L\nuKKOa7+bWVD83DimtCHJSFbFfQ+ouk3ZQP3qaJ7nk9riYOe0wcuyLLhGPaYT\nTg6U\r\n=FqXv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCe/d27wrrc104p06j3dZxyysmUGjOIgPnkskUG2KISPwIhAKqjaZLpOIAciDMW0VUwQ8Res2yephPwQihV2EFVyU9q"}]},"maintainers":[{"name":"rogeru","email":"roger.urscheler@unify.com"},{"name":"rpastro","email":"rodrigo.pastro@unify.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/circuit-sdk_1.2.3600_1528458593629_0.5378899322952093"},"_hasShrinkwrap":false},"1.2.3503":{"name":"circuit-sdk","version":"1.2.3503","description":"Circuit SDK","main":"circuit-node.js","scripts":{"test:browser":"node test/index","test:node":"mocha ./test/node/* --recursive --timeout=5000 --exit","test":"npm run test:node && npm run test:browser"},"author":{"name":"Unify Inc."},"contributors":[{"name":"Roger Urscheler","email":"roger.urscheler@unify.com"},{"name":"Rodrigo Pastro","email":"rodrigo.pastro@unify.com"},{"name":"Johannes Ruetschi","email":"johannes.ruetschi@unify.com"}],"license":"Apache-2.0","homepage":"https://github.com/circuit/circuit-sdk","engines":{"node":">= 4.5.0"},"repository":{"type":"git","url":"git://github.com/circuit/circuit-sdk.git"},"bugs":{"url":"http://github.com/circuit/circuit-sdk/issues"},"keywords":["api","webrtc","circuit","collaboration","sdk"],"browser":{"electron":false,"./circuit-node.js":"./circuit.js"},"unpkg":"circuit.min.js","dependencies":{"ws":"~3.3.3"},"devDependencies":{"chai":"^4.1.2","express":"^4.16.2","globby":"^8.0.1","minimist":"^1.2.0","mocha":"^5.0.1","puppeteer":"^1.1.1","serve-static":"^1.13.2"},"gitHead":"7e5f578c3d00be8e754d452e31ed62ac9737468a","_id":"circuit-sdk@1.2.3503","_npmVersion":"5.3.0","_nodeVersion":"8.8.1","_npmUser":{"name":"rogeru","email":"roger.urscheler@unify.com"},"dist":{"integrity":"sha512-Mk7bGXWlX496WtLjIPTUwNzmq3KREieiOxiMxd/YrRtkoUF9EZZtXT1auqvDEtrXmmEFNOKdHkuFMIYbfZ1e4Q==","shasum":"3a806137bceddf2de6e599d6bf90aa884eb3c2b4","tarball":"https://registry.npmjs.org/circuit-sdk/-/circuit-sdk-1.2.3503.tgz","fileCount":11,"unpackedSize":3021928,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbJ7mgCRA9TVsSAnZWagAAiewP/1VjstTS6u7B785UDaBI\n781lEwq/FsSgrVWRKVaf+yJ4YYUnaWOtOiv364ZRpu+c/cGrgB5rkNXDJepy\nbMv8tvse9dmJt8PhPBUiI7rpNF1gTjrGO0eZ87zfp8XriZHbva6MYfeqoMSz\nlCK7xu3pWULUU/0GM26AIo5a09JpZyE66ckItK+ySnDXk8kBTcIkIcoaVKVy\nWiVh36zMF2ETsfCiPP3vPijmCK6dxZtVEADh+BnA0InKtL2i2L9naoEyqUIW\niEWJs0PIPmrP9z+gYY9ChdQmkZcQsxYkzzqHUuuUXjyjDeHvh2AbumYU/kCD\n691/+35WW1I3IssYWe1KqC8PeWWZ05Mpbrl9OWARC1gYiGuY1U9hEEBL1/xB\nxGtHtJ4zNXqMH0xVkFUXGOqCgC+7+ajcTdkhdwYEG9JsZI6s3rixxg7XI3Lh\nHRnIYqZy95mUin4aDHNCQI2NsMzXIOOwu69vCn2PTM0AE9CfbwrmH4qOnVYc\noSFiREpQlavc4Pd+IRWL7YyYcRzNCabU6CbHQ188yb/Se/qTMFNbbhoqC3W3\nnZWbxLJs29mzmpNi3Up5rIddw7xdb3c7UTHVSPbk9yWlRkwx7TZKbePg5cTV\nZAk1Hb2LBoiGPsh+lXd0yFZPHV3qru1gE8sycW8D8OU+56DWv7Jd6+Kuv1db\nMAv1\r\n=/Vbt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCC+oaGR65u3fH0EKjYjkR4zb9OpdFvfmQBJJr57xFtwgIhAOee5asleaXadH7VGl5zI2s/tXxkpPtHyQEn816MCT8h"}]},"maintainers":[{"name":"rogeru","email":"roger.urscheler@unify.com"},{"name":"rpastro","email":"rodrigo.pastro@unify.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/circuit-sdk_1.2.3503_1529330078344_0.6633690002866197"},"_hasShrinkwrap":false},"1.2.3700":{"name":"circuit-sdk","version":"1.2.3700","description":"Circuit SDK","main":"circuit-node.js","scripts":{"test:browser":"node test/index","test:node":"mocha ./test/node/* --recursive --timeout=5000 --exit","test":"npm run test:node && npm run test:browser"},"author":{"name":"Unify Inc."},"contributors":[{"name":"Roger Urscheler","email":"roger.urscheler@unify.com"},{"name":"Rodrigo Pastro","email":"rodrigo.pastro@unify.com"},{"name":"Johannes Ruetschi","email":"johannes.ruetschi@unify.com"}],"license":"Apache-2.0","homepage":"https://github.com/circuit/circuit-sdk","engines":{"node":">= 4.5.0"},"repository":{"type":"git","url":"git://github.com/circuit/circuit-sdk.git"},"bugs":{"url":"http://github.com/circuit/circuit-sdk/issues"},"keywords":["api","webrtc","circuit","collaboration","sdk"],"browser":{"electron":false,"./circuit-node.js":"./circuit.js"},"unpkg":"circuit.min.js","dependencies":{"ws":"~3.3.3"},"devDependencies":{"chai":"^4.1.2","express":"^4.16.2","globby":"^8.0.1","minimist":"^1.2.0","mocha":"^5.0.1","puppeteer":"^1.1.1","serve-static":"^1.13.2"},"readme":"Circuit JavaScript and Node.js SDK\n==================================\n\n[![NPM release](https://img.shields.io/npm/v/circuit-sdk/beta.svg)](https://www.npmjs.com/package/circuit-sdk)\n[![Build Status](https://travis-ci.org/circuit/circuit-sdk.svg?branch=beta)](https://travis-ci.org/circuit/circuit-sdk)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n\n### Prerequisites\n* Developer account on circuitsandbox.net. Get it for free at [developer registration](https://www.circuit.com/web/developers/registration).\n* OAuth 2.0 `client_id` and optionally `client_secret`. Get if for free at [circuit.github.com/oauth](https://circuit.github.com/oauth).\n\n\n### API Reference\nhttps://circuitsandbox.net/sdk/ with most APIs described in the [Client](https://circuitsandbox.net/sdk/classes/Client.html) class.\n\nMore info at [circuit.github.io](https://circuit.github.io/).\n\n### Usage\n\n#### JavaScript\nAdd the the line below to the HTML file of your app. This will include the latest version of Circuit SDK and make the `Circuit` object available.\n```html\n<script type=\"text/javascript\" src=\"https://unpkg.com/circuit-sdk@beta\"></script>\n```\n\n> Starting version 1.2.2800 the JS SDK can also be imported via CommonJS or AMD. View the repo [UMD](https://github.com/circuit/umd) for the different types of usage, or [circuit-ionic-start](https://github.com/circuit/circuit-ionic-starter) for example how import the SDK via `require` using webpack.\n\n#### Node.js\n```bash\nnpm install --save circuit-sdk@beta\n```\n\n### Application Types\nThe majority of apps fall in one of the three types below. Each type uses a different OAuth 2.0 Grant.\n\n1. **Client-side web applications** use the JavaScript SDK with the [OAuth 2.0 Implicit Grant](https://circuit.github.io/oauth.html#implicit).\n   ```javascript\n   // No client_secret needed for Implicit Grant. SDK will obtain access token.\n   let client = new Circuit.Client({\n     client_id: '<your client_id>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon()\n     .then(user => console.log('Logged on as ' + user.displayName))\n   ```\n\n2. **Server-side web applications** use the JavaScript SDK (or [REST API](https://circuitsandbox.net/rest/v2/swagger/ui/index.html)) on the client, but handle the authentication flow on the server using the [OAuth 2.0 Authorization Code Grant](https://circuit.github.io/oauth.html#authorization_code). The access token is obtained on the server and then passed to the client to use in the Circuit JavaScript SDK. These apps may also use the Node.js SDK on the server side to act on behalf of the user.<br>\nExample apps: [node-linkify](https://github.com/circuit/node-linkify) or [circuit-google-assistant](https://github.com/circuit/circuit-google-assistant)\n   ```javascript\n   // access token is obtained and managed by server-side app\n   let client = new Circuit.Client({\n     client_id: '<your client_id>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon({accessToken: '<access_token>'})\n     .then(user => console.log('Logged on as ' + user.displayName))\n   ```\n\n3. **Bots** use the [Node.js SDK](https://www.npmjs.com/package/circuit-sdk) or the [REST API](https://circuitsandbox.net/rest/v2/swagger/ui/index.html) and use the [OAuth 2.0 Client Credentials Grant](https://circuit.github.io/oauth.html#client_credentials). Bots are a special type of user; they don't login on behalf of a regular user, hence no OAuth popup asking for a user`s credentials and permissions.<br>\nExample bots: [xlator-bot](https://github.com/circuit/xlator-bot) or [node-sdk-example](https://github.com/circuit/node-sdk-example)<br>\nExample electron bots: [webrtc-bot-example](https://github.com/circuit/webrtc-bot-example) or [live-cam-bot](https://github.com/circuit/live-cam-bot)\n   ```javascript\n   const Circuit = require('circuit-sdk');\n   let client = new Circuit.Client({\n     client_id: '<client_id>',\n     client_secret: '<client_secret>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon()\n     .then(user => console.log('Logged on as bot: ' + user.emailAddress))\n   ```\n\n\n\n### Examples\n\n> JavaScript examples are located at [/examples/js](/examples/js) with more examples on [jsbin](https://circuit.github.io/jssdk.html#jsbin).\n\n> Node.js example apps are on [github](https://github.com/circuit). A summary is listed [here](https://circuit.github.io/nodejs.html). Runkit allows playing with Node.js modules live, similar to jsbin or jsfiddle on the client. [Try it on runkit](https://runkit.com/rogeru/circuit-sdk)\n\nHere are some snippets to get you started.\n\n#### Create Group Conversation and send text message\nLogon as bot, create a group conversation with two users and send a text message.\n```javascript\nclient.logon()\n  .then(user => console.log(`Logged on as ${user.displayName}`, user))\n  .then(() => client.getUsersByEmail(['kim.jackson@mailinator.com', 'maeva.barnaby@mailinator.com']))\n  .then(users => users.map(user => user.userId))\n  .then(userIds => client.createGroupConversation(userIds, 'runkit example'))\n  .then(conv => client.addTextItem(conv.convId, 'I am test bot. What can I do for you?'))\n  .then(client.logout)\n  .catch(console.error)\n```\n\n#### Get Conversations\nGet 10 newest conversations of logged on user.\n```javascript\nclient.getConversations({numberOfConversations: 10})\n  .then(conversations => console.log(`Retrieved ${conversations.length} conversations`))\n```\n\n#### Video call with another Circuit user\nStart a video call with another user. Create conversation if not yet existing.\n> Only applicable to JavaScript SDK and only on browsers supporting WebRTC\n```javascript\nclient.makeCall('bob@company.com', {audio: true, video: true}, true)\n  .then(call => console.log('New call: ', call));\n```\n\n#### Listen for events\n```javascript\n// Register new items added to the feed of this user. E.g. incoming text message\nclient.addEventListener('itemAdded', item =>\n  console.log('itemAdded event received:', item));\n\n// Register for connection state changes\nclient.addEventListener('connectionStateChanged', evt => {\n  console.log(`New state is ${evt.state}`);\n});\n\n// Register and log all events\nCircuit.supportedEvents.forEach(e => client.addEventListener(e, console.log));\n```\n\n#### Create an injector\nInjectors allow extending the conversation, item and user objects within the SDK.\nIn this example a new attribute `teaser` is created on the item object. This `teaser` will be added to item objects in any reponse or event from the SDK.\n```javascript\nCircuit.Injectors.itemInjector = function (item) {\n  if (item.type === Circuit.Enums.ConversationItemType.TEXT) {\n    // Create item.teaser attribute with replacing br and hr tags with a space\n    item.teaser = item.text.content.replace(/<(br[\\/]?|\\/li|hr[\\/]?)>/gi, ' ');\n  } else {\n    item.teaser = item.type;\n  }\n};\n```\n\n### Supported Browsers\nChrome and Firefox are officially supported.\n\n### Help us improve the SDK\nHelp us improve the SDK or examples by sending us a pull-request or opening a [GitHub Issue](https://github.com/circuit/circuit-sdk/issues/new).\n","readmeFilename":"README.md","gitHead":"2ab843d39e9da9eb17931400e48894b92e709d72","_id":"circuit-sdk@1.2.3700","_npmVersion":"5.3.0","_nodeVersion":"6.11.5","_npmUser":{"name":"rogeru","email":"roger.urscheler@unify.com"},"dist":{"integrity":"sha512-QZdeV64Mtk9a35K3pCW0gcEv9ws9rRQpI7PRSjFxzedusKJUZUPfZzLDJsE1IyzqWeFeLIIIGeWsLdnuiRnf3A==","shasum":"3951ec7cf487ec19aaa295ad4a1d5217b5447df7","tarball":"https://registry.npmjs.org/circuit-sdk/-/circuit-sdk-1.2.3700.tgz","fileCount":11,"unpackedSize":3058558,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbLRyDCRA9TVsSAnZWagAARH0P/3ocxqWdqXAvnYpmW7jP\ncg9Ip/mDhWLv0xY6IxESVnjr2g4nWIMR/Zndj51vvMlBLzi8d7FN5iEH9ZmE\nrQWrHJPZuLoC1cCp8a/xajOTDxr8Jjk9uSzxD8hK5Jr7bmxl2osfVdko9Myg\nSEAi2+Pak6TATRM1Tr9mEeGPfqxMs5XVz8Wqp4fSW5qS4PT6rfikcTOHStnQ\n8Ogqi5mbt/2cnJQpG/9JM22HDRhy/miET63vMT4UBD7eN9sKsvIdbYx5+jj0\niDirq8uN4O6npsntj78wGRevVEdob+PmMFHS8oId6xUu7QjAcXXgDCWnlDbb\nrkR4MyvBygVc9j+FrQFbwa9J3Ky5YW8WaeqWSlVm3+Zcd8M+6AtTD0XJ6Jfw\nBhlvRQViG+zRnUDz+A4hmcxUr5ndcyEXuF6l2U0eIBbG/U2HfYwi1Jyp4ro4\nU3RJfnGQ3u00ZRsT89I8RSYbR/eLvIcbHeOu52M3MamPj+0w59F+4r84QRH3\nrwm4dOnhq8Zwi8v5lcDiZ12HUnplIlI0ttrLZIvm4Yq7xOeFCvBntqykFd+/\nFHMaQ60i8/Yl7kWd7WAgf3JMdhdp6XwlbBDkvlLPQcSYArBrx2hBpm0YqP4P\n0dJ6XZQgAlQvIstXaMH6B3HD14rQkqVvjoxqoRnuwnWUMF7WKKsef1PktJ1t\n4StJ\r\n=XvgC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDofRh0N4pE5BwMBBqPhMrVo3XD6uTfX30y0kWn3uvbcgIhAJGWK+J2R4tTWT671pxJumromBXZkgZDEY7YOt1UQCCo"}]},"maintainers":[{"name":"rogeru","email":"roger.urscheler@unify.com"},{"name":"rpastro","email":"rodrigo.pastro@unify.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/circuit-sdk_1.2.3700_1529683075544_0.28547119303038837"},"_hasShrinkwrap":false},"1.2.3900":{"name":"circuit-sdk","version":"1.2.3900","description":"Circuit SDK","main":"circuit-node.js","scripts":{"test:browser":"node test/index","test:node":"mocha ./test/node/* --recursive --timeout=5000 --exit","test":"npm run test:node && npm run test:browser"},"author":{"name":"Unify Inc."},"contributors":[{"name":"Roger Urscheler","email":"roger.urscheler@unify.com"},{"name":"Rodrigo Pastro","email":"rodrigo.pastro@unify.com"},{"name":"Johannes Ruetschi","email":"johannes.ruetschi@unify.com"}],"license":"Apache-2.0","homepage":"https://github.com/circuit/circuit-sdk","engines":{"node":">= 4.5.0"},"repository":{"type":"git","url":"git://github.com/circuit/circuit-sdk.git"},"bugs":{"url":"http://github.com/circuit/circuit-sdk/issues"},"keywords":["api","webrtc","circuit","collaboration","sdk"],"browser":{"electron":false,"./circuit-node.js":"./circuit.js"},"unpkg":"circuit.min.js","dependencies":{"ws":"~3.3.3"},"devDependencies":{"chai":"^4.1.2","express":"^4.16.2","globby":"^8.0.1","minimist":"^1.2.0","mocha":"^5.0.1","puppeteer":"^1.1.1","serve-static":"^1.13.2"},"readme":"Circuit JavaScript and Node.js SDK\n==================================\n\n[![NPM release](https://img.shields.io/npm/v/circuit-sdk/beta.svg)](https://www.npmjs.com/package/circuit-sdk)\n[![Build Status](https://travis-ci.org/circuit/circuit-sdk.svg?branch=beta)](https://travis-ci.org/circuit/circuit-sdk)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n\n### Prerequisites\n* Developer account on circuitsandbox.net. Get it for free at [developer registration](https://www.circuit.com/web/developers/registration).\n* OAuth 2.0 `client_id` and optionally `client_secret`. Get if for free at [circuit.github.com/oauth](https://circuit.github.com/oauth).\n\n\n### API Reference\nhttps://circuitsandbox.net/sdk/ with most APIs described in the [Client](https://circuitsandbox.net/sdk/classes/Client.html) class.\n\nMore info at [circuit.github.io](https://circuit.github.io/).\n\n### Usage\n\n#### JavaScript\nAdd the the line below to the HTML file of your app. This will include the latest version of Circuit SDK and make the `Circuit` object available.\n```html\n<script type=\"text/javascript\" src=\"https://unpkg.com/circuit-sdk@beta\"></script>\n```\n\n> Starting version 1.2.2800 the JS SDK can also be imported via CommonJS or AMD. View the repo [UMD](https://github.com/circuit/umd) for the different types of usage, or [circuit-ionic-start](https://github.com/circuit/circuit-ionic-starter) for example how import the SDK via `require` using webpack.\n\n#### Node.js\n```bash\nnpm install --save circuit-sdk@beta\n```\n\n### Application Types\nThe majority of apps fall in one of the three types below. Each type uses a different OAuth 2.0 Grant.\n\n1. **Client-side web applications** use the JavaScript SDK with the [OAuth 2.0 Implicit Grant](https://circuit.github.io/oauth.html#implicit).\n   ```javascript\n   // No client_secret needed for Implicit Grant. SDK will obtain access token.\n   let client = new Circuit.Client({\n     client_id: '<your client_id>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon()\n     .then(user => console.log('Logged on as ' + user.displayName))\n   ```\n\n2. **Server-side web applications** use the JavaScript SDK (or [REST API](https://circuitsandbox.net/rest/v2/swagger/ui/index.html)) on the client, but handle the authentication flow on the server using the [OAuth 2.0 Authorization Code Grant](https://circuit.github.io/oauth.html#authorization_code). The access token is obtained on the server and then passed to the client to use in the Circuit JavaScript SDK. These apps may also use the Node.js SDK on the server side to act on behalf of the user.<br>\nExample apps: [node-linkify](https://github.com/circuit/node-linkify) or [circuit-google-assistant](https://github.com/circuit/circuit-google-assistant)\n   ```javascript\n   // access token is obtained and managed by server-side app\n   let client = new Circuit.Client({\n     client_id: '<your client_id>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon({accessToken: '<access_token>'})\n     .then(user => console.log('Logged on as ' + user.displayName))\n   ```\n\n3. **Bots** use the [Node.js SDK](https://www.npmjs.com/package/circuit-sdk) or the [REST API](https://circuitsandbox.net/rest/v2/swagger/ui/index.html) and use the [OAuth 2.0 Client Credentials Grant](https://circuit.github.io/oauth.html#client_credentials). Bots are a special type of user; they don't login on behalf of a regular user, hence no OAuth popup asking for a user`s credentials and permissions.<br>\nExample bots: [xlator-bot](https://github.com/circuit/xlator-bot) or [node-sdk-example](https://github.com/circuit/node-sdk-example)<br>\nExample electron bots: [webrtc-bot-example](https://github.com/circuit/webrtc-bot-example) or [live-cam-bot](https://github.com/circuit/live-cam-bot)\n   ```javascript\n   const Circuit = require('circuit-sdk');\n   let client = new Circuit.Client({\n     client_id: '<client_id>',\n     client_secret: '<client_secret>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon()\n     .then(user => console.log('Logged on as bot: ' + user.emailAddress))\n   ```\n\n\n\n### Examples\n\n> JavaScript examples are located at [/examples/js](/examples/js) with more examples on [jsbin](https://circuit.github.io/jssdk.html#jsbin).\n\n> Node.js example apps are on [github](https://github.com/circuit). A summary is listed [here](https://circuit.github.io/nodejs.html). Runkit allows playing with Node.js modules live, similar to jsbin or jsfiddle on the client. [Try it on runkit](https://runkit.com/rogeru/circuit-sdk)\n\nHere are some snippets to get you started.\n\n#### Create Group Conversation and send text message\nLogon as bot, create a group conversation with two users and send a text message.\n```javascript\nclient.logon()\n  .then(user => console.log(`Logged on as ${user.displayName}`, user))\n  .then(() => client.getUsersByEmail(['kim.jackson@mailinator.com', 'maeva.barnaby@mailinator.com']))\n  .then(users => users.map(user => user.userId))\n  .then(userIds => client.createGroupConversation(userIds, 'runkit example'))\n  .then(conv => client.addTextItem(conv.convId, 'I am test bot. What can I do for you?'))\n  .then(client.logout)\n  .catch(console.error)\n```\n\n#### Get Conversations\nGet 10 newest conversations of logged on user.\n```javascript\nclient.getConversations({numberOfConversations: 10})\n  .then(conversations => console.log(`Retrieved ${conversations.length} conversations`))\n```\n\n#### Video call with another Circuit user\nStart a video call with another user. Create conversation if not yet existing.\n> Only applicable to JavaScript SDK and only on browsers supporting WebRTC\n```javascript\nclient.makeCall('bob@company.com', {audio: true, video: true}, true)\n  .then(call => console.log('New call: ', call));\n```\n\n#### Listen for events\n```javascript\n// Register new items added to the feed of this user. E.g. incoming text message\nclient.addEventListener('itemAdded', item =>\n  console.log('itemAdded event received:', item));\n\n// Register for connection state changes\nclient.addEventListener('connectionStateChanged', evt => {\n  console.log(`New state is ${evt.state}`);\n});\n\n// Register and log all events\nCircuit.supportedEvents.forEach(e => client.addEventListener(e, console.log));\n```\n\n#### Create an injector\nInjectors allow extending the conversation, item and user objects within the SDK.\nIn this example a new attribute `teaser` is created on the item object. This `teaser` will be added to item objects in any reponse or event from the SDK.\n```javascript\nCircuit.Injectors.itemInjector = function (item) {\n  if (item.type === Circuit.Enums.ConversationItemType.TEXT) {\n    // Create item.teaser attribute with replacing br and hr tags with a space\n    item.teaser = item.text.content.replace(/<(br[\\/]?|\\/li|hr[\\/]?)>/gi, ' ');\n  } else {\n    item.teaser = item.type;\n  }\n};\n```\n\n### Supported Browsers\nChrome and Firefox are officially supported.\n\n### Help us improve the SDK\nHelp us improve the SDK or examples by sending us a pull-request or opening a [GitHub Issue](https://github.com/circuit/circuit-sdk/issues/new).\n","readmeFilename":"README.md","gitHead":"061fe5f4c9cc24aa57cc63c1a4252c484c8e7310","_id":"circuit-sdk@1.2.3900","_npmVersion":"5.3.0","_nodeVersion":"8.8.1","_npmUser":{"name":"rogeru","email":"roger.urscheler@unify.com"},"dist":{"integrity":"sha512-CoCnT+N6ggYsNL6zKp5LEqYEuNLxj5sAO3JD2zi8v7ihzGjxHIil254TiNeHdeXvNQJ/T4GICq0DbvuUNDFdOw==","shasum":"aa84b58ab56a9f96211d51c7b4580917e4832d66","tarball":"https://registry.npmjs.org/circuit-sdk/-/circuit-sdk-1.2.3900.tgz","fileCount":11,"unpackedSize":3090140,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbUgDnCRA9TVsSAnZWagAAZlcP/2jVWttB+XK8OwVbPAhd\n/fJBDK4Ew5uiSXlgvRO3sMIUAmMsT9Xra2EcFM8qCO5LO2fIJMpQAf+VAuBo\n4uWLIlYCInh1Ew2cX5vVS0aKR24dbCPCVxymSB438rC37NnnhROUfcuTRDC2\n+h/Lfc5LwpEouxhWOiqgnJl5Fs2q117pKRxslw0+hWleCMj/wEqfNsFlJ4yJ\nciKskvRhOnKdFKDEjCXoBE9x61Ko/fq/f/c/HiwDiyQaCE47w8XJO9arOzCm\nICrQYbwesHPM+VLnZmp9py6GyUwkKa/FBVsvWdJN6EOBD/nAS/sR4Ln7E3uh\nVhcfRwtY2u92mb6XDc7Rsh2WvVOrRtnvtrIpcL4Gb2i4BzDKU4Dv9/MMbPMf\nEgIxo4oztMY86lwe8TBpVaWU4hloDktZ41QjNsY/+/PJAoA1iNWmbBgJA6xu\nuKc6RX5iTGRk/AWc82/+40XtWIWEgeEKJq49XHHN2ldxwt6mxP695WrdTebh\nxwQxNkibM2nScYNHXIrM2SzPsKjrrC4d7CrBs7DOHT0h7RlfTuuNAFj1SWVn\nJ/XyJAS+fcKdao6xVE9DAOrPWnFwS0kOhE7O2uw/i5MI0z4vx1Ec+K08xGXY\nyO7YSFaO+shWUCCo5iI6InLTgE3uClYAk4yXkwlvsGEiMefM4gFtsH+pWvVw\n1vrw\r\n=Af6y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC4abit0UGSV+mAXLuYtqVwle74wHMYXhudBmvVMhBSJgIgP6jzq84kMBUe5KqQGJ1SGVIp9fb5eajZQfCWr1MNO1k="}]},"maintainers":[{"name":"rogeru","email":"roger.urscheler@unify.com"},{"name":"rpastro","email":"rodrigo.pastro@unify.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/circuit-sdk_1.2.3900_1532100839399_0.9344573014946689"},"_hasShrinkwrap":false},"1.2.3704":{"name":"circuit-sdk","version":"1.2.3704","description":"Circuit SDK","main":"circuit-node.js","scripts":{"test:browser":"node test/index","test:node":"mocha ./test/node/* --recursive --timeout=5000 --exit","test":"npm run test:node && npm run test:browser"},"author":{"name":"Unify Inc."},"contributors":[{"name":"Roger Urscheler","email":"roger.urscheler@unify.com"},{"name":"Rodrigo Pastro","email":"rodrigo.pastro@unify.com"},{"name":"Johannes Ruetschi","email":"johannes.ruetschi@unify.com"}],"license":"Apache-2.0","homepage":"https://github.com/circuit/circuit-sdk","engines":{"node":">= 4.5.0"},"repository":{"type":"git","url":"git://github.com/circuit/circuit-sdk.git"},"bugs":{"url":"http://github.com/circuit/circuit-sdk/issues"},"keywords":["api","webrtc","circuit","collaboration","sdk"],"browser":{"electron":false,"./circuit-node.js":"./circuit.js"},"unpkg":"circuit.min.js","dependencies":{"ws":"~3.3.3"},"devDependencies":{"chai":"^4.1.2","express":"^4.16.2","globby":"^8.0.1","minimist":"^1.2.0","mocha":"^5.0.1","puppeteer":"^1.1.1","serve-static":"^1.13.2"},"gitHead":"4ad1cb038288346c322ac5892e999431249b19e4","_id":"circuit-sdk@1.2.3704","_npmVersion":"5.3.0","_nodeVersion":"8.8.1","_npmUser":{"name":"rogeru","email":"roger.urscheler@unify.com"},"dist":{"integrity":"sha512-O+OiW+4A+9J3vWM7Mp6AoiYkzHmh263tES4BOvUhDA4VfFZ5IAM+droJZ8PO2y9HjIH/BofXc+OuUAlrqRHgNQ==","shasum":"8c38786a8a18ec61c48c9f363213e801dfbe6acd","tarball":"https://registry.npmjs.org/circuit-sdk/-/circuit-sdk-1.2.3704.tgz","fileCount":11,"unpackedSize":3063466,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbVe1oCRA9TVsSAnZWagAAK2AQAIM8RL67sbw66v77xqDG\nUjyzueyb2jnE06ORXGaBbnjeCm9UMjAG079OITDHJlF2oFzzE02y8jBO1J92\nBaZnUK1DLFxUxorsazWA5kzugzxPjgEbzjWv7d978Hpgm09aAEivGf2hwLt2\nNnRyUw5DroTJ4tJF6bmzztCS54grYcdpc+xMmK8YH3sTXLwSrYEBbjHjO/jj\nbtZUxCoBMrHomJLIyVF4DVF8mpvjZQfLRcL7HcWEmmi76FFsOALkGotoDTH0\nwqZalCI9uVdESRhkwXdFMoLSjuMA1HtK0Vk4q359gHZknzZ46bptH8JmcYXx\n62Rwvdv3SsGvcOHynuVoztEFS1BhS39KuOVlBt2jnuUFIo9IZJm25xEY24lT\nGoisO1EUW27eze4wUXu8rk3CGmSUnKuFCtaTHnr8exSSzKqG5ID2zkIVC7Bu\nNg1kBg6W3TCtmi/5U5Nu132XMv47a5xIfYZuauilL6y1tPWll8o4e33ZQZQC\no5U1dHAg+u+vMaWGYrRpXG5n3qBLSSDBhWbNGyowjASJWfoiQ1N8etXf9lWE\nsZUsf6XY2SD5fPZrvHJx3bDkpDchCHW/dzWTbteB0VdaF5hOqv75VCIhq6Pk\nYZ3jUgYKNOQ/Sl96SAKUU8avltBMpUxy7C0IJDykp0BJY4GstnufO/j0c/Qm\nJQwp\r\n=tftL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG/QausykFRRgAG6xg4xoE3pMoh95cLPClen2SGUJSGwAiAMfGKWr4TQGjYcYfNlo/lJwwCwhCiKboQe5Fqa08R2Pg=="}]},"maintainers":[{"name":"rogeru","email":"roger.urscheler@unify.com"},{"name":"rpastro","email":"rodrigo.pastro@unify.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/circuit-sdk_1.2.3704_1532357992054_0.6094246534643515"},"_hasShrinkwrap":false},"1.2.3902":{"name":"circuit-sdk","version":"1.2.3902","description":"Circuit SDK","main":"circuit-node.js","scripts":{"test:browser":"node test/index","test:node":"mocha ./test/node/* --recursive --timeout=5000 --exit","test":"npm run test:node && npm run test:browser"},"author":{"name":"Unify Inc."},"contributors":[{"name":"Roger Urscheler","email":"roger.urscheler@unify.com"},{"name":"Rodrigo Pastro","email":"rodrigo.pastro@unify.com"},{"name":"Johannes Ruetschi","email":"johannes.ruetschi@unify.com"}],"license":"Apache-2.0","homepage":"https://github.com/circuit/circuit-sdk","engines":{"node":">= 4.5.0"},"repository":{"type":"git","url":"git://github.com/circuit/circuit-sdk.git"},"bugs":{"url":"http://github.com/circuit/circuit-sdk/issues"},"keywords":["api","webrtc","circuit","collaboration","sdk"],"browser":{"electron":false,"./circuit-node.js":"./circuit.js"},"unpkg":"circuit.min.js","dependencies":{"ws":"~3.3.3"},"devDependencies":{"chai":"^4.1.2","express":"^4.16.2","globby":"^8.0.1","minimist":"^1.2.0","mocha":"^5.0.1","puppeteer":"^1.1.1","serve-static":"^1.13.2"},"gitHead":"aabea35ef47c8652062df8e6cfa5c3ea1e2b9ff8","_id":"circuit-sdk@1.2.3902","_npmVersion":"5.3.0","_nodeVersion":"8.8.1","_npmUser":{"name":"rogeru","email":"roger.urscheler@unify.com"},"dist":{"integrity":"sha512-cufLCISd1U46Qao+ix92HRsTBi8b6XfSPw/hF7ehQhBvkn+ge7oldFfUA4JPOmTFGwtqx9GBkRCsd94Uphh4yA==","shasum":"9dce036f5aa30f63baafe912e56126cfa6d7075f","tarball":"https://registry.npmjs.org/circuit-sdk/-/circuit-sdk-1.2.3902.tgz","fileCount":11,"unpackedSize":3090789,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbcwc/CRA9TVsSAnZWagAAaHkP/An3rX6DurjXCJHA/lZ3\nAr37wTUf/W39tG5CnHYo47J89HinLylTHqTJLHT6JO9nzJYHnwwSdKJCuQxs\naNb0+zf5f862Ew5AdsEKNKul/5Spu+aaht8WnOnNnbzQfz5556GcWlyS3oOT\nyXJ2oRGtN20jO4ObTkeNgIDGmZ1INMBcYJlA5PNaLc/Wnkd1HLkjLVqVe44u\nhxQJWwTWC6FRWJsLUQZt/wIrA5yZQ3R80CYhnkuAhS2P+fbIM0ryS2AmXgoq\nBz+nJmrIfMlxxGYBDYA5hFyljTo3pw11coAz8c9j6YJdA1HKzQY5ZkK95gil\n6aNF27o07N5SU0Q0NbrIKuDs/l0h8ekmzA2hiNFFuwYWNaMStbhET35RJlU9\nDAOzZtk9ZkxLpgEXL5jN0QJfOWpW9Y30LOdigRL8objpNhQtIXNmk4jWyhUi\nou+9ZOIcf7M/R0v63Li2AhBqQ9V6bfkpddTcd8AFgKc/mtvsbXbsTiZcmHnD\na0BWrsbsrlfBA2kzzXZYd0jzeUhN7YqAcPh0hXn1phBNRqcrnydXPsce4vGc\nuBlMApjdhbzzgJ75wnz+P/T36LJkq42zSLCaXcnUVgEv1OjznBp71zNRn8bt\nBcXdO1EbfY6kNzBEsLNoph5Yyt1uLmOeiHUgm/zkNc7W+tXQdyKl75CLvtKd\nV9wl\r\n=649R\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDjjvAwnoT1SoSv6IiNvmdY96rqaW/GCtCraaYAOxI3DgIgH4FtBDSMSH0Ph96D0jjWJTeI/Ne2g0MjpkZm0uCCPwc="}]},"maintainers":[{"name":"rogeru","email":"roger.urscheler@unify.com"},{"name":"rpastro","email":"rodrigo.pastro@unify.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/circuit-sdk_1.2.3902_1534265150670_0.7017091940877325"},"_hasShrinkwrap":false},"1.2.4000":{"name":"circuit-sdk","version":"1.2.4000","description":"Circuit SDK","main":"circuit-node.js","scripts":{"test:browser":"node test/index","test:node":"mocha ./test/node/* --recursive --timeout=5000 --exit","test":"npm run test:node && npm run test:browser"},"author":{"name":"Unify Inc."},"contributors":[{"name":"Roger Urscheler","email":"roger.urscheler@unify.com"},{"name":"Rodrigo Pastro","email":"rodrigo.pastro@unify.com"},{"name":"Johannes Ruetschi","email":"johannes.ruetschi@unify.com"}],"license":"Apache-2.0","homepage":"https://github.com/circuit/circuit-sdk","engines":{"node":">= 4.5.0"},"repository":{"type":"git","url":"git://github.com/circuit/circuit-sdk.git"},"bugs":{"url":"http://github.com/circuit/circuit-sdk/issues"},"keywords":["api","webrtc","circuit","collaboration","sdk"],"browser":{"electron":false,"./circuit-node.js":"./circuit.js"},"unpkg":"circuit.min.js","dependencies":{"ws":"~3.3.3"},"devDependencies":{"chai":"^4.1.2","express":"^4.16.2","globby":"^8.0.1","minimist":"^1.2.0","mocha":"^5.0.1","puppeteer":"^1.1.1","serve-static":"^1.13.2"},"readme":"Circuit JavaScript and Node.js SDK\n==================================\n\n[![NPM release](https://img.shields.io/npm/v/circuit-sdk/beta.svg)](https://www.npmjs.com/package/circuit-sdk)\n[![Build Status](https://travis-ci.org/circuit/circuit-sdk.svg?branch=beta)](https://travis-ci.org/circuit/circuit-sdk)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n\n### Prerequisites\n* Developer account on circuitsandbox.net. Get it for free at [developer registration](https://www.circuit.com/web/developers/registration).\n* OAuth 2.0 `client_id` and optionally `client_secret`. Get if for free at [circuit.github.com/oauth](https://circuit.github.com/oauth).\n\n\n### API Reference\nhttps://circuitsandbox.net/sdk/ with most APIs described in the [Client](https://circuitsandbox.net/sdk/classes/Client.html) class.\n\nMore info at [circuit.github.io](https://circuit.github.io/).\n\n### Usage\n\n#### JavaScript\nAdd the the line below to the HTML file of your app. This will include the latest version of Circuit SDK and make the `Circuit` object available.\n```html\n<script type=\"text/javascript\" src=\"https://unpkg.com/circuit-sdk@beta\"></script>\n```\n\n> Starting version 1.2.2800 the JS SDK can also be imported via CommonJS or AMD. View the repo [UMD](https://github.com/circuit/umd) for the different types of usage, or [circuit-ionic-start](https://github.com/circuit/circuit-ionic-starter) for example how import the SDK via `require` using webpack.\n\n#### Node.js\n```bash\nnpm install --save circuit-sdk@beta\n```\n\n### Application Types\nThe majority of apps fall in one of the three types below. Each type uses a different OAuth 2.0 Grant.\n\n1. **Client-side web applications** use the JavaScript SDK with the [OAuth 2.0 Implicit Grant](https://circuit.github.io/oauth.html#implicit).\n   ```javascript\n   // No client_secret needed for Implicit Grant. SDK will obtain access token.\n   let client = new Circuit.Client({\n     client_id: '<your client_id>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon()\n     .then(user => console.log('Logged on as ' + user.displayName))\n   ```\n\n2. **Server-side web applications** use the JavaScript SDK (or [REST API](https://circuitsandbox.net/rest/v2/swagger/ui/index.html)) on the client, but handle the authentication flow on the server using the [OAuth 2.0 Authorization Code Grant](https://circuit.github.io/oauth.html#authorization_code). The access token is obtained on the server and then passed to the client to use in the Circuit JavaScript SDK. These apps may also use the Node.js SDK on the server side to act on behalf of the user.<br>\nExample apps: [node-linkify](https://github.com/circuit/node-linkify) or [circuit-google-assistant](https://github.com/circuit/circuit-google-assistant)\n   ```javascript\n   // access token is obtained and managed by server-side app\n   let client = new Circuit.Client({\n     client_id: '<your client_id>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon({accessToken: '<access_token>'})\n     .then(user => console.log('Logged on as ' + user.displayName))\n   ```\n\n3. **Bots** use the [Node.js SDK](https://www.npmjs.com/package/circuit-sdk) or the [REST API](https://circuitsandbox.net/rest/v2/swagger/ui/index.html) and use the [OAuth 2.0 Client Credentials Grant](https://circuit.github.io/oauth.html#client_credentials). Bots are a special type of user; they don't login on behalf of a regular user, hence no OAuth popup asking for a user`s credentials and permissions.<br>\nExample bots: [xlator-bot](https://github.com/circuit/xlator-bot) or [node-sdk-example](https://github.com/circuit/node-sdk-example)<br>\nExample electron bots: [webrtc-bot-example](https://github.com/circuit/webrtc-bot-example) or [live-cam-bot](https://github.com/circuit/live-cam-bot)\n   ```javascript\n   const Circuit = require('circuit-sdk');\n   let client = new Circuit.Client({\n     client_id: '<client_id>',\n     client_secret: '<client_secret>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon()\n     .then(user => console.log('Logged on as bot: ' + user.emailAddress))\n   ```\n\n\n\n### Examples\n\n> JavaScript examples are located at [/examples/js](/examples/js) with more examples on [jsbin](https://circuit.github.io/jssdk.html#jsbin).\n\n> Node.js example apps are on [github](https://github.com/circuit). A summary is listed [here](https://circuit.github.io/nodejs.html). Runkit allows playing with Node.js modules live, similar to jsbin or jsfiddle on the client. [Try it on runkit](https://runkit.com/rogeru/circuit-sdk)\n\nHere are some snippets to get you started.\n\n#### Create Group Conversation and send text message\nLogon as bot, create a group conversation with two users and send a text message.\n```javascript\nclient.logon()\n  .then(user => console.log(`Logged on as ${user.displayName}`, user))\n  .then(() => client.getUsersByEmail(['kim.jackson@mailinator.com', 'maeva.barnaby@mailinator.com']))\n  .then(users => users.map(user => user.userId))\n  .then(userIds => client.createGroupConversation(userIds, 'runkit example'))\n  .then(conv => client.addTextItem(conv.convId, 'I am test bot. What can I do for you?'))\n  .then(client.logout)\n  .catch(console.error)\n```\n\n#### Get Conversations\nGet 10 newest conversations of logged on user.\n```javascript\nclient.getConversations({numberOfConversations: 10})\n  .then(conversations => console.log(`Retrieved ${conversations.length} conversations`))\n```\n\n#### Video call with another Circuit user\nStart a video call with another user. Create conversation if not yet existing.\n> Only applicable to JavaScript SDK and only on browsers supporting WebRTC\n```javascript\nclient.makeCall('bob@company.com', {audio: true, video: true}, true)\n  .then(call => console.log('New call: ', call));\n```\n\n#### Listen for events\n```javascript\n// Register new items added to the feed of this user. E.g. incoming text message\nclient.addEventListener('itemAdded', item =>\n  console.log('itemAdded event received:', item));\n\n// Register for connection state changes\nclient.addEventListener('connectionStateChanged', evt => {\n  console.log(`New state is ${evt.state}`);\n});\n\n// Register and log all events\nCircuit.supportedEvents.forEach(e => client.addEventListener(e, console.log));\n```\n\n#### Create an injector\nInjectors allow extending the conversation, item and user objects within the SDK.\nIn this example a new attribute `teaser` is created on the item object. This `teaser` will be added to item objects in any reponse or event from the SDK.\n```javascript\nCircuit.Injectors.itemInjector = function (item) {\n  if (item.type === Circuit.Enums.ConversationItemType.TEXT) {\n    // Create item.teaser attribute with replacing br and hr tags with a space\n    item.teaser = item.text.content.replace(/<(br[\\/]?|\\/li|hr[\\/]?)>/gi, ' ');\n  } else {\n    item.teaser = item.type;\n  }\n};\n```\n\n### Supported Browsers\nChrome and Firefox are officially supported.\n\n### Help us improve the SDK\nHelp us improve the SDK or examples by sending us a pull-request or opening a [GitHub Issue](https://github.com/circuit/circuit-sdk/issues/new).\n","readmeFilename":"README.md","gitHead":"8e43302a43511e15fa421e61a8547a6ac6cd1da8","_id":"circuit-sdk@1.2.4000","_npmVersion":"5.3.0","_nodeVersion":"8.8.1","_npmUser":{"name":"rogeru","email":"roger.urscheler@unify.com"},"dist":{"integrity":"sha512-KS70+XOsvGMDLK9gIhRTh0oPj7x/M/E1keDBSkj8xckJBPW6KaWvMdu7i4xkKmXY0dEeEWe+Au/n8kuCjEzrxg==","shasum":"732404af4471fc0d9b7fb05674ae1a1308f45c1e","tarball":"https://registry.npmjs.org/circuit-sdk/-/circuit-sdk-1.2.4000.tgz","fileCount":11,"unpackedSize":3109091,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbcwlkCRA9TVsSAnZWagAAdoIP/itN/pNqiiCnw3aJIjAz\n42UMDkfIWvtiOQTaKYeme4mjowy5ygEknjKdT9w3rQtMUzSf4NjVpnTIf5Cn\n/6jv4u4dobd/BT/f0wnt6BE90GZUuLlmuVCHSob4IQ0S0NeETT8JDos1TpNX\nmSx5dQpjG08rpIr53DZGJil1J7di5K7mG4yyoSckRaTs1Mv61ALSVmJ16g8d\nAhGSAWQTOLylwzuqj3KTkgl0Six9Jdd1r6uYlZ87yTOQBeyAn86FcWsh9U/G\nSrpMwcfJpe68MC75/7HgkucD03V5b8YLNjzcOrGEul6Hyw+k8obNEUdmOds8\nP88tsqR4YNTLYkrf8RK7YiTm0/FlKhsy3zArnSMOWCrRBz1b0xw4hT4aia0B\n0tQkNsahgt0UVbzt087Z2gEZVCcIbCVp9SC4o5lvd6is5iW+bGhhA+4ma8JP\nWV7VLV6pkUEmD1IAItMnqpVwe2htTnilKWzzcOkfMyz7PBwWXFOajZu1qSzH\nnlO8/zaLghc6JaqerMkdJa7vBq2vQCCFA9cmWIHOT18wDo+fJoCBpJY+c+22\nRDOgb0ar1CeFqsFWMbLHUyBbS9C/MMYMDsQWI1cOHs+umQn59V5NbHoixgXB\n6q5yQpQwuMEDGPi+LTh7LQhcIiUEQN2IgJgrj4DB0X1gowu0iNAOxzzAgpEe\nM7LX\r\n=yQw+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDk9d19ElxByoVCZXZN+iOvOjIbEZ7b/ngB1LXlRl1ZgwIhAMBs4MYzsY8n4tLAFPKMBuKePI3RGWc7Lur/jkZPoZsU"}]},"maintainers":[{"name":"rogeru","email":"roger.urscheler@unify.com"},{"name":"rpastro","email":"rodrigo.pastro@unify.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/circuit-sdk_1.2.4000_1534265699928_0.31558757817666594"},"_hasShrinkwrap":false},"1.2.4101":{"name":"circuit-sdk","version":"1.2.4101","description":"Circuit SDK","main":"circuit-node.js","scripts":{"test:browser":"node test/index","test:node":"mocha ./test/node/* --recursive --timeout=5000 --exit","test":"npm run test:node && npm run test:browser"},"author":{"name":"Unify Inc."},"contributors":[{"name":"Roger Urscheler","email":"roger.urscheler@unify.com"},{"name":"Rodrigo Pastro","email":"rodrigo.pastro@unify.com"},{"name":"Johannes Ruetschi","email":"johannes.ruetschi@unify.com"}],"license":"Apache-2.0","homepage":"https://github.com/circuit/circuit-sdk","engines":{"node":">= 4.5.0"},"repository":{"type":"git","url":"git://github.com/circuit/circuit-sdk.git"},"bugs":{"url":"http://github.com/circuit/circuit-sdk/issues"},"keywords":["api","webrtc","circuit","collaboration","sdk"],"browser":{"electron":false,"./circuit-node.js":"./circuit.js"},"unpkg":"circuit.min.js","dependencies":{"ws":"~3.3.3"},"devDependencies":{"chai":"^4.1.2","express":"^4.16.2","globby":"^8.0.1","minimist":"^1.2.0","mocha":"^5.0.1","puppeteer":"^1.1.1","serve-static":"^1.13.2"},"gitHead":"6ff17b7ca65df05952d753188076a78b76166cd7","_id":"circuit-sdk@1.2.4101","_npmVersion":"5.3.0","_nodeVersion":"8.8.1","_npmUser":{"name":"rogeru","email":"roger.urscheler@unify.com"},"dist":{"integrity":"sha512-0tQg/0RP8Karvj/xt9WPwk0D5QouuS2gXTM26TH3IRtmUkCTq5wF90rjxgbpsC/BKWdH0BMU3eG901FJgchfKg==","shasum":"616ffa3ce5ab8b7e2767cbf4f1a8e4cc31d69631","tarball":"https://registry.npmjs.org/circuit-sdk/-/circuit-sdk-1.2.4101.tgz","fileCount":11,"unpackedSize":3134886,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbj9LVCRA9TVsSAnZWagAASW8P/3qSQFpfp5lFeOHXIjB6\nWyQpOkJ792eJ4Ahha/Kp5U7YosPc2vvL11xK58fL72UVkjHtXhvmhBOnAP+s\nFD76/uz7jG27CoGEGE3P/I1WHDO87M1yLvkgKtxJbYrqCE+0LYHVc0uVn99j\nNarJXXh2NXgPJRkjz4IGNgCyKHPouf3zcEoO04oSzpQKNP267hRscnhZHQrT\nP4yhMu0SdOzqMfseQhfoOrLwZ44PJ9R34tkR3PpcTku7lEMBQl+HtipiAs0m\nz5o16cmRdktLH3VnXjZ74aDcZshu58xcT68xXuX74dnpfN80soM/SsXBI6UW\nEdGHfEqGIWy9LZITZWfxLwVETSnCsmM842LP+UwK2dLVSs29SS1vyc4DiMM5\n8OiA+DsWFeJk2+RpKN6Dl0FSg/7g7MJoPRBYAGQHhIlvjBmx7arIW9DXHXGB\nC1/EzhS3B/dWdoq0jdOvkhMZFjsV5GaaNKKx63IeyushZkmiNCBv7RYWREsM\nMuflAOxQiQAPdiJK2cyc/b2SflHjXVMDaTs+QlOzDr5AEriBPbLheStOeaxh\nkCEnSM32pw3gptFU6z4uStI25xW+M2G13L+ZMLQj+9W5WnxytZllvpi2FjIZ\n/dzU2OI0GXkaZJIhUNeLxZRXMsmlCY2GaToLi5Jbr9qxhyZ7dnDj8hZFmZe6\nZe81\r\n=3vDr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCwXVIvDLs68+4sbmMDGtOe8Q2ddVKfAON+JVj6hUNU2AIhAIXyodgQbs5wOZE3QVfbHJOioy96t/4whNNSnlL3TmRD"}]},"maintainers":[{"name":"rogeru","email":"roger.urscheler@unify.com"},{"name":"rpastro","email":"rodrigo.pastro@unify.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/circuit-sdk_1.2.4101_1536152277208_0.6091219095736153"},"_hasShrinkwrap":false},"1.2.4200":{"name":"circuit-sdk","version":"1.2.4200","description":"Circuit SDK","main":"circuit-node.js","scripts":{"test:browser":"node test/index","test:node":"mocha ./test/node/* --recursive --timeout=5000 --exit","test":"npm run test:node && npm run test:browser"},"author":{"name":"Unify Inc."},"contributors":[{"name":"Roger Urscheler","email":"roger.urscheler@unify.com"},{"name":"Rodrigo Pastro","email":"rodrigo.pastro@unify.com"},{"name":"Johannes Ruetschi","email":"johannes.ruetschi@unify.com"}],"license":"Apache-2.0","homepage":"https://github.com/circuit/circuit-sdk","engines":{"node":">= 4.5.0"},"repository":{"type":"git","url":"git://github.com/circuit/circuit-sdk.git"},"bugs":{"url":"http://github.com/circuit/circuit-sdk/issues"},"keywords":["api","webrtc","circuit","collaboration","sdk"],"browser":{"electron":false,"./circuit-node.js":"./circuit.js"},"unpkg":"circuit.min.js","dependencies":{"ws":"~3.3.3"},"devDependencies":{"chai":"^4.1.2","express":"^4.16.2","globby":"^8.0.1","minimist":"^1.2.0","mocha":"^5.0.1","puppeteer":"^1.1.1","serve-static":"^1.13.2"},"readme":"Circuit JavaScript and Node.js SDK\n==================================\n\n[![NPM release](https://img.shields.io/npm/v/circuit-sdk/beta.svg)](https://www.npmjs.com/package/circuit-sdk)\n[![Build Status](https://travis-ci.org/circuit/circuit-sdk.svg?branch=beta)](https://travis-ci.org/circuit/circuit-sdk)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n\n### Prerequisites\n* Developer account on circuitsandbox.net. Get it for free at [developer registration](https://www.circuit.com/web/developers/registration).\n* OAuth 2.0 `client_id` and optionally `client_secret`. Get if for free at [circuit.github.com/oauth](https://circuit.github.com/oauth).\n\n\n### API Reference\nhttps://circuitsandbox.net/sdk/ with most APIs described in the [Client](https://circuitsandbox.net/sdk/classes/Client.html) class.\n\nMore info at [circuit.github.io](https://circuit.github.io/).\n\n### Usage\n\n#### JavaScript\nAdd the the line below to the HTML file of your app. This will include the latest version of Circuit SDK and make the `Circuit` object available.\n```html\n<script type=\"text/javascript\" src=\"https://unpkg.com/circuit-sdk@beta\"></script>\n```\n\n> Starting version 1.2.2800 the JS SDK can also be imported via CommonJS or AMD. View the repo [UMD](https://github.com/circuit/umd) for the different types of usage, or [circuit-ionic-start](https://github.com/circuit/circuit-ionic-starter) for example how import the SDK via `require` using webpack.\n\n#### Node.js\n```bash\nnpm install --save circuit-sdk@beta\n```\n\n### Application Types\nThe majority of apps fall in one of the three types below. Each type uses a different OAuth 2.0 Grant.\n\n1. **Client-side web applications** use the JavaScript SDK with the [OAuth 2.0 Implicit Grant](https://circuit.github.io/oauth.html#implicit).\n   ```javascript\n   // No client_secret needed for Implicit Grant. SDK will obtain access token.\n   let client = new Circuit.Client({\n     client_id: '<your client_id>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon()\n     .then(user => console.log('Logged on as ' + user.displayName))\n   ```\n\n2. **Server-side web applications** use the JavaScript SDK (or [REST API](https://circuitsandbox.net/rest/v2/swagger/ui/index.html)) on the client, but handle the authentication flow on the server using the [OAuth 2.0 Authorization Code Grant](https://circuit.github.io/oauth.html#authorization_code). The access token is obtained on the server and then passed to the client to use in the Circuit JavaScript SDK. These apps may also use the Node.js SDK on the server side to act on behalf of the user.<br>\nExample apps: [node-linkify](https://github.com/circuit/node-linkify) or [circuit-google-assistant](https://github.com/circuit/circuit-google-assistant)\n   ```javascript\n   // access token is obtained and managed by server-side app\n   let client = new Circuit.Client({\n     client_id: '<your client_id>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon({accessToken: '<access_token>'})\n     .then(user => console.log('Logged on as ' + user.displayName))\n   ```\n\n3. **Bots** use the [Node.js SDK](https://www.npmjs.com/package/circuit-sdk) or the [REST API](https://circuitsandbox.net/rest/v2/swagger/ui/index.html) and use the [OAuth 2.0 Client Credentials Grant](https://circuit.github.io/oauth.html#client_credentials). Bots are a special type of user; they don't login on behalf of a regular user, hence no OAuth popup asking for a user`s credentials and permissions.<br>\nExample bots: [xlator-bot](https://github.com/circuit/xlator-bot) or [node-sdk-example](https://github.com/circuit/node-sdk-example)<br>\nExample electron bots: [webrtc-bot-example](https://github.com/circuit/webrtc-bot-example) or [live-cam-bot](https://github.com/circuit/live-cam-bot)\n   ```javascript\n   const Circuit = require('circuit-sdk');\n   let client = new Circuit.Client({\n     client_id: '<client_id>',\n     client_secret: '<client_secret>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon()\n     .then(user => console.log('Logged on as bot: ' + user.emailAddress))\n   ```\n\n\n\n### Examples\n\n> JavaScript examples are located at [/examples/js](/examples/js) with more examples on [jsbin](https://circuit.github.io/jssdk.html#jsbin).\n\n> Node.js example apps are on [github](https://github.com/circuit). A summary is listed [here](https://circuit.github.io/nodejs.html). Runkit allows playing with Node.js modules live, similar to jsbin or jsfiddle on the client. [Try it on runkit](https://runkit.com/rogeru/circuit-sdk)\n\nHere are some snippets to get you started.\n\n#### Create Group Conversation and send text message\nLogon as bot, create a group conversation with two users and send a text message.\n```javascript\nclient.logon()\n  .then(user => console.log(`Logged on as ${user.displayName}`, user))\n  .then(() => client.getUsersByEmail(['kim.jackson@mailinator.com', 'maeva.barnaby@mailinator.com']))\n  .then(users => users.map(user => user.userId))\n  .then(userIds => client.createGroupConversation(userIds, 'runkit example'))\n  .then(conv => client.addTextItem(conv.convId, 'I am test bot. What can I do for you?'))\n  .then(client.logout)\n  .catch(console.error)\n```\n\n#### Get Conversations\nGet 10 newest conversations of logged on user.\n```javascript\nclient.getConversations({numberOfConversations: 10})\n  .then(conversations => console.log(`Retrieved ${conversations.length} conversations`))\n```\n\n#### Video call with another Circuit user\nStart a video call with another user. Create conversation if not yet existing.\n> Only applicable to JavaScript SDK and only on browsers supporting WebRTC\n```javascript\nclient.makeCall('bob@company.com', {audio: true, video: true}, true)\n  .then(call => console.log('New call: ', call));\n```\n\n#### Listen for events\n```javascript\n// Register new items added to the feed of this user. E.g. incoming text message\nclient.addEventListener('itemAdded', item =>\n  console.log('itemAdded event received:', item));\n\n// Register for connection state changes\nclient.addEventListener('connectionStateChanged', evt => {\n  console.log(`New state is ${evt.state}`);\n});\n\n// Register and log all events\nCircuit.supportedEvents.forEach(e => client.addEventListener(e, console.log));\n```\n\n#### Create an injector\nInjectors allow extending the conversation, item and user objects within the SDK.\nIn this example a new attribute `teaser` is created on the item object. This `teaser` will be added to item objects in any reponse or event from the SDK.\n```javascript\nCircuit.Injectors.itemInjector = function (item) {\n  if (item.type === Circuit.Enums.ConversationItemType.TEXT) {\n    // Create item.teaser attribute with replacing br and hr tags with a space\n    item.teaser = item.text.content.replace(/<(br[\\/]?|\\/li|hr[\\/]?)>/gi, ' ');\n  } else {\n    item.teaser = item.type;\n  }\n};\n```\n\n### Supported Browsers\nChrome and Firefox are officially supported.\n\n### Help us improve the SDK\nHelp us improve the SDK or examples by sending us a pull-request or opening a [GitHub Issue](https://github.com/circuit/circuit-sdk/issues/new).\n","readmeFilename":"README.md","gitHead":"18f3a25b7657a789e4995ca68d6efb337d96556c","_id":"circuit-sdk@1.2.4200","_npmVersion":"5.3.0","_nodeVersion":"8.8.1","_npmUser":{"name":"rogeru","email":"roger.urscheler@unify.com"},"dist":{"integrity":"sha512-HvgjgN3ZVMGWPytNVUOIlk8FbggH8vU3xc2KAQNU2XSINXaVccifBDIFHAOc/KsNuZim/5fOyQYLJHggfQHGWg==","shasum":"db5550bfb3dfd2e7e1421935f46a77ee5bc6970e","tarball":"https://registry.npmjs.org/circuit-sdk/-/circuit-sdk-1.2.4200.tgz","fileCount":11,"unpackedSize":3130568,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbj9NRCRA9TVsSAnZWagAAno0P/1f1at0uqVOlSXpmA88l\nQ+hDXciRp3aLU2PKMbXJpVEvB/KJr0CmUIK5i6vne2FlC4IOSdngTnIULNWP\nJMSXlRexRMNH7mrt7vpiGtM1UWS9zYMcU0no3U9HTdGhNbFeYrE70PsQSjUG\nLZV1+RiDq+Prl1XGbJ8eMgauB/+OpqEglYZU00kvU8+NsH+ATGksPdD1BfGj\n9Mlxf2ZH5xIPFe5sjJl38VhnKJS0PiASYKDGpoLsd3zT+3V5t2PVOE/kXBwA\niX/r808bJ8WvVAwhaIRo4hH0bSDTlNE+5/cRgWn63IWUC6odtW97iGS2qpM4\n6zJV0m+HAf9i8qGTEaXoxqVTwULP6JhGZH69nx5ZDIA8SznF6nXc0c9KY4tg\nHHK33LslGnOlq4sbhw/vUkO+jQvNSF3QYkEvnDdc4Ll04tPsgaN2A48StoVf\nykKsL7SyAdfuDnafa560WReIRl+FBFXsFV23EcLsCV2+gYeCNY9jgGC90cXy\nqWbaY7WCY6PABqjD1mZ6izWxBtTYGtWmp8yEOQv4tuuF44Cvb6ObkRYD2CyQ\nqK3Z4Y1p1WmeBnmqhyegCVZC4KH+27vODlqT5VDSk4SrdBCzbSaVDzor1SSd\ngVw5oO4JmVeoni4TaGeUwOu8PU6paoMDRB2MvPzhU7t4EGymErERnsI5SHad\nU6bh\r\n=rysP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB9AYc9He7zLvxRPZhIWaWmSCmpHidEAZkMIjeyw6op8AiAdSwN2aIG1tbIqhYjqHYf08n0tNUlq23METNMiOfXEGw=="}]},"maintainers":[{"name":"rogeru","email":"roger.urscheler@unify.com"},{"name":"rpastro","email":"rodrigo.pastro@unify.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/circuit-sdk_1.2.4200_1536152400272_0.5637633834573159"},"_hasShrinkwrap":false},"1.2.4502":{"name":"circuit-sdk","version":"1.2.4502","description":"Circuit SDK","main":"circuit-node.js","scripts":{"test:browser":"node test/index","test:node":"mocha ./test/node/* --recursive --timeout=5000 --exit","test":"npm run test:node && npm run test:browser"},"author":{"name":"Unify Inc."},"contributors":[{"name":"Roger Urscheler","email":"roger.urscheler@unify.com"},{"name":"Rodrigo Pastro","email":"rodrigo.pastro@unify.com"},{"name":"Johannes Ruetschi","email":"johannes.ruetschi@unify.com"}],"license":"Apache-2.0","homepage":"https://github.com/circuit/circuit-sdk","engines":{"node":">= 4.5.0"},"repository":{"type":"git","url":"git://github.com/circuit/circuit-sdk.git"},"bugs":{"url":"http://github.com/circuit/circuit-sdk/issues"},"keywords":["api","webrtc","circuit","collaboration","sdk"],"browser":{"electron":false,"./circuit-node.js":"./circuit.js"},"unpkg":"circuit.min.js","dependencies":{"ws":"~3.3.3"},"devDependencies":{"chai":"^4.1.2","express":"^4.16.2","globby":"^8.0.1","minimist":"^1.2.0","mocha":"^5.0.1","puppeteer":"^1.1.1","serve-static":"^1.13.2"},"gitHead":"104cbce735d4df6c434f7addee2c3ede81172691","_id":"circuit-sdk@1.2.4502","_npmVersion":"5.3.0","_nodeVersion":"8.11.1","_npmUser":{"name":"rogeru","email":"roger.urscheler@unify.com"},"dist":{"integrity":"sha512-NixVbK5YXFL88b9Rli/+Ww/XUd0WD2lYKzeIuW/kkqVUpZds+9F9LGwPhyP9RqCqIvdQSKy7rVeGI3q0+ztH5Q==","shasum":"072b19737d32c54a7c3287f69b8ea4a0aa851acf","tarball":"https://registry.npmjs.org/circuit-sdk/-/circuit-sdk-1.2.4502.tgz","fileCount":11,"unpackedSize":3189270,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb2G4ICRA9TVsSAnZWagAAVKsP/ix4tvztC/bMZUoBhfH6\n8OG2nnjJzT9mQ13ACl9MnJM/heXfwDJW/qTLkDIKb4fGGTS5WIia/A/173zW\nM0zJKzI10L3zq3SEE+blGfJ6YSv9/+ft/Y63BqY4zBt6VURVwdheNrMBzi9N\niqHSM//mjlmWxe+Mr8MqjnSsyz++jKXLsgIjquN4fo6eCkFg3gKw6WGCNi1A\nv5wqkEP2+RGf5dbv8QndmOq8GC2uzGvmBmi4sZkpS9Rlb8EDW2pE894S7+iz\npxlXricUUg2HfQS2WLvboAye2/LS0bdtZzT7PdYLKV2nmmzcrG+cKxg/tII7\nZQt6dbHhjxJoXu2xAs+3OMgrj2j9RGxsWUaErRmOJVyhGiiw+dZZe1EKv+IW\nQoOa6pnnSr2RhtpUu8cqVqhMXUaBZvyVGj/gs97kl3gnqsIcp9hPZfN87+rT\nUW/1/rBwSEUwOBZjfBx9hahkirFDxIG/gfpzeaXk8EHNVXjm7ltTR7XEFKnQ\nTyImcxcxtECsXvk3X1ruCd+QuiDqHffPafFT63KdJZoahR2S84ZJkPoz3dyI\nsTv7QFs+n4A78xiDzBHP3618LxXylgnm8BtyM2rIhfUh53cZU8k5TY8xn/bI\n3pgszd+vN9Dlv7xu7+8fHKcrwj+HV8FfscHkBLhk2bFYIV/9lJFCX1rDd0ME\nBSRb\r\n=z9+m\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGNvXzNqlNBrKtOMvCx/8KMwrh8+UbYq4RkZJwapFTi9AiEAw92EIJVsKBerFkNLlEBOqanYMYjT39UEeuQOkPtIcjo="}]},"maintainers":[{"name":"rogeru","email":"roger.urscheler@unify.com"},{"name":"rpastro","email":"rodrigo.pastro@unify.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/circuit-sdk_1.2.4502_1540910599767_0.9355927491700333"},"_hasShrinkwrap":false},"1.2.4600":{"name":"circuit-sdk","version":"1.2.4600","description":"Circuit SDK","main":"circuit-node.js","scripts":{"test:browser":"node test/index","test:node":"mocha ./test/node/* --recursive --timeout=5000 --exit","test":"npm run test:node && npm run test:browser"},"author":{"name":"Unify Inc."},"contributors":[{"name":"Roger Urscheler","email":"roger.urscheler@unify.com"},{"name":"Rodrigo Pastro","email":"rodrigo.pastro@unify.com"},{"name":"Johannes Ruetschi","email":"johannes.ruetschi@unify.com"}],"license":"Apache-2.0","homepage":"https://github.com/circuit/circuit-sdk","engines":{"node":">= 4.5.0"},"repository":{"type":"git","url":"git://github.com/circuit/circuit-sdk.git"},"bugs":{"url":"http://github.com/circuit/circuit-sdk/issues"},"keywords":["api","webrtc","circuit","collaboration","sdk"],"browser":{"electron":false,"./circuit-node.js":"./circuit.js"},"unpkg":"circuit.min.js","dependencies":{"ws":"~3.3.3"},"devDependencies":{"chai":"^4.1.2","express":"^4.16.2","globby":"^8.0.1","minimist":"^1.2.0","mocha":"^5.0.1","puppeteer":"^1.1.1","serve-static":"^1.13.2"},"readme":"Circuit JavaScript and Node.js SDK\n==================================\n\n[![NPM release](https://img.shields.io/npm/v/circuit-sdk/beta.svg)](https://www.npmjs.com/package/circuit-sdk)\n[![Build Status](https://travis-ci.org/circuit/circuit-sdk.svg?branch=beta)](https://travis-ci.org/circuit/circuit-sdk)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n\n### Prerequisites\n* Developer account on circuitsandbox.net. Get it for free at [developer registration](https://www.circuit.com/web/developers/registration).\n* OAuth 2.0 `client_id` and optionally `client_secret`. Get if for free at [circuit.github.com/oauth](https://circuit.github.com/oauth).\n\n\n### API Reference\nhttps://circuitsandbox.net/sdk/ with most APIs described in the [Client](https://circuitsandbox.net/sdk/classes/Client.html) class.\n\nMore info at [circuit.github.io](https://circuit.github.io/).\n\n### Usage\n\n#### JavaScript\nAdd the the line below to the HTML file of your app. This will include the latest version of Circuit SDK and make the `Circuit` object available.\n```html\n<script type=\"text/javascript\" src=\"https://unpkg.com/circuit-sdk@beta\"></script>\n```\n\nJS SDK can also be imported via CommonJS or AMD. View the repo [UMD](https://github.com/circuit/umd) for the different types of usage, or [circuit-ionic-start](https://github.com/circuit/circuit-ionic-starter) for example how import the SDK via `require` using webpack.\n\n#### Node.js\n```bash\nnpm install --save circuit-sdk@beta\n```\n\n### Application Types\nThe majority of apps fall in one of the three types below. Each type uses a different OAuth 2.0 Grant.\n\n1. **Client-side web applications** use the JavaScript SDK with the [OAuth 2.0 Implicit Grant](https://circuit.github.io/oauth.html#implicit).\n   ```javascript\n   // No client_secret needed for Implicit Grant. SDK will obtain access token.\n   let client = new Circuit.Client({\n     client_id: '<your client_id>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon()\n     .then(user => console.log('Logged on as ' + user.displayName))\n   ```\n\n2. **Server-side web applications** use the JavaScript SDK (or [REST API](https://circuitsandbox.net/rest/v2/swagger/ui/index.html)) on the client, but handle the authentication flow on the server using the [OAuth 2.0 Authorization Code Grant](https://circuit.github.io/oauth.html#authorization_code). The access token is obtained on the server and then passed to the client to use in the Circuit JavaScript SDK. These apps may also use the Node.js SDK on the server side to act on behalf of the user.<br>\nExample apps: [node-linkify](https://github.com/circuit/node-linkify) or [circuit-google-assistant](https://github.com/circuit/circuit-google-assistant)\n   ```javascript\n   // access token is obtained and managed by server-side app\n   let client = new Circuit.Client({\n     client_id: '<your client_id>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon({accessToken: '<access_token>'})\n     .then(user => console.log('Logged on as ' + user.displayName))\n   ```\n\n3. **Bots** use the [Node.js SDK](https://www.npmjs.com/package/circuit-sdk) or the [REST API](https://circuitsandbox.net/rest/v2/swagger/ui/index.html) and use the [OAuth 2.0 Client Credentials Grant](https://circuit.github.io/oauth.html#client_credentials). Bots are a special type of user; they don't login on behalf of a regular user, hence no OAuth popup asking for a user`s credentials and permissions.<br>\nExample bots: [xlator-bot](https://github.com/circuit/xlator-bot) or [node-sdk-example](https://github.com/circuit/node-sdk-example)<br>\nExample electron bots: [webrtc-bot-example](https://github.com/circuit/webrtc-bot-example) or [live-cam-bot](https://github.com/circuit/live-cam-bot)\n   ```javascript\n   const Circuit = require('circuit-sdk');\n   let client = new Circuit.Client({\n     client_id: '<client_id>',\n     client_secret: '<client_secret>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon()\n     .then(user => console.log('Logged on as bot: ' + user.emailAddress))\n   ```\n\n\n\n### Examples\n\n> JavaScript examples are located at [/examples/js](/examples/js) with more examples on [jsbin](https://circuit.github.io/jssdk.html#jsbin).\n\n> Node.js example apps are on [github](https://github.com/circuit). A summary is listed [here](https://circuit.github.io/nodejs.html). Runkit allows playing with Node.js modules live, similar to jsbin or jsfiddle on the client. [Try it on runkit](https://runkit.com/rogeru/circuit-sdk)\n\nHere are some snippets to get you started.\n\n#### Create Group Conversation and send text message\nLogon as bot, create a group conversation with two users and send a text message.\n```javascript\nclient.logon()\n  .then(user => console.log(`Logged on as ${user.displayName}`, user))\n  .then(() => client.getUsersByEmail(['kim.jackson@mailinator.com', 'maeva.barnaby@mailinator.com']))\n  .then(users => users.map(user => user.userId))\n  .then(userIds => client.createGroupConversation(userIds, 'runkit example'))\n  .then(conv => client.addTextItem(conv.convId, 'I am test bot. What can I do for you?'))\n  .then(client.logout)\n  .catch(console.error)\n```\n\n#### Get Conversations\nGet 10 newest conversations of logged on user.\n```javascript\nclient.getConversations({numberOfConversations: 10})\n  .then(conversations => console.log(`Retrieved ${conversations.length} conversations`))\n```\n\n#### Video call with another Circuit user\nStart a video call with another user. Create conversation if not yet existing.\n> Only applicable to JavaScript SDK and only on browsers supporting WebRTC\n```javascript\nclient.makeCall('bob@company.com', {audio: true, video: true}, true)\n  .then(call => console.log('New call: ', call));\n```\n\n#### Listen for events\n```javascript\n// Register new items added to the feed of this user. E.g. incoming text message\nclient.addEventListener('itemAdded', item =>\n  console.log('itemAdded event received:', item));\n\n// Register for connection state changes\nclient.addEventListener('connectionStateChanged', evt => {\n  console.log(`New state is ${evt.state}`);\n});\n\n// Register and log all events\nCircuit.supportedEvents.forEach(e => client.addEventListener(e, console.log));\n```\n\n#### Create an injector\nInjectors allow extending the conversation, item and user objects within the SDK.\nIn this example a new attribute `teaser` is created on the item object. This `teaser` will be added to item objects in any reponse or event from the SDK.\n```javascript\nCircuit.Injectors.itemInjector = function (item) {\n  if (item.type === Circuit.Enums.ConversationItemType.TEXT) {\n    // Create item.teaser attribute with replacing br and hr tags with a space\n    item.teaser = item.text.content.replace(/<(br[\\/]?|\\/li|hr[\\/]?)>/gi, ' ');\n  } else {\n    item.teaser = item.type;\n  }\n};\n```\n\n### Supported Browsers\nChrome and Firefox are officially supported.\n\n### Help us improve the SDK\nHelp us improve the SDK or examples by sending us a pull-request or opening a [GitHub Issue](https://github.com/circuit/circuit-sdk/issues/new).\n","readmeFilename":"README.md","gitHead":"8245f7a0e47a1cf63676b2269f33cfba322f7a3a","_id":"circuit-sdk@1.2.4600","_npmVersion":"5.3.0","_nodeVersion":"8.11.1","_npmUser":{"name":"rogeru","email":"roger.urscheler@unify.com"},"dist":{"integrity":"sha512-2cQndWLgUdG1X/XLOVt10yyYuez7RTZmEK+nG3sfhPQspzL8RUwID9nNCNe3eTpEuD61CLVWyPRSVKw/78us3A==","shasum":"da93843346755c10c391344fd92ef775d8baa1d3","tarball":"https://registry.npmjs.org/circuit-sdk/-/circuit-sdk-1.2.4600.tgz","fileCount":11,"unpackedSize":3211493,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb2w7UCRA9TVsSAnZWagAAVUgP/20RrXtjIPPyN7UKqNkf\nIpFD/C99rMvWBhFUw9leGulf32eglFTjipmjx2EJng6y5iE0bAUWJ2/rKQUV\nRStSEmDL7ZotxZczN/cJnjl5pz4athdgVdOVpUqD1gm2SRGiG16MPueLuaDI\n9n8lRZMw6ngxgkeqD9M6yUFxDqls/hrtQbXuVq5+ZfcCiAsqmivJNw0g76o2\nfYpMoAwFXtX0vB9SdK5jfnMlM5rXcUmku6yqfSAmYbd5MW3i/mUwIxQ6n11E\n3Acctnv2JsHhylP5jkKPgStWjX87z90RQYv4VtT5sfWcQQHmDA6IglaPZ+/P\nDwBei8i+3jh1Aig4DMzCdLtUx6CacomA289V7GYmKmRzo4GZ4d5XmEi1rKxp\nawhaiCJl0RJIlYYfP+VJEqLcAUT+S77SauzXLs+S+rUFGMlIVVSRDpqZZQS0\nwgmywGDYJGTY2TAzYqAYGBOkW1/pNsQedarvSe6zAp/kUfgyz94ymaqKLL7/\njsByHGTmnKp0rCxv/lwSCEVjr2Ze3dx6bga+sy3tij1ECIjI07wp6x021cu+\n2a6WyYsadE3VVFRaSsY089uGnYPOlUPuiq9gNCw7OPLV7PmelVIaeMuOr8AV\n7HdIIoiThCXXEVhKrnhNsXHvTLUGVFH9GjNSUtsDeBuIk9z1pPfg+t48lZkO\nhXuc\r\n=vYLO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDKwo+GPdVNbGzVf9A1XRdkrUkDHgV6X0c0r9fPfu0xswIgPrBFhz7iwcVhRWgN/J1A3nuH1jlfRuv7rSw6hqy2f7M="}]},"maintainers":[{"name":"rogeru","email":"roger.urscheler@unify.com"},{"name":"rpastro","email":"rodrigo.pastro@unify.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/circuit-sdk_1.2.4600_1541082835199_0.03303589583314026"},"_hasShrinkwrap":false},"1.2.4700":{"name":"circuit-sdk","version":"1.2.4700","description":"Circuit SDK","main":"circuit-node.js","scripts":{"test:browser":"node test/index","test:node":"mocha ./test/node/* --recursive --timeout=5000 --exit","test":"npm run test:node && npm run test:browser"},"author":{"name":"Unify Inc."},"contributors":[{"name":"Roger Urscheler","email":"roger.urscheler@unify.com"},{"name":"Rodrigo Pastro","email":"rodrigo.pastro@unify.com"},{"name":"Johannes Ruetschi","email":"johannes.ruetschi@unify.com"}],"license":"Apache-2.0","homepage":"https://github.com/circuit/circuit-sdk","engines":{"node":">= 4.5.0"},"repository":{"type":"git","url":"git://github.com/circuit/circuit-sdk.git"},"bugs":{"url":"http://github.com/circuit/circuit-sdk/issues"},"keywords":["api","webrtc","circuit","collaboration","sdk"],"browser":{"electron":false,"./circuit-node.js":"./circuit.js"},"unpkg":"circuit.min.js","dependencies":{"ws":"~3.3.3"},"devDependencies":{"chai":"^4.1.2","express":"^4.16.2","globby":"^8.0.1","minimist":"^1.2.0","mocha":"^5.0.1","puppeteer":"^1.1.1","serve-static":"^1.13.2"},"readme":"Circuit JavaScript and Node.js SDK\n==================================\n\n[![NPM release](https://img.shields.io/npm/v/circuit-sdk/beta.svg)](https://www.npmjs.com/package/circuit-sdk)\n[![Build Status](https://travis-ci.org/circuit/circuit-sdk.svg?branch=beta)](https://travis-ci.org/circuit/circuit-sdk)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n\n### Prerequisites\n* Developer account on circuitsandbox.net. Get it for free at [developer registration](https://www.circuit.com/web/developers/registration).\n* OAuth 2.0 `client_id` and optionally `client_secret`. Get if for free at [circuit.github.com/oauth](https://circuit.github.com/oauth).\n\n\n### API Reference\nhttps://circuitsandbox.net/sdk/ with most APIs described in the [Client](https://circuitsandbox.net/sdk/classes/Client.html) class.\n\nMore info at [circuit.github.io](https://circuit.github.io/).\n\n### Usage\n\n#### JavaScript\nAdd the the line below to the HTML file of your app. This will include the latest version of Circuit SDK and make the `Circuit` object available.\n```html\n<script type=\"text/javascript\" src=\"https://unpkg.com/circuit-sdk@beta\"></script>\n```\n\nJS SDK can also be imported via CommonJS or AMD. View the repo [UMD](https://github.com/circuit/umd) for the different types of usage, or [circuit-ionic-start](https://github.com/circuit/circuit-ionic-starter) for example how import the SDK via `require` using webpack.\n\n#### Node.js\n```bash\nnpm install --save circuit-sdk@beta\n```\n\n### Application Types\nThe majority of apps fall in one of the three types below. Each type uses a different OAuth 2.0 Grant.\n\n1. **Client-side web applications** use the JavaScript SDK with the [OAuth 2.0 Implicit Grant](https://circuit.github.io/oauth.html#implicit).\n   ```javascript\n   // No client_secret needed for Implicit Grant. SDK will obtain access token.\n   let client = new Circuit.Client({\n     client_id: '<your client_id>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon()\n     .then(user => console.log('Logged on as ' + user.displayName))\n   ```\n\n2. **Server-side web applications** use the JavaScript SDK (or [REST API](https://circuitsandbox.net/rest/v2/swagger/ui/index.html)) on the client, but handle the authentication flow on the server using the [OAuth 2.0 Authorization Code Grant](https://circuit.github.io/oauth.html#authorization_code). The access token is obtained on the server and then passed to the client to use in the Circuit JavaScript SDK. These apps may also use the Node.js SDK on the server side to act on behalf of the user.<br>\nExample apps: [node-linkify](https://github.com/circuit/node-linkify) or [circuit-google-assistant](https://github.com/circuit/circuit-google-assistant)\n   ```javascript\n   // access token is obtained and managed by server-side app\n   let client = new Circuit.Client({\n     client_id: '<your client_id>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon({accessToken: '<access_token>'})\n     .then(user => console.log('Logged on as ' + user.displayName))\n   ```\n\n3. **Bots** use the [Node.js SDK](https://www.npmjs.com/package/circuit-sdk) or the [REST API](https://circuitsandbox.net/rest/v2/swagger/ui/index.html) and use the [OAuth 2.0 Client Credentials Grant](https://circuit.github.io/oauth.html#client_credentials). Bots are a special type of user; they don't login on behalf of a regular user, hence no OAuth popup asking for a user`s credentials and permissions.<br>\nExample bots: [xlator-bot](https://github.com/circuit/xlator-bot) or [node-sdk-example](https://github.com/circuit/node-sdk-example)<br>\nExample electron bots: [webrtc-bot-example](https://github.com/circuit/webrtc-bot-example) or [live-cam-bot](https://github.com/circuit/live-cam-bot)\n   ```javascript\n   const Circuit = require('circuit-sdk');\n   let client = new Circuit.Client({\n     client_id: '<client_id>',\n     client_secret: '<client_secret>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon()\n     .then(user => console.log('Logged on as bot: ' + user.emailAddress))\n   ```\n\n\n\n### Examples\n\n> JavaScript examples are located at [/examples/js](/examples/js) with more examples on [jsbin](https://circuit.github.io/jssdk.html#jsbin).\n\n> Node.js example apps are on [github](https://github.com/circuit). A summary is listed [here](https://circuit.github.io/nodejs.html). Runkit allows playing with Node.js modules live, similar to jsbin or jsfiddle on the client. [Try it on runkit](https://runkit.com/rogeru/circuit-sdk)\n\nHere are some snippets to get you started.\n\n#### Create Group Conversation and send text message\nLogon as bot, create a group conversation with two users and send a text message.\n```javascript\nclient.logon()\n  .then(user => console.log(`Logged on as ${user.displayName}`, user))\n  .then(() => client.getUsersByEmail(['kim.jackson@mailinator.com', 'maeva.barnaby@mailinator.com']))\n  .then(users => users.map(user => user.userId))\n  .then(userIds => client.createGroupConversation(userIds, 'runkit example'))\n  .then(conv => client.addTextItem(conv.convId, 'I am test bot. What can I do for you?'))\n  .then(client.logout)\n  .catch(console.error)\n```\n\n#### Get Conversations\nGet 10 newest conversations of logged on user.\n```javascript\nclient.getConversations({numberOfConversations: 10})\n  .then(conversations => console.log(`Retrieved ${conversations.length} conversations`))\n```\n\n#### Video call with another Circuit user\nStart a video call with another user. Create conversation if not yet existing.\n> Only applicable to JavaScript SDK and only on browsers supporting WebRTC\n```javascript\nclient.makeCall('bob@company.com', {audio: true, video: true}, true)\n  .then(call => console.log('New call: ', call));\n```\n\n#### Listen for events\n```javascript\n// Register new items added to the feed of this user. E.g. incoming text message\nclient.addEventListener('itemAdded', item =>\n  console.log('itemAdded event received:', item));\n\n// Register for connection state changes\nclient.addEventListener('connectionStateChanged', evt => {\n  console.log(`New state is ${evt.state}`);\n});\n\n// Register and log all events\nCircuit.supportedEvents.forEach(e => client.addEventListener(e, console.log));\n```\n\n#### Create an injector\nInjectors allow extending the conversation, item and user objects within the SDK.\nIn this example a new attribute `teaser` is created on the item object. This `teaser` will be added to item objects in any reponse or event from the SDK.\n```javascript\nCircuit.Injectors.itemInjector = function (item) {\n  if (item.type === Circuit.Enums.ConversationItemType.TEXT) {\n    // Create item.teaser attribute with replacing br and hr tags with a space\n    item.teaser = item.text.content.replace(/<(br[\\/]?|\\/li|hr[\\/]?)>/gi, ' ');\n  } else {\n    item.teaser = item.type;\n  }\n};\n```\n\n### Supported Browsers\nChrome and Firefox are officially supported.\n\n### Help us improve the SDK\nHelp us improve the SDK or examples by sending us a pull-request or opening a [GitHub Issue](https://github.com/circuit/circuit-sdk/issues/new).\n","readmeFilename":"README.md","gitHead":"6b2c902f9d2f85d664539e42dfd4c7db129bc635","_id":"circuit-sdk@1.2.4700","_npmVersion":"5.3.0","_nodeVersion":"8.11.1","_npmUser":{"name":"rogeru","email":"roger.urscheler@unify.com"},"dist":{"integrity":"sha512-3I6fj+rkiFh3RTvQjW9qFP1oxUE8WxXV1d062JdmfBV4PUzj0q6f3+dO73fjUrRsjqCJTFWe6OHO4CfCWqh7Zg==","shasum":"ebb423050e8ddb96b6bdb6e8d49d3a67601a736d","tarball":"https://registry.npmjs.org/circuit-sdk/-/circuit-sdk-1.2.4700.tgz","fileCount":11,"unpackedSize":3223261,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb5CJqCRA9TVsSAnZWagAAWnsQAJS5rTT6nZQlSIhFlmcW\n+nRIt4XATjBkidhVoUJBwSzAUfLRtNDstIAE+blUIHs+lfLLi4c8jyUtHSsx\nZKMkL3ccfKFCwvUhMiXN3MSUYiPvEdtWSdPTsnS6tVwlE15ulDos5XhxjKxI\nYiJxRai900ilc37hbyptETTyNM0gvLX45hSH4mwiyNTJRemI2nV6dFUis87R\nxH04u6YoUnerLEeAn7vQIWi2gcPvggZphz6S3Uma3yRPZm9546isFd3wnIj6\nuMyqJmqjvbjY7sfJ+Erfgb4RV4GIDTKJCZliU4CUwVgI6+/+m5a12bsBC3K6\nSG7UlPE+c1OV7RUkFEkhazCR5acMQS0MaWU97Bj2/ftBXAJHb9nKfKvCefDO\nKQp5UzOGAd5xRHu7zMLxoucgsWnzrm4ZuPBYc5CSQrLvr7h0p+qgiM3FzzDk\neCu/5bsJf73HAmSS6+oWhNljRGhoW8CBTWbuKEcFf0PUvf0gBeh1o1+isqxp\nCowS4Am77r63+0Pzhd5iJExo54LxKTibIkopDeWYJfOx3doX/UTY6bpurXp8\nIgx72U5EllVq66npms+nYBiaA22lNs/CPCGKWimt6edVecgyjcAei1uPIEJ4\nqqZNRDVbPezZQahox88Z12m+QFUkXNMkHY8TX0LPQyN42kVhvnqacTGdtwvj\n5HQX\r\n=s5zl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEm4E+Ib9O7byD4nWr35yZop8gcCC8Hga56KxH9gX89eAiA8WocNP9XJ18XOX7O/YbRkq5YjRfGsk7juVnLQKbh43A=="}]},"maintainers":[{"name":"rogeru","email":"roger.urscheler@unify.com"},{"name":"rpastro","email":"rodrigo.pastro@unify.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/circuit-sdk_1.2.4700_1541677673705_0.5980475283067996"},"_hasShrinkwrap":false},"1.2.4703":{"name":"circuit-sdk","version":"1.2.4703","description":"Circuit SDK","main":"circuit-node.js","scripts":{"test:browser":"node test/index","test:node":"mocha ./test/node/* --recursive --timeout=5000 --exit","test":"npm run test:node && npm run test:browser"},"author":{"name":"Unify Inc."},"contributors":[{"name":"Roger Urscheler","email":"roger.urscheler@unify.com"},{"name":"Rodrigo Pastro","email":"rodrigo.pastro@unify.com"},{"name":"Johannes Ruetschi","email":"johannes.ruetschi@unify.com"}],"license":"Apache-2.0","homepage":"https://github.com/circuit/circuit-sdk","engines":{"node":">= 4.5.0"},"repository":{"type":"git","url":"git://github.com/circuit/circuit-sdk.git"},"bugs":{"url":"http://github.com/circuit/circuit-sdk/issues"},"keywords":["api","webrtc","circuit","collaboration","sdk"],"browser":{"electron":false,"./circuit-node.js":"./circuit.js"},"unpkg":"circuit.min.js","dependencies":{"ws":"~3.3.3"},"devDependencies":{"chai":"^4.1.2","express":"^4.16.2","globby":"^8.0.1","minimist":"^1.2.0","mocha":"^5.0.1","puppeteer":"^1.1.1","serve-static":"^1.13.2"},"gitHead":"2371094745280d3ec7a862fabe045fe97c1ff657","_id":"circuit-sdk@1.2.4703","_npmVersion":"5.3.0","_nodeVersion":"8.11.1","_npmUser":{"name":"rogeru","email":"roger.urscheler@unify.com"},"dist":{"integrity":"sha512-YZDMQZhJCWY+unPuQaV/UOD1DkPNaXswE+tT1PWAn5sPmZKqIcLZA2Rc0VY5h/SaeFRZA8994n8Z8wXZTI50mw==","shasum":"2a61c9cd90f6a0d5a88ddadcdde28e9b98dd6c2e","tarball":"https://registry.npmjs.org/circuit-sdk/-/circuit-sdk-1.2.4703.tgz","fileCount":11,"unpackedSize":3224928,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcBS5gCRA9TVsSAnZWagAAj2cP/28FQ7lKkXCcUPcvOSh0\nIRukEATFNRvQ+0oZvutal7r38T+R08p0mfGysiKj1ACJxaK04CMp8YAR7r5J\nBmdWTYFXFRGtvl/1PCyQI1ytYm7dPsR3jEzv3+1+EeVgXKW80YmW/Z65plIz\ngpJrFaKGD45LWb49BZaZxkHqvBAiCIRzX00c/tI1222xQG++oK7aaRFMeE4c\nReN18WRPoAQKUJOY+3spqnBnuDGbmfXSeGfINt71cRDmMTnf0nRG5UmylIGJ\nklFbSfSTaSHvXMncgy1F5eJBTfVtPEsLXysNl6iTGmoCHIG7RimaaYnVF+Mh\n7iWdEWl4iWSKbAEYRWQTzgBHKtxVQPIkiUOySjbBtKWhNy04IqEgI2oAmuD1\n5zSUUejSIfpjCdouFH6D0hpy6ujUWXELsbGkbhNQctjU5scimGU8TWZS6Zlr\n1Lfe7dZpoCz6P7joNPJDGnvhQ3GwmASfvLobzQ21j3uHk6Ev+/TObSq1591/\nUFroxQ0+9d0IaDvTDIaPQ/dG1y1w/3zSzrKMMaem+cSLugNiaqNFtRWIn6KR\n/0S+qwucBAOYUxU33YeP/7vkvufspasziJe6OUjoHAA4uEdWgG1kKJS2uUkk\nGOS1iIfNZkUtafDccFOxP9BI9EK2N+sPApX/qeYd04A+OxcMhZ/GjYiTZKl8\nSZoc\r\n=2WDK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC9VOhBJRuiGNsMdARpeBJir26U23Ws1Lhe/oFoNBawOAIgYkiWC8upARXquEgoLaFKqZZ/vtjLMK8S945VIHpmBoU="}]},"maintainers":[{"name":"rogeru","email":"roger.urscheler@unify.com"},{"name":"rpastro","email":"rodrigo.pastro@unify.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/circuit-sdk_1.2.4703_1543843423389_0.3082298780301387"},"_hasShrinkwrap":false},"1.2.4800":{"name":"circuit-sdk","version":"1.2.4800","description":"Circuit SDK","main":"circuit-node.js","scripts":{"test:browser":"node test/index","test:node":"mocha ./test/node/* --recursive --timeout=5000 --exit","test":"npm run test:node && npm run test:browser"},"author":{"name":"Unify Inc."},"contributors":[{"name":"Roger Urscheler","email":"roger.urscheler@unify.com"},{"name":"Rodrigo Pastro","email":"rodrigo.pastro@unify.com"},{"name":"Johannes Ruetschi","email":"johannes.ruetschi@unify.com"}],"license":"Apache-2.0","homepage":"https://github.com/circuit/circuit-sdk","engines":{"node":">= 4.5.0"},"repository":{"type":"git","url":"git://github.com/circuit/circuit-sdk.git"},"bugs":{"url":"http://github.com/circuit/circuit-sdk/issues"},"keywords":["api","webrtc","circuit","collaboration","sdk"],"browser":{"electron":false,"./circuit-node.js":"./circuit.js"},"unpkg":"circuit.min.js","dependencies":{"ws":"~3.3.3"},"devDependencies":{"chai":"^4.1.2","express":"^4.16.2","globby":"^8.0.1","minimist":"^1.2.0","mocha":"^5.0.1","puppeteer":"^1.1.1","serve-static":"^1.13.2"},"readme":"Circuit JavaScript and Node.js SDK\n==================================\n\n[![NPM release](https://img.shields.io/npm/v/circuit-sdk/beta.svg)](https://www.npmjs.com/package/circuit-sdk)\n[![Build Status](https://travis-ci.org/circuit/circuit-sdk.svg?branch=beta)](https://travis-ci.org/circuit/circuit-sdk)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n\n### Prerequisites\n* Developer account on circuitsandbox.net. Get it for free at [developer registration](https://www.circuit.com/web/developers/registration).\n* OAuth 2.0 `client_id` and optionally `client_secret`. Get if for free at [circuit.github.com/oauth](https://circuit.github.com/oauth).\n\n\n### API Reference\nhttps://circuitsandbox.net/sdk/ with most APIs described in the [Client](https://circuitsandbox.net/sdk/classes/Client.html) class.\n\nMore info at [circuit.github.io](https://circuit.github.io/).\n\n### Usage\n\n#### JavaScript\nAdd the the line below to the HTML file of your app. This will include the latest version of Circuit SDK and make the `Circuit` object available.\n```html\n<script type=\"text/javascript\" src=\"https://unpkg.com/circuit-sdk@beta\"></script>\n```\n\nJS SDK can also be imported via CommonJS or AMD. View the repo [UMD](https://github.com/circuit/umd) for the different types of usage, or [circuit-ionic-start](https://github.com/circuit/circuit-ionic-starter) for example how import the SDK via `require` using webpack.\n\n#### Node.js\n```bash\nnpm install --save circuit-sdk@beta\n```\n\n### Application Types\nThe majority of apps fall in one of the three types below. Each type uses a different OAuth 2.0 Grant.\n\n1. **Client-side web applications** use the JavaScript SDK with the [OAuth 2.0 Implicit Grant](https://circuit.github.io/oauth.html#implicit).\n   ```javascript\n   // No client_secret needed for Implicit Grant. SDK will obtain access token.\n   let client = new Circuit.Client({\n     client_id: '<your client_id>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon()\n     .then(user => console.log('Logged on as ' + user.displayName))\n   ```\n\n2. **Server-side web applications** use the JavaScript SDK (or [REST API](https://circuitsandbox.net/rest/v2/swagger/ui/index.html)) on the client, but handle the authentication flow on the server using the [OAuth 2.0 Authorization Code Grant](https://circuit.github.io/oauth.html#authorization_code). The access token is obtained on the server and then passed to the client to use in the Circuit JavaScript SDK. These apps may also use the Node.js SDK on the server side to act on behalf of the user.<br>\nExample apps: [node-linkify](https://github.com/circuit/node-linkify) or [circuit-google-assistant](https://github.com/circuit/circuit-google-assistant)\n   ```javascript\n   // access token is obtained and managed by server-side app\n   let client = new Circuit.Client({\n     client_id: '<your client_id>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon({accessToken: '<access_token>'})\n     .then(user => console.log('Logged on as ' + user.displayName))\n   ```\n\n3. **Bots** use the [Node.js SDK](https://www.npmjs.com/package/circuit-sdk) or the [REST API](https://circuitsandbox.net/rest/v2/swagger/ui/index.html) and use the [OAuth 2.0 Client Credentials Grant](https://circuit.github.io/oauth.html#client_credentials). Bots are a special type of user; they don't login on behalf of a regular user, hence no OAuth popup asking for a user`s credentials and permissions.<br>\nExample bots: [xlator-bot](https://github.com/circuit/xlator-bot) or [node-sdk-example](https://github.com/circuit/node-sdk-example)<br>\nExample electron bots: [webrtc-bot-example](https://github.com/circuit/webrtc-bot-example) or [live-cam-bot](https://github.com/circuit/live-cam-bot)\n   ```javascript\n   const Circuit = require('circuit-sdk');\n   let client = new Circuit.Client({\n     client_id: '<client_id>',\n     client_secret: '<client_secret>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon()\n     .then(user => console.log('Logged on as bot: ' + user.emailAddress))\n   ```\n\n\n\n### Examples\n\n> JavaScript examples are located at [/examples/js](/examples/js) with more examples on [jsbin](https://circuit.github.io/jssdk.html#jsbin).\n\n> Node.js example apps are on [github](https://github.com/circuit). A summary is listed [here](https://circuit.github.io/nodejs.html). Runkit allows playing with Node.js modules live, similar to jsbin or jsfiddle on the client. [Try it on runkit](https://runkit.com/rogeru/circuit-sdk)\n\nHere are some snippets to get you started.\n\n#### Create Group Conversation and send text message\nLogon as bot, create a group conversation with two users and send a text message.\n```javascript\nclient.logon()\n  .then(user => console.log(`Logged on as ${user.displayName}`, user))\n  .then(() => client.getUsersByEmail(['kim.jackson@mailinator.com', 'maeva.barnaby@mailinator.com']))\n  .then(users => users.map(user => user.userId))\n  .then(userIds => client.createGroupConversation(userIds, 'runkit example'))\n  .then(conv => client.addTextItem(conv.convId, 'I am test bot. What can I do for you?'))\n  .then(client.logout)\n  .catch(console.error)\n```\n\n#### Get Conversations\nGet 10 newest conversations of logged on user.\n```javascript\nclient.getConversations({numberOfConversations: 10})\n  .then(conversations => console.log(`Retrieved ${conversations.length} conversations`))\n```\n\n#### Video call with another Circuit user\nStart a video call with another user. Create conversation if not yet existing.\n> Only applicable to JavaScript SDK and only on browsers supporting WebRTC\n```javascript\nclient.makeCall('bob@company.com', {audio: true, video: true}, true)\n  .then(call => console.log('New call: ', call));\n```\n\n#### Listen for events\n```javascript\n// Register new items added to the feed of this user. E.g. incoming text message\nclient.addEventListener('itemAdded', item =>\n  console.log('itemAdded event received:', item));\n\n// Register for connection state changes\nclient.addEventListener('connectionStateChanged', evt => {\n  console.log(`New state is ${evt.state}`);\n});\n\n// Register and log all events\nCircuit.supportedEvents.forEach(e => client.addEventListener(e, console.log));\n```\n\n#### Create an injector\nInjectors allow extending the conversation, item and user objects within the SDK.\nIn this example a new attribute `teaser` is created on the item object. This `teaser` will be added to item objects in any reponse or event from the SDK.\n```javascript\nCircuit.Injectors.itemInjector = function (item) {\n  if (item.type === Circuit.Enums.ConversationItemType.TEXT) {\n    // Create item.teaser attribute with replacing br and hr tags with a space\n    item.teaser = item.text.content.replace(/<(br[\\/]?|\\/li|hr[\\/]?)>/gi, ' ');\n  } else {\n    item.teaser = item.type;\n  }\n};\n```\n\n### Supported Browsers\nChrome and Firefox are officially supported.\n\n### Help us improve the SDK\nHelp us improve the SDK or examples by sending us a pull-request or opening a [GitHub Issue](https://github.com/circuit/circuit-sdk/issues/new).\n","readmeFilename":"README.md","gitHead":"88588457d77c39b77266c964bd302c5d76b50a72","_id":"circuit-sdk@1.2.4800","_npmVersion":"5.3.0","_nodeVersion":"8.11.1","_npmUser":{"name":"rogeru","email":"roger.urscheler@unify.com"},"dist":{"integrity":"sha512-WvSWARsk5zX0Iz/pdHXI+Gi6lA3gFyEOElBVuJ4LDHMOkDvwZclUyRGM6v3RmwX8QVPqMhwPalGNsPGLfgVpMg==","shasum":"1c94593ebfbbd080219fe228ab6e78954ed356ec","tarball":"https://registry.npmjs.org/circuit-sdk/-/circuit-sdk-1.2.4800.tgz","fileCount":11,"unpackedSize":3249085,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcBS/LCRA9TVsSAnZWagAAtwMP/iwjBLJ+cgteoISphsmJ\nDadR2wl6xLgBEzl/KQ6jybhibl940RkJgn17+j0n2jT1XBDQ3tXKSh3WA7W0\n94vL/oKWG3ngQBYrgYkLpEXBiG947fkR2Zv2Dvv1kgYgIodyNDxTYOFD1rXq\nUR48X76SlfmPLBTZJ1+XF3S3uaePuTOjQcSw/btn3EaeejJTdOdFUrJqgS3t\nNp2JkgWw25rvkO7Hwhednp0CN2NsoXaGjt/E6IUQuRIU3cxvF7AP7FTRYdYJ\nEpfeaa9jATEwax/7KpoyidJRPSj2RX5VhDEDhCPkQR/e0DEAGjoObG0S0aZ9\n1f5NuMnYWvViD3c/vbIM2dc2klR8N0BE0O4d8XPLyIUGoCs0447n+F/Va34Z\nS/poQiV+UuShF0N/n+2tejLrMxY+FptHcOn9ec75QiWeIpIQelr8YeubpZbt\n5Zr7jb6uTouIpQacAD3Ev97SWhMnodueyNWCGFAHcp+CYZ1byjJHRZEBVpme\nSbtKCRdREQBeanyOlND+4RpibScPIcxRYf89O0iR9XHqyX2KZOCGEb2pro4F\njZhw3s6SQ97gZKSTUgZ0FA2EofzHG6tKNTe/m25wa9MkXR4mQRSXMD/FUtgL\ndRGShlclYts8lq0a24wbGoBQr9evo1RjY8rsPNWoJCrE6RJVOXFZvAuyE8b6\nscNv\r\n=zj7Q\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAy34p67+fXZZlxGD47mJCBxLAgqooH0vQdlFFjtzphaAiEAkGIYjgWBfoQvC3Pq/HfO2L8M3L7uGJaSRNnMn3yNrKI="}]},"maintainers":[{"name":"rogeru","email":"roger.urscheler@unify.com"},{"name":"rpastro","email":"rodrigo.pastro@unify.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/circuit-sdk_1.2.4800_1543843786720_0.4932674432773694"},"_hasShrinkwrap":false},"1.2.5000":{"name":"circuit-sdk","version":"1.2.5000","description":"Circuit SDK","main":"circuit-node.js","scripts":{"test:browser":"node test/index","test:node":"mocha ./test/node/* --recursive --timeout=5000 --exit","test":"npm run test:node && npm run test:browser"},"author":{"name":"Unify Inc."},"contributors":[{"name":"Roger Urscheler","email":"roger.urscheler@unify.com"},{"name":"Rodrigo Pastro","email":"rodrigo.pastro@unify.com"},{"name":"Johannes Ruetschi","email":"johannes.ruetschi@unify.com"}],"license":"Apache-2.0","homepage":"https://github.com/circuit/circuit-sdk","engines":{"node":">= 4.5.0"},"repository":{"type":"git","url":"git://github.com/circuit/circuit-sdk.git"},"bugs":{"url":"http://github.com/circuit/circuit-sdk/issues"},"keywords":["api","webrtc","circuit","collaboration","sdk"],"browser":{"electron":false,"./circuit-node.js":"./circuit.js"},"unpkg":"circuit.min.js","dependencies":{"ws":"~3.3.3"},"devDependencies":{"chai":"^4.1.2","express":"^4.16.2","globby":"^8.0.1","minimist":"^1.2.0","mocha":"^5.0.1","puppeteer":"^1.1.1","serve-static":"^1.13.2"},"readme":"Circuit JavaScript and Node.js SDK\n==================================\n\n[![NPM release](https://img.shields.io/npm/v/circuit-sdk/beta.svg)](https://www.npmjs.com/package/circuit-sdk)\n[![Build Status](https://travis-ci.org/circuit/circuit-sdk.svg?branch=beta)](https://travis-ci.org/circuit/circuit-sdk)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n\n### Prerequisites\n* Developer account on circuitsandbox.net. Get it for free at [developer registration](https://www.circuit.com/web/developers/registration).\n* OAuth 2.0 `client_id` and optionally `client_secret`. Get if for free at [circuit.github.com/oauth](https://circuit.github.com/oauth).\n\n\n### API Reference\nhttps://circuitsandbox.net/sdk/ with most APIs described in the [Client](https://circuitsandbox.net/sdk/classes/Client.html) class.\n\nMore info at [circuit.github.io](https://circuit.github.io/).\n\n### Usage\n\n#### JavaScript\nAdd the the line below to the HTML file of your app. This will include the latest version of Circuit SDK and make the `Circuit` object available.\n```html\n<script type=\"text/javascript\" src=\"https://unpkg.com/circuit-sdk@beta\"></script>\n```\n\nJS SDK can also be imported via CommonJS or AMD. View the repo [UMD](https://github.com/circuit/umd) for the different types of usage, or [circuit-ionic-start](https://github.com/circuit/circuit-ionic-starter) for example how import the SDK via `require` using webpack.\n\n#### Node.js\n```bash\nnpm install --save circuit-sdk@beta\n```\n\n### Application Types\nThe majority of apps fall in one of the three types below. Each type uses a different OAuth 2.0 Grant.\n\n1. **Client-side web applications** use the JavaScript SDK with the [OAuth 2.0 Implicit Grant](https://circuit.github.io/oauth.html#implicit).\n   ```javascript\n   // No client_secret needed for Implicit Grant. SDK will obtain access token.\n   let client = new Circuit.Client({\n     client_id: '<your client_id>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon()\n     .then(user => console.log('Logged on as ' + user.displayName))\n   ```\n\n2. **Server-side web applications** use the JavaScript SDK (or [REST API](https://circuitsandbox.net/rest/v2/swagger/ui/index.html)) on the client, but handle the authentication flow on the server using the [OAuth 2.0 Authorization Code Grant](https://circuit.github.io/oauth.html#authorization_code). The access token is obtained on the server and then passed to the client to use in the Circuit JavaScript SDK. These apps may also use the Node.js SDK on the server side to act on behalf of the user.<br>\nExample apps: [node-linkify](https://github.com/circuit/node-linkify) or [circuit-google-assistant](https://github.com/circuit/circuit-google-assistant)\n   ```javascript\n   // access token is obtained and managed by server-side app\n   let client = new Circuit.Client({\n     client_id: '<your client_id>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon({accessToken: '<access_token>'})\n     .then(user => console.log('Logged on as ' + user.displayName))\n   ```\n\n3. **Bots** use the [Node.js SDK](https://www.npmjs.com/package/circuit-sdk) or the [REST API](https://circuitsandbox.net/rest/v2/swagger/ui/index.html) and use the [OAuth 2.0 Client Credentials Grant](https://circuit.github.io/oauth.html#client_credentials). Bots are a special type of user; they don't login on behalf of a regular user, hence no OAuth popup asking for a user`s credentials and permissions.<br>\nExample bots: [xlator-bot](https://github.com/circuit/xlator-bot) or [node-sdk-example](https://github.com/circuit/node-sdk-example)<br>\nExample electron bots: [webrtc-bot-example](https://github.com/circuit/webrtc-bot-example) or [live-cam-bot](https://github.com/circuit/live-cam-bot)\n   ```javascript\n   const Circuit = require('circuit-sdk');\n   let client = new Circuit.Client({\n     client_id: '<client_id>',\n     client_secret: '<client_secret>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon()\n     .then(user => console.log('Logged on as bot: ' + user.emailAddress))\n   ```\n\n\n\n### Examples\n\n> JavaScript examples are located at [/examples/js](/examples/js) with more examples on [jsbin](https://circuit.github.io/jssdk.html#jsbin).\n\n> Node.js example apps are on [github](https://github.com/circuit). A summary is listed [here](https://circuit.github.io/nodejs.html). Runkit allows playing with Node.js modules live, similar to jsbin or jsfiddle on the client. [Try it on runkit](https://runkit.com/rogeru/circuit-sdk)\n\nHere are some snippets to get you started.\n\n#### Create Group Conversation and send text message\nLogon as bot, create a group conversation with two users and send a text message.\n```javascript\nclient.logon()\n  .then(user => console.log(`Logged on as ${user.displayName}`, user))\n  .then(() => client.getUsersByEmail(['kim.jackson@mailinator.com', 'maeva.barnaby@mailinator.com']))\n  .then(users => users.map(user => user.userId))\n  .then(userIds => client.createGroupConversation(userIds, 'runkit example'))\n  .then(conv => client.addTextItem(conv.convId, 'I am test bot. What can I do for you?'))\n  .then(client.logout)\n  .catch(console.error)\n```\n\n#### Get Conversations\nGet 10 newest conversations of logged on user.\n```javascript\nclient.getConversations({numberOfConversations: 10})\n  .then(conversations => console.log(`Retrieved ${conversations.length} conversations`))\n```\n\n#### Video call with another Circuit user\nStart a video call with another user. Create conversation if not yet existing.\n> Only applicable to JavaScript SDK and only on browsers supporting WebRTC\n```javascript\nclient.makeCall('bob@company.com', {audio: true, video: true}, true)\n  .then(call => console.log('New call: ', call));\n```\n\n#### Listen for events\n```javascript\n// Register new items added to the feed of this user. E.g. incoming text message\nclient.addEventListener('itemAdded', item =>\n  console.log('itemAdded event received:', item));\n\n// Register for connection state changes\nclient.addEventListener('connectionStateChanged', evt => {\n  console.log(`New state is ${evt.state}`);\n});\n\n// Register and log all events\nCircuit.supportedEvents.forEach(e => client.addEventListener(e, console.log));\n```\n\n#### Create an injector\nInjectors allow extending the conversation, item and user objects within the SDK.\nIn this example a new attribute `teaser` is created on the item object. This `teaser` will be added to item objects in any reponse or event from the SDK.\n```javascript\nCircuit.Injectors.itemInjector = function (item) {\n  if (item.type === Circuit.Enums.ConversationItemType.TEXT) {\n    // Create item.teaser attribute with replacing br and hr tags with a space\n    item.teaser = item.text.content.replace(/<(br[\\/]?|\\/li|hr[\\/]?)>/gi, ' ');\n  } else {\n    item.teaser = item.type;\n  }\n};\n```\n\n### Supported Browsers\nChrome and Firefox are officially supported.\n\n### Help us improve the SDK\nHelp us improve the SDK or examples by sending us a pull-request or opening a [GitHub Issue](https://github.com/circuit/circuit-sdk/issues/new).\n","readmeFilename":"README.md","gitHead":"0756e0dec60191d2579ec31fc8f440dd2d094917","_id":"circuit-sdk@1.2.5000","_npmVersion":"5.3.0","_nodeVersion":"8.11.1","_npmUser":{"name":"rogeru","email":"roger.urscheler@atos.net"},"dist":{"integrity":"sha512-fzGpG+kyS3UpYr6uKcYvb2D6ty4gD9B/M3sqkio4TCywPr6SmUPW97giORWhCVKyNjqU4zGe+8SJEWtG7m0ppw==","shasum":"7ff381d7fb5b8234ff74fa257e6e2b5e66eeb7c3","tarball":"https://registry.npmjs.org/circuit-sdk/-/circuit-sdk-1.2.5000.tgz","fileCount":11,"unpackedSize":3282066,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcOz0oCRA9TVsSAnZWagAArJYQAI0QgWV7D8yl4HAequgc\nbE8k6rtr/hDPj6UwJUAD3Z4UhzNlK5X+RfV5ft+ZXyEeZ/G1iCapDvSWLYuS\nNfCL4QRMb30g+uHGK6mEKDpsmfi41QjIx0reMILjkNgP1/DtTWd/wj30moPd\nqZ5ipAxXPetRwSGg3nf4ktKqUy85iL4eOGRvx2VUsvgXWlqwmDIj4J3705Xq\ns07OGC+ke2SY0deXerLtihIcnep35czWsxHr9wqr2yucDRutC1wyr6GFoXEd\nWmCrtcP0QiS27aTdM9V/n0unntNS3mJExRghjzJXNoz/NOW8RRIv0wflczQh\n/rRiG+nVDK0iGNGEHxdxLZWYl7rqIF0OIqmLQGN3Fj2WKR5k9n80MFkmNumT\nyS0fXWRSjRvHO6Thbr2d9B1pb7av8CzJmouk4GzKlB7qoJBv0M/ci8HbCGCn\n8p6z0BJsXFlAEHALGhtNYMHAa94bAKcFpC4DcYNZJWzxx4DM3CNIh66vB7AC\nqybyGP2w7nIrr71e/Sz6+41ggyBHzzbdm98unWT4hKOAx9T0e5PJHaz/5W0X\nvpehIIhCW99O3nnIuEQxEx6ecWsKMqR4dYrD2pmcRX32q1i+aXF/DA2S4DuV\nh72AelDNNbFGKlpChX+a8K3jmfQXjxpTnphfIufTfAOZSH+6tPbhLU4aNGgG\nTd8P\r\n=yCWO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDZaWAF0M4W+te5InX1hpfZzu6l6ySc9lZt8x/GuGkAZQIgDxL9RPM4ON4q0hO13/RVU9oKDNRWANq+lFPDtMe7dPI="}]},"maintainers":[{"name":"rogeru","email":"roger.urscheler@unify.com"},{"name":"rpastro","email":"rodrigo.pastro@unify.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/circuit-sdk_1.2.5000_1547386151290_0.1102163178482316"},"_hasShrinkwrap":false},"1.2.4903":{"name":"circuit-sdk","version":"1.2.4903","description":"Circuit SDK","main":"circuit-node.js","scripts":{"test:browser":"node test/index","test:node":"mocha ./test/node/* --recursive --timeout=5000 --exit","test":"npm run test:node && npm run test:browser"},"author":{"name":"Unify Inc."},"contributors":[{"name":"Roger Urscheler","email":"roger.urscheler@unify.com"},{"name":"Rodrigo Pastro","email":"rodrigo.pastro@unify.com"},{"name":"Johannes Ruetschi","email":"johannes.ruetschi@unify.com"}],"license":"Apache-2.0","homepage":"https://github.com/circuit/circuit-sdk","engines":{"node":">= 4.5.0"},"repository":{"type":"git","url":"git://github.com/circuit/circuit-sdk.git"},"bugs":{"url":"http://github.com/circuit/circuit-sdk/issues"},"keywords":["api","webrtc","circuit","collaboration","sdk"],"browser":{"electron":false,"./circuit-node.js":"./circuit.js"},"unpkg":"circuit.min.js","dependencies":{"ws":"~3.3.3"},"devDependencies":{"chai":"^4.1.2","express":"^4.16.2","globby":"^8.0.1","minimist":"^1.2.0","mocha":"^5.0.1","puppeteer":"^1.1.1","serve-static":"^1.13.2"},"gitHead":"5fda9c2da117528bdec1511618d29fc4bded773e","_id":"circuit-sdk@1.2.4903","_npmVersion":"5.3.0","_nodeVersion":"8.11.1","_npmUser":{"name":"rogeru","email":"roger.urscheler@atos.net"},"dist":{"integrity":"sha512-V33qStxRn4Uxz4mC/Cn6pESlZrZxMnKUJsxXuxjzZBKB0ApI0jTFbVW0pTmI4ZM9Vg0W0iLO9USkZwYuCJ7T+Q==","shasum":"661d6ccd9a255156b035502129ff00fdda1a7254","tarball":"https://registry.npmjs.org/circuit-sdk/-/circuit-sdk-1.2.4903.tgz","fileCount":11,"unpackedSize":3270902,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcOz9vCRA9TVsSAnZWagAA+oIP/3h5DmJfYTHxBKzqMehU\n5nUvmIu9HzZvFweYLTM13FDXhleVcWBWKlbpZydtqigk4LucQmA9m+XhLAaQ\n+kw/kXtEkkB1/I1bBLnHHwqCno23KlXbAc07fC2K/7ifXwPDQi9WRMzsSDb8\njPSa8WyEjnIZ2oaZGY9Xt1CjZWkE9Je93fWZySYhhPNrYUp1Pqh0sszQwUy3\nEATDMnoXH5JJ3QmJcYNwSdmvlLcwO5Drw229mRfA78LqazTtwebDJATjidz5\nbrH0hgS0SV64QG/1dYq0k3zsNlhhEn9O5CVUCYfMLKFA+G2/+wt8eF35ARJV\nrStHAqRVNqR9JAmWi3on56DFEmS1fmDzXKi9zxYyMiGC3vJ10iaODcnCvkiH\nXoHzVWbSpNZ1U4O35Wiv6fBHLdeltUDoQhZQiG/5vt0yzH1NTEu7DLzSIZob\nrzpvGDE3vWpTCIJrPmGKVZwsEgZlpVYJaApLlnJPJRsiF7q7yOttyOFC4rHw\ncMgt71pnDdEl+HjdHlv837qqFL8mFDacaHNfa000ymyc8U9lUOOtB4hmviaX\nknQd4An51WAhFwB9nFzamxzjDHPvE8vX01e8jL6QZMPjGFk1sXVqV7Y1m0JA\n+k9RIVtP3Chz5Ea/4bxPG8H05giEI1mVeMqHdSEdzBoOhngY29XUJwmt6CAl\nyW0A\r\n=6XkT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD66txBYhIoSBqcWAryuWiKWA68mckZTM4aTytBosyOQQIgdADVeP+3Y2BW6pL9FKC+ycJETQIDdXMby3jkZaiZio4="}]},"maintainers":[{"name":"rogeru","email":"roger.urscheler@unify.com"},{"name":"rpastro","email":"rodrigo.pastro@unify.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/circuit-sdk_1.2.4903_1547386734226_0.8214667940632103"},"_hasShrinkwrap":false},"1.2.5201":{"name":"circuit-sdk","version":"1.2.5201","description":"Circuit SDK","main":"circuit-node.js","scripts":{"test:browser":"node test/index","test:node":"mocha ./test/node/* --recursive --timeout=5000 --exit","test":"npm run test:node && npm run test:browser"},"author":{"name":"Unify Inc."},"contributors":[{"name":"Roger Urscheler","email":"roger.urscheler@unify.com"},{"name":"Rodrigo Pastro","email":"rodrigo.pastro@unify.com"},{"name":"Johannes Ruetschi","email":"johannes.ruetschi@unify.com"}],"license":"Apache-2.0","homepage":"https://github.com/circuit/circuit-sdk","engines":{"node":">= 4.5.0"},"repository":{"type":"git","url":"git://github.com/circuit/circuit-sdk.git"},"bugs":{"url":"http://github.com/circuit/circuit-sdk/issues"},"keywords":["api","webrtc","circuit","collaboration","sdk"],"browser":{"electron":false,"./circuit-node.js":"./circuit.js"},"unpkg":"circuit.min.js","dependencies":{"ws":"~3.3.3"},"devDependencies":{"chai":"^4.1.2","express":"^4.16.2","globby":"^8.0.1","minimist":"^1.2.0","mocha":"^5.0.1","puppeteer":"^1.1.1","serve-static":"^1.13.2"},"gitHead":"b229f76a8203269a12a2b7292358d4b159c08199","_id":"circuit-sdk@1.2.5201","_npmVersion":"5.3.0","_nodeVersion":"10.15.0","_npmUser":{"name":"rogeru","email":"roger.urscheler@atos.net"},"dist":{"integrity":"sha512-7+TQJC+UrreuwCD6ZbLrP4edZ+xk+ugmfBOTeYBMhU7FHsmeB8dEenQkfyFBz53ZKXP+EYy3JNs1SUgqNuh3rg==","shasum":"07d5b2aebaa53888e4baec5651c50ed2a67b9289","tarball":"https://registry.npmjs.org/circuit-sdk/-/circuit-sdk-1.2.5201.tgz","fileCount":12,"unpackedSize":3311734,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcZhHNCRA9TVsSAnZWagAAgjUP/0OPVEk634GoLXNDNlOK\niPqxVHPrg4f93Q3Sc6yw/pK57ubHZbeGaMow3dawKf0q85OhClsy3ouo2Nni\nJKofROFwC9D4uem9DZZSmp5ykPa3VeLAh3Eh0+VsvQ4Nc2BroyVTFydx1Li8\nW5uzGlE+OvdtIttmz/nlaMpBtiOtwA+DXgrqStexvnL9utAwyDbZ35egSlJ9\n/PRHyRt41NQn3Y//vhIduaSxDGlkY7WGKKmQFUKzHmbpk6acaaNzZq0OQi4z\nVi79eaxRZIRprcasVnkuE5YgsEetWoehAPXtcwuBhFm0gpRb+lT1O+Ukprsq\nrGMuWGRO/8QsN1M/zY05nOkrlBcrz6+jIReWpW8cluN+csqxbZn9+ZSa/Fnv\niaY0/ayoQ0SuVSa+j7feAar8zMVVy6F01Iw0zBju6dbOAigYTpvezHTbVL1z\nI2o2vex+M1pr50mBIshTsIX6QHdavZ5gjfH4tET7A+uh4HbFqY9aNFfoouYB\nF5e0Qb6fY86Mp0RBRhR05kvXyFenVG5LJopQxTKxzA/Q7hFXcIqz2c5GogTe\n0AkyXekIqcNvBe6PryoSQkn7HKptnUh4Ib/GGViyYW2k11cYsS+qKxQW8VRG\n35DvMa0A6QO25zSiZQEU5zxBPRT2N0mQHJbpbQYWE4quX79ca8w4EQu0vagS\nk2/z\r\n=GmqG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCl+Eoc+UTrgoyZ0SoT2OcW5ghVYDQEbzwXNjUS5e7QEAIgFY2ILTHZ2rEaIgn/asjawm9CR28VnyDEdvgM3ZVkPec="}]},"maintainers":[{"name":"rogeru","email":"roger.urscheler@unify.com"},{"name":"rpastro","email":"rodrigo.pastro@unify.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/circuit-sdk_1.2.5201_1550193100122_0.2450807939302866"},"_hasShrinkwrap":false},"1.2.5300":{"name":"circuit-sdk","version":"1.2.5300","description":"Circuit SDK","main":"circuit-node.js","scripts":{"test:browser":"node test/index","test:node":"mocha ./test/node/* --recursive --timeout=5000 --exit","test":"npm run test:node && npm run test:browser"},"author":{"name":"Unify Inc."},"contributors":[{"name":"Roger Urscheler","email":"roger.urscheler@unify.com"},{"name":"Rodrigo Pastro","email":"rodrigo.pastro@unify.com"},{"name":"Johannes Ruetschi","email":"johannes.ruetschi@unify.com"}],"license":"Apache-2.0","homepage":"https://github.com/circuit/circuit-sdk","engines":{"node":">= 4.5.0"},"repository":{"type":"git","url":"git://github.com/circuit/circuit-sdk.git"},"bugs":{"url":"http://github.com/circuit/circuit-sdk/issues"},"keywords":["api","webrtc","circuit","collaboration","sdk"],"browser":{"electron":false,"./circuit-node.js":"./circuit.js"},"unpkg":"circuit.min.js","dependencies":{"ws":"~3.3.3"},"devDependencies":{"chai":"^4.1.2","express":"^4.16.2","globby":"^8.0.1","minimist":"^1.2.0","mocha":"^5.0.1","puppeteer":"^1.1.1","serve-static":"^1.13.2"},"readme":"Circuit JavaScript and Node.js SDK\n==================================\n\n[![NPM release](https://img.shields.io/npm/v/circuit-sdk/beta.svg)](https://www.npmjs.com/package/circuit-sdk)\n[![Build Status](https://travis-ci.org/circuit/circuit-sdk.svg?branch=beta)](https://travis-ci.org/circuit/circuit-sdk)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n\n### Prerequisites\n* Developer account on circuitsandbox.net. Get it for free at [developer registration](https://www.circuit.com/web/developers/registration).\n* OAuth 2.0 `client_id` and optionally `client_secret`. Get if for free at [circuit.github.com/oauth](https://circuit.github.com/oauth).\n\n\n### API Reference\nhttps://circuitsandbox.net/sdk/ with most APIs described in the [Client](https://circuitsandbox.net/sdk/classes/Client.html) class.\n\nMore info at [circuit.github.io](https://circuit.github.io/).\n\n### Usage\n\n#### JavaScript\nAdd the the line below to the HTML file of your app. This will include the latest version of Circuit SDK and make the `Circuit` object available.\n```html\n<script type=\"text/javascript\" src=\"https://unpkg.com/circuit-sdk@beta\"></script>\n```\n\nJS SDK can also be imported via CommonJS or AMD. View the repo [UMD](https://github.com/circuit/umd) for the different types of usage, or [circuit-ionic-start](https://github.com/circuit/circuit-ionic-starter) for example how import the SDK via `require` using webpack.\n\n#### Node.js\n```bash\nnpm install --save circuit-sdk@beta\n```\n\n### Application Types\nThe majority of apps fall in one of the three types below. Each type uses a different OAuth 2.0 Grant.\n\n1. **Client-side web applications** use the JavaScript SDK with the [OAuth 2.0 Implicit Grant](https://circuit.github.io/oauth.html#implicit).\n   ```javascript\n   // No client_secret needed for Implicit Grant. SDK will obtain access token.\n   let client = new Circuit.Client({\n     client_id: '<your client_id>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon()\n     .then(user => console.log('Logged on as ' + user.displayName))\n   ```\n\n2. **Server-side web applications** use the JavaScript SDK (or [REST API](https://circuitsandbox.net/rest/v2/swagger/ui/index.html)) on the client, but handle the authentication flow on the server using the [OAuth 2.0 Authorization Code Grant](https://circuit.github.io/oauth.html#authorization_code). The access token is obtained on the server and then passed to the client to use in the Circuit JavaScript SDK. These apps may also use the Node.js SDK on the server side to act on behalf of the user.<br>\nExample apps: [node-linkify](https://github.com/circuit/node-linkify) or [circuit-google-assistant](https://github.com/circuit/circuit-google-assistant)\n   ```javascript\n   // access token is obtained and managed by server-side app\n   let client = new Circuit.Client({\n     client_id: '<your client_id>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon({accessToken: '<access_token>'})\n     .then(user => console.log('Logged on as ' + user.displayName))\n   ```\n\n3. **Bots** use the [Node.js SDK](https://www.npmjs.com/package/circuit-sdk) or the [REST API](https://circuitsandbox.net/rest/v2/swagger/ui/index.html) and use the [OAuth 2.0 Client Credentials Grant](https://circuit.github.io/oauth.html#client_credentials). Bots are a special type of user; they don't login on behalf of a regular user, hence no OAuth popup asking for a user`s credentials and permissions.<br>\nExample bots: [xlator-bot](https://github.com/circuit/xlator-bot) or [node-sdk-example](https://github.com/circuit/node-sdk-example)<br>\nExample electron bots: [webrtc-bot-example](https://github.com/circuit/webrtc-bot-example) or [live-cam-bot](https://github.com/circuit/live-cam-bot)\n   ```javascript\n   const Circuit = require('circuit-sdk');\n   let client = new Circuit.Client({\n     client_id: '<client_id>',\n     client_secret: '<client_secret>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon()\n     .then(user => console.log('Logged on as bot: ' + user.emailAddress))\n   ```\n\n\n\n### Examples\n\n> JavaScript examples are located at [/examples/js](/examples/js) with more examples on [jsbin](https://circuit.github.io/jssdk.html#jsbin).\n\n> Node.js example apps are on [github](https://github.com/circuit). A summary is listed [here](https://circuit.github.io/nodejs.html). Runkit allows playing with Node.js modules live, similar to jsbin or jsfiddle on the client. [Try it on runkit](https://runkit.com/rogeru/circuit-sdk)\n\nHere are some snippets to get you started.\n\n#### Create Group Conversation and send text message\nLogon as bot, create a group conversation with two users and send a text message.\n```javascript\nclient.logon()\n  .then(user => console.log(`Logged on as ${user.displayName}`, user))\n  .then(() => client.getUsersByEmail(['kim.jackson@mailinator.com', 'maeva.barnaby@mailinator.com']))\n  .then(users => users.map(user => user.userId))\n  .then(userIds => client.createGroupConversation(userIds, 'runkit example'))\n  .then(conv => client.addTextItem(conv.convId, 'I am test bot. What can I do for you?'))\n  .then(client.logout)\n  .catch(console.error)\n```\n\n#### Get Conversations\nGet 10 newest conversations of logged on user.\n```javascript\nclient.getConversations({numberOfConversations: 10})\n  .then(conversations => console.log(`Retrieved ${conversations.length} conversations`))\n```\n\n#### Video call with another Circuit user\nStart a video call with another user. Create conversation if not yet existing.\n> Only applicable to JavaScript SDK and only on browsers supporting WebRTC\n```javascript\nclient.makeCall('bob@company.com', {audio: true, video: true}, true)\n  .then(call => console.log('New call: ', call));\n```\n\n#### Listen for events\n```javascript\n// Register new items added to the feed of this user. E.g. incoming text message\nclient.addEventListener('itemAdded', item =>\n  console.log('itemAdded event received:', item));\n\n// Register for connection state changes\nclient.addEventListener('connectionStateChanged', evt => {\n  console.log(`New state is ${evt.state}`);\n});\n\n// Register and log all events\nCircuit.supportedEvents.forEach(e => client.addEventListener(e, console.log));\n```\n\n#### Create an injector\nInjectors allow extending the conversation, item and user objects within the SDK.\nIn this example a new attribute `teaser` is created on the item object. This `teaser` will be added to item objects in any reponse or event from the SDK.\n```javascript\nCircuit.Injectors.itemInjector = function (item) {\n  if (item.type === Circuit.Enums.ConversationItemType.TEXT) {\n    // Create item.teaser attribute with replacing br and hr tags with a space\n    item.teaser = item.text.content.replace(/<(br[\\/]?|\\/li|hr[\\/]?)>/gi, ' ');\n  } else {\n    item.teaser = item.type;\n  }\n};\n```\n\n### Supported Browsers\nChrome and Firefox are officially supported.\n\n### Help us improve the SDK\nHelp us improve the SDK or examples by sending us a pull-request or opening a [GitHub Issue](https://github.com/circuit/circuit-sdk/issues/new).\n","readmeFilename":"README.md","gitHead":"de2216bf1fb35ace3f3a1b8ade9abe53a05d51ad","_id":"circuit-sdk@1.2.5300","_npmVersion":"5.3.0","_nodeVersion":"10.15.0","_npmUser":{"name":"rogeru","email":"roger.urscheler@atos.net"},"dist":{"integrity":"sha512-NTBGyqVCE6GFoM1yxXq63VLn4VISLerL4F83zUnfi5/AFMpzjwq5hoFdOLFfzHpEGXUJqB2nwWwFjEtfD5oUxA==","shasum":"17a9b61e3d80b14868f21232cf01d371e8b798c1","tarball":"https://registry.npmjs.org/circuit-sdk/-/circuit-sdk-1.2.5300.tgz","fileCount":11,"unpackedSize":3400183,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcZhInCRA9TVsSAnZWagAAImkP/25GvHZwwFKV7siyvGtc\nSmO/RhuihGJYsOt1/hPpbqII1Zy/vw13eBjWWx7kYZSgCg+TXcsLu4X1MlV9\nKyigYYKRz6aaIWF1YxDV0LlqORSxTe3CZW4xN6tdCzf+pHMxQvQ3R3faQtOC\nDO1usy/FD4xeaKSQF2mCcLCepRMC/5bOp8xxUZC0q3I7W9HhnHAeVqOurisO\nYfX0jzKNw/gCuclZoe6HhLQmD0GO4SymGhbR/Pi0QSRSY6Z1Y+ewnk9NRX1U\nbWoGvx3FP7+NxFXUvND27ZUym69aOLVjWdY10GSH+IPtxSUTzzf/mHN19cd2\nQpzh8GPxAf/NbVPOQiyovuaNmjf73YumhE3oQU1YMBZyxJu+BtMEUyUDhaAs\nDrihocoPtKudUZtyt5XaBgN3OTBQHAmMyKpphoF/v29PpWli/AC1fTkVU+gI\nUodL1mK9BjnZNc+Jb4QnaAESPW4/5Fs1W2oldJnKRTNH7XKMjYhZ2WOdg2NU\naLaflvqyWBJtZLCDcDnbsIhzxPlUCkDhDxeHY8ufrtZSOJ7NQ97x7gjVLxVw\nSf/4iPtARRMrA8iUXTbjzVOCOku/YU8fRgsFq2JvaHLe8/HW0axmuvl1RHa/\nVmK8XC06L9wiyS1mWvxv/n4yne0V0GIu6jRyEahpzsJapFT+mg4qftWQV4Jf\nrgTs\r\n=vlQj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICaLRPGOx+jSOPAmfrvttIMKwjOT3U2APa/6uCtV9k0SAiEA31YTHE/O2bDfzcZl4HNG26lgoNbavpaOQH9BnP6fYrM="}]},"maintainers":[{"name":"rogeru","email":"roger.urscheler@unify.com"},{"name":"rpastro","email":"rodrigo.pastro@unify.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/circuit-sdk_1.2.5300_1550193190801_0.7133618203251557"},"_hasShrinkwrap":false},"1.2.5500":{"name":"circuit-sdk","version":"1.2.5500","description":"Circuit SDK","main":"circuit-node.js","scripts":{"test:browser":"node test/index","test:node":"mocha ./test/node/* --recursive --timeout=5000 --exit","test":"npm run test:node && npm run test:browser"},"author":{"name":"Unify Inc."},"contributors":[{"name":"Roger Urscheler","email":"roger.urscheler@unify.com"},{"name":"Rodrigo Pastro","email":"rodrigo.pastro@unify.com"},{"name":"Johannes Ruetschi","email":"johannes.ruetschi@unify.com"}],"license":"Apache-2.0","homepage":"https://github.com/circuit/circuit-sdk","engines":{"node":">= 4.5.0"},"repository":{"type":"git","url":"git://github.com/circuit/circuit-sdk.git"},"bugs":{"url":"http://github.com/circuit/circuit-sdk/issues"},"keywords":["api","webrtc","circuit","collaboration","sdk"],"browser":{"electron":false,"./circuit-node.js":"./circuit.js"},"unpkg":"circuit.min.js","dependencies":{"ws":"~3.3.3"},"devDependencies":{"chai":"^4.1.2","express":"^4.16.2","globby":"^8.0.1","minimist":"^1.2.0","mocha":"^5.0.1","puppeteer":"^1.1.1","serve-static":"^1.13.2"},"readme":"Circuit JavaScript and Node.js SDK\n==================================\n\n[![NPM release](https://img.shields.io/npm/v/circuit-sdk/beta.svg)](https://www.npmjs.com/package/circuit-sdk)\n[![Build Status](https://travis-ci.org/circuit/circuit-sdk.svg?branch=beta)](https://travis-ci.org/circuit/circuit-sdk)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n\n### Prerequisites\n* Developer account on circuitsandbox.net. Get it for free at [developer registration](https://www.circuit.com/web/developers/registration).\n* OAuth 2.0 `client_id` and optionally `client_secret`. Get if for free at [circuit.github.com/oauth](https://circuit.github.com/oauth).\n\n\n### API Reference\nhttps://circuitsandbox.net/sdk/ with most APIs described in the [Client](https://circuitsandbox.net/sdk/classes/Client.html) class.\n\nMore info at [circuit.github.io](https://circuit.github.io/).\n\n### Usage\n\n#### JavaScript\nAdd the the line below to the HTML file of your app. This will include the latest version of Circuit SDK and make the `Circuit` object available.\n```html\n<script type=\"text/javascript\" src=\"https://unpkg.com/circuit-sdk@beta\"></script>\n```\n\nJS SDK can also be imported via CommonJS or AMD. View the repo [UMD](https://github.com/circuit/umd) for the different types of usage, or [circuit-ionic-start](https://github.com/circuit/circuit-ionic-starter) for example how import the SDK via `require` using webpack.\n\n#### Node.js\n```bash\nnpm install --save circuit-sdk@beta\n```\n\n### Application Types\nThe majority of apps fall in one of the three types below. Each type uses a different OAuth 2.0 Grant.\n\n1. **Client-side web applications** use the JavaScript SDK with the [OAuth 2.0 Implicit Grant](https://circuit.github.io/oauth.html#implicit).\n   ```javascript\n   // No client_secret needed for Implicit Grant. SDK will obtain access token.\n   let client = new Circuit.Client({\n     client_id: '<your client_id>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon()\n     .then(user => console.log('Logged on as ' + user.displayName))\n   ```\n\n2. **Server-side web applications** use the JavaScript SDK (or [REST API](https://circuitsandbox.net/rest/v2/swagger/ui/index.html)) on the client, but handle the authentication flow on the server using the [OAuth 2.0 Authorization Code Grant](https://circuit.github.io/oauth.html#authorization_code). The access token is obtained on the server and then passed to the client to use in the Circuit JavaScript SDK. These apps may also use the Node.js SDK on the server side to act on behalf of the user.<br>\nExample apps: [node-linkify](https://github.com/circuit/node-linkify) or [circuit-google-assistant](https://github.com/circuit/circuit-google-assistant)\n   ```javascript\n   // access token is obtained and managed by server-side app\n   let client = new Circuit.Client({\n     client_id: '<your client_id>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon({accessToken: '<access_token>'})\n     .then(user => console.log('Logged on as ' + user.displayName))\n   ```\n\n3. **Bots** use the [Node.js SDK](https://www.npmjs.com/package/circuit-sdk) or the [REST API](https://circuitsandbox.net/rest/v2/swagger/ui/index.html) and use the [OAuth 2.0 Client Credentials Grant](https://circuit.github.io/oauth.html#client_credentials). Bots are a special type of user; they don't login on behalf of a regular user, hence no OAuth popup asking for a user`s credentials and permissions.<br>\nExample bots: [xlator-bot](https://github.com/circuit/xlator-bot) or [node-sdk-example](https://github.com/circuit/node-sdk-example)<br>\nExample electron bots: [webrtc-bot-example](https://github.com/circuit/webrtc-bot-example) or [live-cam-bot](https://github.com/circuit/live-cam-bot)\n   ```javascript\n   const Circuit = require('circuit-sdk');\n   let client = new Circuit.Client({\n     client_id: '<client_id>',\n     client_secret: '<client_secret>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon()\n     .then(user => console.log('Logged on as bot: ' + user.emailAddress))\n   ```\n\n\n\n### Examples\n\n> JavaScript examples are located at [/examples/js](/examples/js) with more examples on [jsbin](https://circuit.github.io/jssdk.html#jsbin).\n\n> Node.js example apps are on [github](https://github.com/circuit). A summary is listed [here](https://circuit.github.io/nodejs.html). Runkit allows playing with Node.js modules live, similar to jsbin or jsfiddle on the client. [Try it on runkit](https://runkit.com/rogeru/circuit-sdk)\n\nHere are some snippets to get you started.\n\n#### Create Group Conversation and send text message\nLogon as bot, create a group conversation with two users and send a text message.\n```javascript\nclient.logon()\n  .then(user => console.log(`Logged on as ${user.displayName}`, user))\n  .then(() => client.getUsersByEmail(['kim.jackson@mailinator.com', 'maeva.barnaby@mailinator.com']))\n  .then(users => users.map(user => user.userId))\n  .then(userIds => client.createGroupConversation(userIds, 'runkit example'))\n  .then(conv => client.addTextItem(conv.convId, 'I am test bot. What can I do for you?'))\n  .then(client.logout)\n  .catch(console.error)\n```\n\n#### Get Conversations\nGet 10 newest conversations of logged on user.\n```javascript\nclient.getConversations({numberOfConversations: 10})\n  .then(conversations => console.log(`Retrieved ${conversations.length} conversations`))\n```\n\n#### Video call with another Circuit user\nStart a video call with another user. Create conversation if not yet existing.\n> Only applicable to JavaScript SDK and only on browsers supporting WebRTC\n```javascript\nclient.makeCall('bob@company.com', {audio: true, video: true}, true)\n  .then(call => console.log('New call: ', call));\n```\n\n#### Listen for events\n```javascript\n// Register new items added to the feed of this user. E.g. incoming text message\nclient.addEventListener('itemAdded', item =>\n  console.log('itemAdded event received:', item));\n\n// Register for connection state changes\nclient.addEventListener('connectionStateChanged', evt => {\n  console.log(`New state is ${evt.state}`);\n});\n\n// Register and log all events\nCircuit.supportedEvents.forEach(e => client.addEventListener(e, console.log));\n```\n\n#### Create an injector\nInjectors allow extending the conversation, item and user objects within the SDK.\nIn this example a new attribute `teaser` is created on the item object. This `teaser` will be added to item objects in any reponse or event from the SDK.\n```javascript\nCircuit.Injectors.itemInjector = function (item) {\n  if (item.type === Circuit.Enums.ConversationItemType.TEXT) {\n    // Create item.teaser attribute with replacing br and hr tags with a space\n    item.teaser = item.text.content.replace(/<(br[\\/]?|\\/li|hr[\\/]?)>/gi, ' ');\n  } else {\n    item.teaser = item.type;\n  }\n};\n```\n\n### Supported Browsers\nChrome and Firefox are officially supported.\n\n### Help us improve the SDK\nHelp us improve the SDK or examples by sending us a pull-request or opening a [GitHub Issue](https://github.com/circuit/circuit-sdk/issues/new).\n","readmeFilename":"README.md","gitHead":"8f2234210f10dd655d2a59d37c89430e68adef61","_id":"circuit-sdk@1.2.5500","_npmVersion":"5.3.0","_nodeVersion":"10.15.0","_npmUser":{"name":"rogeru","email":"roger.urscheler@atos.net"},"dist":{"integrity":"sha512-5suETo1VhZUM8Afsf5KaSHVB+dRYSryY7ll05dWuElK8hD91WGgyw3F8yRsoXICdj1k3/uy+fTmkUUa8D6KFeQ==","shasum":"fd806fc6c8595bf0631b41f4084cca5c29365668","tarball":"https://registry.npmjs.org/circuit-sdk/-/circuit-sdk-1.2.5500.tgz","fileCount":11,"unpackedSize":3472892,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJceHwHCRA9TVsSAnZWagAAtOQP+QBVNccEbcdjzDSccXwv\nPEnV5hqYbiMF7JErQHCIaHSSVkTIvVYmdn2zLSwP2WEsHuXbChX4ePVzCAb5\nnyO6Q1UKEo/dDk4SC+3ziimFfk+ZcGc1ERpYEyhRwBzfJGPwfROeSdteENUj\n/TlERqpQ81IRBgIkZvAHBJ7uP0C1elROz/D76DPa7BFxKYqN5e9L8Hqptb7m\n/skFi70F7sTfwY8MYcwj9sCpX/us2WdHWpyqH+OCY6z2rMFfslxFwXha/0Oy\niRXgt284pEAzRBoVFuDQlEheuClBsFdPkyLlXWgpfgWjU4t/KsSfeh8Yc4nm\nFmWVV8JyNeHMZR7reMhBXmNSBhP5YPUqrxA12m69gp7iZTPNMdz8elDRxyaQ\n3X/uy6Nr4g6CzTuA1uHJHLAZZJyarvESwFzBqp/nawOtH6Vu1LE5KtL0QbTG\nnzTiz4v3hR0gH0lJkfh+iNU3P1nx1QBvWdd054DSxk37NhYbAXFAQSfTPCgF\nRyEnBCWqQANb6iWTPgQ0XBW2mIzndIlC5svDpoKmPwXY0ibekM9yL0Uh3fHv\np4MmyEvfswr0gOe3vxn1DXyTcUhbA0gLCVykEOjNSaAsbvo8jBSrQ0LuIbiQ\nVzUQxCYyPHzE1UFUgKbxKxiVTx7FFvJooNfTFHOCT5Wszv3Xrb8EV1w/EY0p\n0uez\r\n=x+jh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD+lhyvfyIHFmrtj+G2nV/jxtKYaCaSUjQjnL5/9Id5ZgIgF5LDLrLAlMbY9x5bbjXoZmSdw6JjjmvTXY7ZQKp2QVM="}]},"maintainers":[{"name":"rogeru","email":"roger.urscheler@unify.com"},{"name":"rpastro","email":"rodrigo.pastro@unify.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/circuit-sdk_1.2.5500_1551399942851_0.5065619694534806"},"_hasShrinkwrap":false},"1.2.5601":{"name":"circuit-sdk","version":"1.2.5601","description":"Circuit SDK","main":"circuit-node.js","scripts":{"test:browser":"node test/index","test:node":"mocha ./test/node/* --recursive --timeout=5000 --exit","test":"npm run test:node && npm run test:browser"},"author":{"name":"Unify Inc."},"contributors":[{"name":"Roger Urscheler","email":"roger.urscheler@unify.com"},{"name":"Rodrigo Pastro","email":"rodrigo.pastro@unify.com"},{"name":"Johannes Ruetschi","email":"johannes.ruetschi@unify.com"}],"license":"Apache-2.0","homepage":"https://github.com/circuit/circuit-sdk","engines":{"node":">= 4.5.0"},"repository":{"type":"git","url":"git://github.com/circuit/circuit-sdk.git"},"bugs":{"url":"http://github.com/circuit/circuit-sdk/issues"},"keywords":["api","webrtc","circuit","collaboration","sdk"],"browser":{"electron":false,"./circuit-node.js":"./circuit.js"},"unpkg":"circuit.min.js","dependencies":{"ws":"~3.3.3"},"devDependencies":{"chai":"^4.1.2","express":"^4.16.2","globby":"^8.0.1","minimist":"^1.2.0","mocha":"^5.0.1","puppeteer":"^1.1.1","serve-static":"^1.13.2"},"readme":"Circuit JavaScript and Node.js SDK\n==================================\n\n[![NPM release](https://img.shields.io/npm/v/circuit-sdk/beta.svg)](https://www.npmjs.com/package/circuit-sdk)\n[![Build Status](https://travis-ci.org/circuit/circuit-sdk.svg?branch=beta)](https://travis-ci.org/circuit/circuit-sdk)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n\n### Prerequisites\n* Developer account on circuitsandbox.net. Get it for free at [developer registration](https://www.circuit.com/web/developers/registration).\n* OAuth 2.0 `client_id` and optionally `client_secret`. Get if for free at [circuit.github.com/oauth](https://circuit.github.com/oauth).\n\n\n### API Reference\nhttps://circuitsandbox.net/sdk/ with most APIs described in the [Client](https://circuitsandbox.net/sdk/classes/Client.html) class.\n\nMore info at [circuit.github.io](https://circuit.github.io/).\n\n### Usage\n\n#### JavaScript\nAdd the the line below to the HTML file of your app. This will include the latest version of Circuit SDK and make the `Circuit` object available.\n```html\n<script type=\"text/javascript\" src=\"https://unpkg.com/circuit-sdk@beta\"></script>\n```\n\nJS SDK can also be imported via CommonJS or AMD. View the repo [UMD](https://github.com/circuit/umd) for the different types of usage, or [circuit-ionic-start](https://github.com/circuit/circuit-ionic-starter) for example how import the SDK via `require` using webpack.\n\n#### Node.js\n```bash\nnpm install --save circuit-sdk@beta\n```\n\n### Application Types\nThe majority of apps fall in one of the three types below. Each type uses a different OAuth 2.0 Grant.\n\n1. **Client-side web applications** use the JavaScript SDK with the [OAuth 2.0 Implicit Grant](https://circuit.github.io/oauth.html#implicit).\n   ```javascript\n   // No client_secret needed for Implicit Grant. SDK will obtain access token.\n   let client = new Circuit.Client({\n     client_id: '<your client_id>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon()\n     .then(user => console.log('Logged on as ' + user.displayName))\n   ```\n\n2. **Server-side web applications** use the JavaScript SDK (or [REST API](https://circuitsandbox.net/rest/v2/swagger/ui/index.html)) on the client, but handle the authentication flow on the server using the [OAuth 2.0 Authorization Code Grant](https://circuit.github.io/oauth.html#authorization_code). The access token is obtained on the server and then passed to the client to use in the Circuit JavaScript SDK. These apps may also use the Node.js SDK on the server side to act on behalf of the user.<br>\nExample apps: [node-linkify](https://github.com/circuit/node-linkify) or [circuit-google-assistant](https://github.com/circuit/circuit-google-assistant)\n   ```javascript\n   // access token is obtained and managed by server-side app\n   let client = new Circuit.Client({\n     client_id: '<your client_id>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon({accessToken: '<access_token>'})\n     .then(user => console.log('Logged on as ' + user.displayName))\n   ```\n\n3. **Bots** use the [Node.js SDK](https://www.npmjs.com/package/circuit-sdk) or the [REST API](https://circuitsandbox.net/rest/v2/swagger/ui/index.html) and use the [OAuth 2.0 Client Credentials Grant](https://circuit.github.io/oauth.html#client_credentials). Bots are a special type of user; they don't login on behalf of a regular user, hence no OAuth popup asking for a user`s credentials and permissions.<br>\nExample bots: [xlator-bot](https://github.com/circuit/xlator-bot) or [node-sdk-example](https://github.com/circuit/node-sdk-example)<br>\nExample electron bots: [webrtc-bot-example](https://github.com/circuit/webrtc-bot-example) or [live-cam-bot](https://github.com/circuit/live-cam-bot)\n   ```javascript\n   const Circuit = require('circuit-sdk');\n   let client = new Circuit.Client({\n     client_id: '<client_id>',\n     client_secret: '<client_secret>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon()\n     .then(user => console.log('Logged on as bot: ' + user.emailAddress))\n   ```\n\n\n\n### Examples\n\n> JavaScript examples are located at [/examples/js](/examples/js) with more examples on [jsbin](https://circuit.github.io/jssdk.html#jsbin).\n\n> Node.js example apps are on [github](https://github.com/circuit). A summary is listed [here](https://circuit.github.io/nodejs.html). Runkit allows playing with Node.js modules live, similar to jsbin or jsfiddle on the client. [Try it on runkit](https://runkit.com/rogeru/circuit-sdk)\n\nHere are some snippets to get you started.\n\n#### Create Group Conversation and send text message\nLogon as bot, create a group conversation with two users and send a text message.\n```javascript\nclient.logon()\n  .then(user => console.log(`Logged on as ${user.displayName}`, user))\n  .then(() => client.getUsersByEmail(['kim.jackson@mailinator.com', 'maeva.barnaby@mailinator.com']))\n  .then(users => users.map(user => user.userId))\n  .then(userIds => client.createGroupConversation(userIds, 'runkit example'))\n  .then(conv => client.addTextItem(conv.convId, 'I am test bot. What can I do for you?'))\n  .then(client.logout)\n  .catch(console.error)\n```\n\n#### Get Conversations\nGet 10 newest conversations of logged on user.\n```javascript\nclient.getConversations({numberOfConversations: 10})\n  .then(conversations => console.log(`Retrieved ${conversations.length} conversations`))\n```\n\n#### Video call with another Circuit user\nStart a video call with another user. Create conversation if not yet existing.\n> Only applicable to JavaScript SDK and only on browsers supporting WebRTC\n```javascript\nclient.makeCall('bob@company.com', {audio: true, video: true}, true)\n  .then(call => console.log('New call: ', call));\n```\n\n#### Listen for events\n```javascript\n// Register new items added to the feed of this user. E.g. incoming text message\nclient.addEventListener('itemAdded', item =>\n  console.log('itemAdded event received:', item));\n\n// Register for connection state changes\nclient.addEventListener('connectionStateChanged', evt => {\n  console.log(`New state is ${evt.state}`);\n});\n\n// Register and log all events\nCircuit.supportedEvents.forEach(e => client.addEventListener(e, console.log));\n```\n\n#### Create an injector\nInjectors allow extending the conversation, item and user objects within the SDK.\nIn this example a new attribute `teaser` is created on the item object. This `teaser` will be added to item objects in any reponse or event from the SDK.\n```javascript\nCircuit.Injectors.itemInjector = function (item) {\n  if (item.type === Circuit.Enums.ConversationItemType.TEXT) {\n    // Create item.teaser attribute with replacing br and hr tags with a space\n    item.teaser = item.text.content.replace(/<(br[\\/]?|\\/li|hr[\\/]?)>/gi, ' ');\n  } else {\n    item.teaser = item.type;\n  }\n};\n```\n\n### Supported Browsers\nChrome and Firefox are officially supported.\n\n### Help us improve the SDK\nHelp us improve the SDK or examples by sending us a pull-request or opening a [GitHub Issue](https://github.com/circuit/circuit-sdk/issues/new).\n","readmeFilename":"README.md","gitHead":"b5dbc2c108997386589c7d6e286f5771a9c569f7","_id":"circuit-sdk@1.2.5601","_npmVersion":"5.3.0","_nodeVersion":"8.11.1","_npmUser":{"name":"rogeru","email":"roger.urscheler@atos.net"},"dist":{"integrity":"sha512-x93US/cHdGuKojttgDvV6JJJ1ftSxCyFu0Y96CvkVYij60CFkx+cFFN8I+dahcG47j/UNlNIKI/84FGj+yMKjg==","shasum":"4b6772247bd579148b66b8e6cae6dbe697176ee1","tarball":"https://registry.npmjs.org/circuit-sdk/-/circuit-sdk-1.2.5601.tgz","fileCount":11,"unpackedSize":3493402,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJckOQMCRA9TVsSAnZWagAAzKMP/R8kzD+mcdmKYO+ZbyXA\nUODYKPl3C1vpTfiDOxc2nqVCrnF7r7AUMPzBGMG1a/j53yptGMQQVM9fW4Gj\nhinChmzSj39jUgPpnQo/O78pjb0h91MUyExQb1OVpYc5uKopiAb8w/U3bJXu\nZr2X4eOstGDAKL1A00vZXa+HWQzf267bsD+SSfKtU7mOS01WzBXz+T0UrCxU\nBjAKzfaBBQLfamiyawjc/QGYr/ryOc2hjhbs6hil5CQovH9zLZsxLfYo3Zs2\nqMSXTVIFfuyfzDTFz6yhk1YV/krCSJjEdrkEsekAX3cFDxTpS3U/ZVl49Qtw\nNJvmQmzkUhwxCuh5NPE51lmxyPgIzlCAP4/k+IBzvQNKmxcGbO5jqYhzlKEa\nQ2KDxhu27IPw+UrR/Lqu+hIefsyk/Yq3aM3bw5wAZ+e14ZNUUTWvRn721Q94\nIZ8jDzeqt3u9M8STfa240MuFEkhY1pEGGaWiXngwYa0Jp35melEt4Tff2y4H\n48UJcvP9Xg0UAuTlE+aiSJeAOrffGHclWoloAz9auKCZhqQLPsfd8vc5tpM+\n4p5bgQmuKVhLmKFP1feks5lITX3z5IrBfrBY+NZLsXHXXHEYw89ddHW3ghB0\nK02ZnoCxvkccrUGdl/DgBYaH0zKL2lgDvAPgRUJ5m6lS/Htx55IhzvEuwMno\nGlDI\r\n=IHmG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDsjNFRiiL6YpxOTpedbXgUFBPMyQQCHDpR2jfKo+5T3AIgQX8hKAHgoai1huZzEFptmcKP/Hj2xvatlSSWO/QzY2g="}]},"maintainers":[{"name":"rogeru","email":"roger.urscheler@unify.com"},{"name":"rpastro","email":"rodrigo.pastro@unify.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/circuit-sdk_1.2.5601_1552999435784_0.3775260763229107"},"_hasShrinkwrap":false},"1.2.5402":{"name":"circuit-sdk","version":"1.2.5402","description":"Circuit SDK","main":"circuit-node.js","scripts":{"test:browser":"node test/index","test:node":"mocha ./test/node/* --recursive --timeout=5000 --exit","test":"npm run test:node && npm run test:browser"},"author":{"name":"Unify Inc."},"contributors":[{"name":"Roger Urscheler","email":"roger.urscheler@unify.com"},{"name":"Rodrigo Pastro","email":"rodrigo.pastro@unify.com"},{"name":"Johannes Ruetschi","email":"johannes.ruetschi@unify.com"}],"license":"Apache-2.0","homepage":"https://github.com/circuit/circuit-sdk","engines":{"node":">= 4.5.0"},"repository":{"type":"git","url":"git://github.com/circuit/circuit-sdk.git"},"bugs":{"url":"http://github.com/circuit/circuit-sdk/issues"},"keywords":["api","webrtc","circuit","collaboration","sdk"],"browser":{"electron":false,"./circuit-node.js":"./circuit.js"},"unpkg":"circuit.min.js","dependencies":{"ws":"~3.3.3"},"devDependencies":{"chai":"^4.1.2","express":"^4.16.2","globby":"^8.0.1","minimist":"^1.2.0","mocha":"^5.0.1","puppeteer":"^1.1.1","serve-static":"^1.13.2"},"gitHead":"20b9515e746fcf9d62d2d1b51414439eeca29adf","_id":"circuit-sdk@1.2.5402","_npmVersion":"5.3.0","_nodeVersion":"8.11.1","_npmUser":{"name":"rogeru","email":"roger.urscheler@atos.net"},"dist":{"integrity":"sha512-hUzNdRdmtSc4lvVHyV+S+HqnvUY6xbDotyySYBm4FhfLAI0Q42TdzPuqrcnfOsdsIDwNe3shfD8uwYe1L/V2fg==","shasum":"007f6a82df531bd89b4353a2b6f6ed9b19d4f62a","tarball":"https://registry.npmjs.org/circuit-sdk/-/circuit-sdk-1.2.5402.tgz","fileCount":12,"unpackedSize":3466331,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJckOaxCRA9TVsSAnZWagAAEEwP/jpaR/gg1+rPAV4ti4dy\ncoAO1tV97qwBIFKD3UA+YJuCjGDIIQm0KJDPuVa2nH/4QJZUnoAHk+7LuuDj\n8T6E18DqQMqqJtkh3DtXir0Ow9swSMEyiG6Ns4lEqjV3KNGwebCAEXetqXGB\nGH02qFo75qiQsT2HwCrJccWvPzybNCiv/tR+i13wTgU2d3UL0VdpcdKhx+2y\njG+bL49rf3hrmNs6yCKlLOhIJeQbcwuZpMvFrTLb/AxpYvKUcCtDcB3zSIrk\nJgZtpbjlfzL9ZqZeBEDN20bZKLfwIf9mHkHBZg4FvachIlv8miXi5G/3SDpA\nlFPzCTAJojqBhAF0fIobgoH7+0X32iDnG7yZgSn+B+OZ14bLjy0sapJBESkm\nng2orXxA7MX9oRcLVVuamBL1muE8jRDh8vqmImxiYgbPFSzpswTXdRW5q7ke\nj5wWs0u2wQIHFmONRnQ4Rgp12k6+m8oBJv9UV/PxoIY/3yGhK+7yyyc7qCFE\nr2aHZXSmvdwve5Ow0/Xq2DeylSR2r6PX7i12k0zW0ZcVaScYusB9ShmEDonV\nvDyr6MKWjAgy5jkUSXkoZDr05E0t9mbU4Zyb5zSn90oUlvIZ6OlSvsZDpxzW\n+8X1gPk7DQM1UdM7wciimY1L5fQ45uBDyJd/L/W4jZI43zEtAVSBR7AeE/B/\n5jlD\r\n=o4sj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDx5wrJG0liQlUQB7v2c0szYO7QHAw1fl3/vIPKD+Ju8AiEA0VzDO5gW+bW0ptKsNN1IHk41IXa4aEB9zYlPtEknw6w="}]},"maintainers":[{"name":"rogeru","email":"roger.urscheler@unify.com"},{"name":"rpastro","email":"rodrigo.pastro@unify.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/circuit-sdk_1.2.5402_1553000112842_0.24797708627502613"},"_hasShrinkwrap":false},"1.2.5603":{"name":"circuit-sdk","version":"1.2.5603","description":"Circuit SDK","main":"circuit-node.js","scripts":{"test:browser":"node test/index","test:node":"mocha ./test/node/* --recursive --timeout=5000 --exit","test":"npm run test:node && npm run test:browser"},"author":{"name":"Unify Inc."},"contributors":[{"name":"Roger Urscheler","email":"roger.urscheler@unify.com"},{"name":"Rodrigo Pastro","email":"rodrigo.pastro@unify.com"},{"name":"Johannes Ruetschi","email":"johannes.ruetschi@unify.com"}],"license":"Apache-2.0","homepage":"https://github.com/circuit/circuit-sdk","engines":{"node":">= 4.5.0"},"repository":{"type":"git","url":"git://github.com/circuit/circuit-sdk.git"},"bugs":{"url":"http://github.com/circuit/circuit-sdk/issues"},"keywords":["api","webrtc","circuit","collaboration","sdk"],"browser":{"electron":false,"./circuit-node.js":"./circuit.js"},"unpkg":"circuit.min.js","dependencies":{"ws":"~3.3.3"},"devDependencies":{"chai":"^4.1.2","express":"^4.16.2","globby":"^8.0.1","minimist":"^1.2.0","mocha":"^5.0.1","puppeteer":"^1.1.1","serve-static":"^1.13.2"},"gitHead":"71e774951db8ec4b23656c2cf060360571e13ed1","_id":"circuit-sdk@1.2.5603","_npmVersion":"5.6.0","_nodeVersion":"8.11.1","_npmUser":{"name":"rogeru","email":"roger.urscheler@atos.net"},"dist":{"integrity":"sha512-FCWGJngQKBMBw1hrTiiBX0VG1SHZe3ygk0qlQaxy39QFzEOkEtUS7dL/b60Ab8SO7Aefnqtl9hoG4iXBLPZauw==","shasum":"a7856881839177ae298d355eefaf33029a84f3bb","tarball":"https://registry.npmjs.org/circuit-sdk/-/circuit-sdk-1.2.5603.tgz","fileCount":10,"unpackedSize":3493352,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJctcyZCRA9TVsSAnZWagAAE1AP/2HFCw0U+6n1gszHAgoR\nRybn0ItmxzjO64zYCJL7DzbZkWPZMx0ypFNx2Q+g5SxIuLBiA3LZ0frsJr/w\nLLf6J2/DxLP1neTCe6l89T7ehbBPktyoAZDQRPG8pfp7R59Vjt3YqWzj86Ip\nKAZoJgk/wwhGdhTVtsJTx/ra3u58oK7SzY0oTX8YjbuI7z5cIIrDls3th2zD\nOINtVweJ0l02Wxyd3qyQcZl2Y/FXrFO/Ipzc9Gco7oioGHJcnEcIku3H/xBb\nHA+LzXfvEfanVdGv4KoSf4mYxlG/JEo/sbR416E5IIBgkRyfT0dDFGFS9v9C\n0/DN34PtR5jBqDh7j8emA7qfe+u4dB3hTwL0Irjr2duB1P30u7ai5u+pesRs\nAvJl+fa0zJYLhMTRNt/7feNUAL16zu2y9SJEYvc87mBUtMjM7fuW1WM/t6GP\nuWojOxP+N5WuO999izS5Qsz6aVA74qwuaMm0q8lBQif83ustzP8rBtu8/Db2\n/3H1sYv5dAmft1vP0IHwy13fBU8gzY7ZZJVyVX+tO2UuSbu+fVw3HOUFYHk3\nTwuoymzn4AkR6Mw98Du7LvDBXEBNTrE+wK9VY5E/rQ47MLCYOL8LChJTFNkN\nxpXmmTDIt+r/57vRYSeRzQtAzdG/OURJ4F8dys0RqBIHgPKn5XHfuWQcrowg\nLxIb\r\n=dD0N\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIApUCy+kLid8o1Mf59cdJSh5h9b18rgKgo32Qz4/JUHOAiEA10iscVuspNyWU2+TZxsvhPKT4mfRGucWERU2PT4Cri0="}]},"maintainers":[{"name":"rogeru","email":"roger.urscheler@unify.com"},{"name":"rpastro","email":"rodrigo.pastro@unify.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/circuit-sdk_1.2.5603_1555418265043_0.0885995306141294"},"_hasShrinkwrap":false},"1.2.6100":{"name":"circuit-sdk","version":"1.2.6100","description":"Circuit SDK","main":"circuit-node.js","scripts":{"test:browser":"node test/index","test:node":"mocha ./test/node/* --recursive --timeout=5000 --exit","test":"npm run test:node && npm run test:browser"},"author":{"name":"Unify Inc."},"contributors":[{"name":"Roger Urscheler","email":"roger.urscheler@unify.com"},{"name":"Rodrigo Pastro","email":"rodrigo.pastro@unify.com"},{"name":"Johannes Ruetschi","email":"johannes.ruetschi@unify.com"}],"license":"Apache-2.0","homepage":"https://github.com/circuit/circuit-sdk","engines":{"node":">= 4.5.0"},"repository":{"type":"git","url":"git://github.com/circuit/circuit-sdk.git"},"bugs":{"url":"http://github.com/circuit/circuit-sdk/issues"},"keywords":["api","webrtc","circuit","collaboration","sdk"],"browser":{"electron":false,"./circuit-node.js":"./circuit.js"},"unpkg":"circuit.min.js","dependencies":{"ws":"~3.3.3"},"devDependencies":{"chai":"^4.1.2","express":"^4.16.2","globby":"^8.0.1","minimist":"^1.2.0","mocha":"^5.0.1","puppeteer":"^1.1.1","serve-static":"^1.13.2"},"readme":"Circuit JavaScript and Node.js SDK\n==================================\n\n[![NPM release](https://img.shields.io/npm/v/circuit-sdk/beta.svg)](https://www.npmjs.com/package/circuit-sdk)\n[![Build Status](https://travis-ci.org/circuit/circuit-sdk.svg?branch=beta)](https://travis-ci.org/circuit/circuit-sdk)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n\n### Prerequisites\n* Developer account on circuitsandbox.net. Get it for free at [developer registration](https://www.circuit.com/web/developers/registration).\n* OAuth 2.0 `client_id` and optionally `client_secret`. Get if for free at [circuit.github.com/oauth](https://circuit.github.com/oauth).\n\n\n### API Reference\nhttps://circuitsandbox.net/sdk/ with most APIs described in the [Client](https://circuitsandbox.net/sdk/classes/Client.html) class.\n\nMore info at [circuit.github.io](https://circuit.github.io/).\n\n### Usage\n\n#### JavaScript\nAdd the the line below to the HTML file of your app. This will include the latest version of Circuit SDK and make the `Circuit` object available.\n```html\n<script type=\"text/javascript\" src=\"https://unpkg.com/circuit-sdk@beta\"></script>\n```\n\nJS SDK can also be imported via CommonJS or AMD. View the repo [UMD](https://github.com/circuit/umd) for the different types of usage, or [circuit-ionic-start](https://github.com/circuit/circuit-ionic-starter) for example how import the SDK via `require` using webpack.\n\n#### Node.js\n```bash\nnpm install --save circuit-sdk@beta\n```\n\n### Application Types\nThe majority of apps fall in one of the three types below. Each type uses a different OAuth 2.0 Grant.\n\n1. **Client-side web applications** use the JavaScript SDK with the [OAuth 2.0 Implicit Grant](https://circuit.github.io/oauth.html#implicit).\n   ```javascript\n   // No client_secret needed for Implicit Grant. SDK will obtain access token.\n   let client = new Circuit.Client({\n     client_id: '<your client_id>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon()\n     .then(user => console.log('Logged on as ' + user.displayName))\n   ```\n\n2. **Server-side web applications** use the JavaScript SDK (or [REST API](https://circuitsandbox.net/rest/v2/swagger/ui/index.html)) on the client, but handle the authentication flow on the server using the [OAuth 2.0 Authorization Code Grant](https://circuit.github.io/oauth.html#authorization_code). The access token is obtained on the server and then passed to the client to use in the Circuit JavaScript SDK. These apps may also use the Node.js SDK on the server side to act on behalf of the user.<br>\nExample apps: [node-linkify](https://github.com/circuit/node-linkify) or [circuit-google-assistant](https://github.com/circuit/circuit-google-assistant)\n   ```javascript\n   // access token is obtained and managed by server-side app\n   let client = new Circuit.Client({\n     client_id: '<your client_id>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon({accessToken: '<access_token>'})\n     .then(user => console.log('Logged on as ' + user.displayName))\n   ```\n\n3. **Bots** use the [Node.js SDK](https://www.npmjs.com/package/circuit-sdk) or the [REST API](https://circuitsandbox.net/rest/v2/swagger/ui/index.html) and use the [OAuth 2.0 Client Credentials Grant](https://circuit.github.io/oauth.html#client_credentials). Bots are a special type of user; they don't login on behalf of a regular user, hence no OAuth popup asking for a user`s credentials and permissions.<br>\nExample bots: [xlator-bot](https://github.com/circuit/xlator-bot) or [node-sdk-example](https://github.com/circuit/node-sdk-example)<br>\nExample electron bots: [webrtc-bot-example](https://github.com/circuit/webrtc-bot-example) or [live-cam-bot](https://github.com/circuit/live-cam-bot)\n   ```javascript\n   const Circuit = require('circuit-sdk');\n   let client = new Circuit.Client({\n     client_id: '<client_id>',\n     client_secret: '<client_secret>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon()\n     .then(user => console.log('Logged on as bot: ' + user.emailAddress))\n   ```\n\n\n\n### Examples\n\n> JavaScript examples are located at [/examples/js](/examples/js) with more examples on [jsbin](https://circuit.github.io/jssdk.html#jsbin).\n\n> Node.js example apps are on [github](https://github.com/circuit). A summary is listed [here](https://circuit.github.io/nodejs.html). Runkit allows playing with Node.js modules live, similar to jsbin or jsfiddle on the client. [Try it on runkit](https://runkit.com/rogeru/circuit-sdk)\n\nHere are some snippets to get you started.\n\n#### Create Group Conversation and send text message\nLogon as bot, create a group conversation with two users and send a text message.\n```javascript\nclient.logon()\n  .then(user => console.log(`Logged on as ${user.displayName}`, user))\n  .then(() => client.getUsersByEmail(['kim.jackson@mailinator.com', 'maeva.barnaby@mailinator.com']))\n  .then(users => users.map(user => user.userId))\n  .then(userIds => client.createGroupConversation(userIds, 'runkit example'))\n  .then(conv => client.addTextItem(conv.convId, 'I am test bot. What can I do for you?'))\n  .then(client.logout)\n  .catch(console.error)\n```\n\n#### Get Conversations\nGet 10 newest conversations of logged on user.\n```javascript\nclient.getConversations({numberOfConversations: 10})\n  .then(conversations => console.log(`Retrieved ${conversations.length} conversations`))\n```\n\n#### Video call with another Circuit user\nStart a video call with another user. Create conversation if not yet existing.\n> Only applicable to JavaScript SDK and only on browsers supporting WebRTC\n```javascript\nclient.makeCall('bob@company.com', {audio: true, video: true}, true)\n  .then(call => console.log('New call: ', call));\n```\n\n#### Listen for events\n```javascript\n// Register new items added to the feed of this user. E.g. incoming text message\nclient.addEventListener('itemAdded', item =>\n  console.log('itemAdded event received:', item));\n\n// Register for connection state changes\nclient.addEventListener('connectionStateChanged', evt => {\n  console.log(`New state is ${evt.state}`);\n});\n\n// Register and log all events\nCircuit.supportedEvents.forEach(e => client.addEventListener(e, console.log));\n```\n\n#### Create an injector\nInjectors allow extending the conversation, item and user objects within the SDK.\nIn this example a new attribute `teaser` is created on the item object. This `teaser` will be added to item objects in any reponse or event from the SDK.\n```javascript\nCircuit.Injectors.itemInjector = function (item) {\n  if (item.type === Circuit.Enums.ConversationItemType.TEXT) {\n    // Create item.teaser attribute with replacing br and hr tags with a space\n    item.teaser = item.text.content.replace(/<(br[\\/]?|\\/li|hr[\\/]?)>/gi, ' ');\n  } else {\n    item.teaser = item.type;\n  }\n};\n```\n\n### Supported Browsers\nChrome and Firefox are officially supported.\n\n### Help us improve the SDK\nHelp us improve the SDK or examples by sending us a pull-request or opening a [GitHub Issue](https://github.com/circuit/circuit-sdk/issues/new).\n","readmeFilename":"README.md","gitHead":"f71c72249e4a443e153a0009f9f628ecde1d6e63","_id":"circuit-sdk@1.2.6100","_npmVersion":"5.6.0","_nodeVersion":"8.11.1","_npmUser":{"name":"rogeru","email":"roger.urscheler@atos.net"},"dist":{"integrity":"sha512-t7+0C8JxhW7PXqzU+pukLp79AjOeDPGKnijp0ays8APyWsMmoXaRI05KrgtIZdsyriK/S60SqvL9PNvYEJD5CA==","shasum":"946469f20324e56086cac84fb441ec9958224dd1","tarball":"https://registry.npmjs.org/circuit-sdk/-/circuit-sdk-1.2.6100.tgz","fileCount":10,"unpackedSize":3616779,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc9qzdCRA9TVsSAnZWagAAG98P/RCqwR8RrkFnbN3M85l/\nvK1oV9nyi20BPyEVPPMvUYUw72O3ePD5Ss1ZewUM+I0Zvo6wTirrmBWQJvRg\nLnF+MX/TR7RjxazpgKA81GJxNmZjpc/q0B2X26gWmpZZqaN3v8xPr5b2w4xU\n2p6D3AXNXaK7A++gQDfAa8YGwsYJ5aqd2/2VSvAuyhQbY+yhPGG79UtspZjG\nG7XdfVoON7Lu7tPlMNysWOQV0i72k/AE6ZjaKa72I8K9cBtzzys4+sQbcupH\n5fqZrlLubuEklZJMVnsh4EcVngallg5KKdYMe0n7sjoF5sbyyCNeknAt0J45\nMKCI3buY7749RACFVfj2laMU35C3mllZQ2x2ARqdfeY8qpKMsG6m6Go52E1+\n1w6A8CIdSBzlZmVXb9d9shQsnvN9XFTZAe65jBMdGxSPO1S3DTjtclcBG0Eg\n/h5duiznWBUKgUQ7k7RT1rCy/ZHszl1K3M9LxAna75nzb8CIcDpont+Y6JtO\nwciABzHGjkbPGnyypi/jYOCmQlfY5Su+56AY5geCcGbqoFCsZgiuMPMAwpjV\n8iUDNs11l1CEGuXVwKunyP0VsWgq28jU7ld+b52CDRAkr5CmEs99Fl92Xr6N\nTa6Q9MxljSQn0mnHxB8ItFOFKdEo00HYRzXZJvkN5cmFkrsCinxcAsObUtw4\n0vRG\r\n=/KmO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGKGN/AGxxmPwy2ec180/joC9uZYB7167pWvKTZ3vQSSAiBrxQLwe6J2SzNBxaNYpOvTK0MiqN5ximXEZDvYwvYEzA=="}]},"maintainers":[{"name":"rogeru","email":"roger.urscheler@unify.com"},{"name":"rpastro","email":"rodrigo.pastro@unify.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/circuit-sdk_1.2.6100_1559669980565_0.6658141792457457"},"_hasShrinkwrap":false},"1.2.6002":{"name":"circuit-sdk","version":"1.2.6002","description":"Circuit SDK","main":"circuit-node.js","scripts":{"test:browser":"node test/index","test:node":"mocha ./test/node/* --recursive --timeout=5000 --exit","test":"npm run test:node && npm run test:browser"},"author":{"name":"Unify Inc."},"contributors":[{"name":"Roger Urscheler","email":"roger.urscheler@unify.com"},{"name":"Rodrigo Pastro","email":"rodrigo.pastro@unify.com"},{"name":"Johannes Ruetschi","email":"johannes.ruetschi@unify.com"}],"license":"Apache-2.0","homepage":"https://github.com/circuit/circuit-sdk","engines":{"node":">= 4.5.0"},"repository":{"type":"git","url":"git://github.com/circuit/circuit-sdk.git"},"bugs":{"url":"http://github.com/circuit/circuit-sdk/issues"},"keywords":["api","webrtc","circuit","collaboration","sdk"],"browser":{"electron":false,"./circuit-node.js":"./circuit.js"},"unpkg":"circuit.min.js","dependencies":{"ws":"~3.3.3"},"devDependencies":{"chai":"^4.1.2","express":"^4.16.2","globby":"^8.0.1","minimist":"^1.2.0","mocha":"^5.0.1","puppeteer":"^1.1.1","serve-static":"^1.13.2"},"gitHead":"d4461417fbb5fb43fba2c58d6bc1713b98dc865a","_id":"circuit-sdk@1.2.6002","_npmVersion":"5.6.0","_nodeVersion":"8.11.1","_npmUser":{"name":"rogeru","email":"roger.urscheler@atos.net"},"dist":{"integrity":"sha512-ONrLo87NYW1mizyGU6TULAivcYLyJARWrgl7Wy+6y5d3iR/9sOpQ8OAyJA0Y5USHENHobj91Rv85xAM7LMojQA==","shasum":"8649c51d3a89d3652c79016080e771d8a17b5193","tarball":"https://registry.npmjs.org/circuit-sdk/-/circuit-sdk-1.2.6002.tgz","fileCount":11,"unpackedSize":3622030,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc/kT4CRA9TVsSAnZWagAAcKoP/3uGw347kUUzx7iAgJfD\nEwuPWgGB88BTpNxZDPWBdArbWXazot/9jyhE2lY/gS+EMdmO/y1RlJpv2Aym\na5V/484oMxtTNOjOxj6eSFFDe4Zuwa4LjZMl6QYDvHWCfN6V/ShTNKSvbSpu\nszDe+YMd2lCfcaa1Q7nkECvD8ELHpuwtq06Zw/5sxOurtlrqXmpwTXw7VyOl\nV8ovcMgyuYPewbrV8OzaXCotQ9/Lv4AvfQw7hIpfiU5eBJDE0fAQfnA33qzQ\ndoJlPF5E9/XBtFa10DXMAthJVuiqHI08Y0UHvbixhC8tFcIFCSYiUoRcKOUw\njkbKuGRNg0uq6M9XwlLFGZwN3DR9iLvRXvPIgMg2KbIKmh1vhMhshZYjFQRy\nRk/JKbnzMZDj4jbsU5qt7VZW8eDbFew0smJcn4xhCtAC/69ndw3zDzMRcaJQ\nZ9QfBJDlgeAZDCPNqY4G+Ws6ke701C1+an8f9Pg3t+MvuwEWrPQTFxiM/iFi\nmon2K4O6ju33HhRsbxnrJQFcFouJDSUugsJv6IDdq/6LrSEfu6ChkhrBRgHq\nJyGsqwvqn+b1BI3KsC0hgAWCVcWBIxerULNBWUEt44nsYNerMB/r5Hloj72N\nT4jrFq1cfMHy3A6cVZP1nWUcmOrnLSew/fwZv7C5KxbEVqeK0afhzXiSvhfe\nq2Jo\r\n=/Piq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDDUr0VDVa7HGNzfNT2BdjHaGe4zPOfRY1lTmxZLguLIgIgE/Kpb4OelIat7lapzvLV6kpxbaeiRhiDgoRq6Y5xv7U="}]},"maintainers":[{"name":"rogeru","email":"roger.urscheler@unify.com"},{"name":"rpastro","email":"rodrigo.pastro@unify.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/circuit-sdk_1.2.6002_1560167671511_0.6895461757637018"},"_hasShrinkwrap":false},"1.2.6402":{"name":"circuit-sdk","version":"1.2.6402","description":"Circuit SDK","main":"circuit-node.js","scripts":{"test:browser":"node test/index","test:node":"mocha ./test/node/* --recursive --timeout=5000 --exit","test":"npm run test:node && npm run test:browser"},"author":{"name":"Unify Inc."},"contributors":[{"name":"Roger Urscheler","email":"roger.urscheler@unify.com"},{"name":"Rodrigo Pastro","email":"rodrigo.pastro@unify.com"},{"name":"Johannes Ruetschi","email":"johannes.ruetschi@unify.com"}],"license":"Apache-2.0","homepage":"https://github.com/circuit/circuit-sdk","engines":{"node":">= 4.5.0"},"repository":{"type":"git","url":"git://github.com/circuit/circuit-sdk.git"},"bugs":{"url":"http://github.com/circuit/circuit-sdk/issues"},"keywords":["api","webrtc","circuit","collaboration","sdk"],"browser":{"electron":false,"./circuit-node.js":"./circuit.js"},"unpkg":"circuit.min.js","dependencies":{"ws":"~3.3.3"},"devDependencies":{"chai":"^4.1.2","express":"^4.16.2","globby":"^8.0.1","minimist":"^1.2.0","mocha":"^5.0.1","puppeteer":"^1.1.1","serve-static":"^1.13.2"},"gitHead":"73a14cde7b2adb6fde998f82949f14e964252c62","_id":"circuit-sdk@1.2.6402","_npmVersion":"5.6.0","_nodeVersion":"8.11.1","_npmUser":{"name":"rogeru","email":"roger.urscheler@atos.net"},"dist":{"integrity":"sha512-FvKquXi5eQYXNUPp+USt+DIHeoiSz0INfEO07KvH/H0TSqpuPSfv1mwPTD7vcta2Sv1p/Y1bimLSI8t7wZ8Flg==","shasum":"6deacd05d5a7c1953b135ca92f217b6cf2a9c0c9","tarball":"https://registry.npmjs.org/circuit-sdk/-/circuit-sdk-1.2.6402.tgz","fileCount":10,"unpackedSize":3684145,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdNbYWCRA9TVsSAnZWagAAVcgP/ig/1SFmseZbfvN3zXcV\nrAzIjRvnLUYAhVwMgmA9MhzmKfBy7lD+NFT8taiEs+Lllkb3Lg6Yn+MC2UwN\nvrzyqeZx65phd9v9yCAN+M4BF5dWMYOiKCuB4jdz+zVLGsHGcLj05RmXfz25\nwH+ipuuX7mHb2jiRQ3quVRmLYYIl4RNWIV+KmPNa7WVoN/Y2D3x/HqKTn9QO\ndCVCwEZ4hOQJOPYQd3aoVQFoBgEV/oYUxygGwgjRwEFTMWrp75IXl3uziL6w\ncl+XqE+FV+vIF3ZroRUlEF2dntgdkA5glxXUWUNCNzK9u9zj1AcyjQvk0Sbd\n+TFctOGeXGyQfjF8rXgP/oilWUNa0GpEMJdrukSpp2NvgVnvyfyL6CK72hTX\njTHcwgSo4o1c0jvfTTHaJjaoTYCmXtJNNDxrxdhqEH/iF/j8EhfEdLBR3ysQ\n912WDWxZinV1fRHzNjay850HeyTb/UqGqhJetrzF9xiIdE0l1onkQs6sg5+H\n6DzHuMxX3T9TPi21ZDVbT2uIiBVxTBlPSbSOID9X7akGYKj1JV/LLLGRjkzs\nNR55L2WfcvLVaVwKSkoOxBnJQhCnBVCJ9eyPlywkPWkgceWEuTPrSTvv5nEN\nzWc4hqTNsOqQ8KaJGa2bZxBMdsuRerRy7UiEbPGWodGfEVEP4tpn1m8gCfBO\nxsAI\r\n=RStV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDvoquSoTcdLx07oRSU5GGjCD55exz49GYJzDq2y3u/hAIhAMLHn9ii1y+Qv83Pqite0HASqyToFmlTosbilQ7eaV2U"}]},"maintainers":[{"name":"rogeru","email":"roger.urscheler@unify.com"},{"name":"rpastro","email":"rodrigo.pastro@unify.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/circuit-sdk_1.2.6402_1563801110409_0.8287972457753172"},"_hasShrinkwrap":false},"1.2.6900":{"name":"circuit-sdk","version":"1.2.6900","description":"Circuit SDK","main":"circuit-node.js","scripts":{"test:browser":"node test/index","test:node":"mocha ./test/node/* --recursive --timeout=5000 --exit","test":"npm run test:node && npm run test:browser"},"author":{"name":"Unify Inc."},"contributors":[{"name":"Roger Urscheler","email":"roger.urscheler@unify.com"},{"name":"Rodrigo Pastro","email":"rodrigo.pastro@unify.com"},{"name":"Johannes Ruetschi","email":"johannes.ruetschi@unify.com"}],"license":"Apache-2.0","homepage":"https://github.com/circuit/circuit-sdk","engines":{"node":">= 4.5.0"},"repository":{"type":"git","url":"git://github.com/circuit/circuit-sdk.git"},"bugs":{"url":"http://github.com/circuit/circuit-sdk/issues"},"keywords":["api","webrtc","circuit","collaboration","sdk"],"browser":{"electron":false,"./circuit-node.js":"./circuit.js"},"unpkg":"circuit.min.js","dependencies":{"ws":"~3.3.3"},"devDependencies":{"chai":"^4.1.2","express":"^4.16.2","globby":"^8.0.1","minimist":"^1.2.0","mocha":"^5.0.1","puppeteer":"^1.1.1","serve-static":"^1.13.2"},"readme":"Circuit JavaScript and Node.js SDK\n==================================\n\n[![NPM release](https://img.shields.io/npm/v/circuit-sdk/beta.svg)](https://www.npmjs.com/package/circuit-sdk)\n[![Build Status](https://travis-ci.org/circuit/circuit-sdk.svg?branch=beta)](https://travis-ci.org/circuit/circuit-sdk)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n\n### Prerequisites\n* Developer account on circuitsandbox.net. Get it for free at [developer registration](https://www.circuit.com/web/developers/registration).\n* OAuth 2.0 `client_id` and optionally `client_secret`. Get if for free at [circuit.github.com/oauth](https://circuit.github.com/oauth).\n\n\n### API Reference\nhttps://circuitsandbox.net/sdk/ with most APIs described in the [Client](https://circuitsandbox.net/sdk/classes/Client.html) class.\n\nMore info at [circuit.github.io](https://circuit.github.io/).\n\n### Usage\n\n#### JavaScript\nAdd the the line below to the HTML file of your app. This will include the latest version of Circuit SDK and make the `Circuit` object available.\n```html\n<script type=\"text/javascript\" src=\"https://unpkg.com/circuit-sdk@beta\"></script>\n```\n\nJS SDK can also be imported via CommonJS or AMD. View the repo [UMD](https://github.com/circuit/umd) for the different types of usage, or [circuit-ionic-start](https://github.com/circuit/circuit-ionic-starter) for example how import the SDK via `require` using webpack.\n\n#### Node.js\n```bash\nnpm install --save circuit-sdk@beta\n```\n\n### Application Types\nThe majority of apps fall in one of the three types below. Each type uses a different OAuth 2.0 Grant.\n\n1. **Client-side web applications** use the JavaScript SDK with the [OAuth 2.0 Implicit Grant](https://circuit.github.io/oauth.html#implicit).\n   ```javascript\n   // No client_secret needed for Implicit Grant. SDK will obtain access token.\n   let client = new Circuit.Client({\n     client_id: '<your client_id>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon()\n     .then(user => console.log('Logged on as ' + user.displayName))\n   ```\n\n2. **Server-side web applications** use the JavaScript SDK (or [REST API](https://circuitsandbox.net/rest/v2/swagger/ui/index.html)) on the client, but handle the authentication flow on the server using the [OAuth 2.0 Authorization Code Grant](https://circuit.github.io/oauth.html#authorization_code). The access token is obtained on the server and then passed to the client to use in the Circuit JavaScript SDK. These apps may also use the Node.js SDK on the server side to act on behalf of the user.<br>\nExample apps: [node-linkify](https://github.com/circuit/node-linkify) or [circuit-google-assistant](https://github.com/circuit/circuit-google-assistant)\n   ```javascript\n   // access token is obtained and managed by server-side app\n   let client = new Circuit.Client({\n     client_id: '<your client_id>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon({accessToken: '<access_token>'})\n     .then(user => console.log('Logged on as ' + user.displayName))\n   ```\n\n3. **Bots** use the [Node.js SDK](https://www.npmjs.com/package/circuit-sdk) or the [REST API](https://circuitsandbox.net/rest/v2/swagger/ui/index.html) and use the [OAuth 2.0 Client Credentials Grant](https://circuit.github.io/oauth.html#client_credentials). Bots are a special type of user; they don't login on behalf of a regular user, hence no OAuth popup asking for a user`s credentials and permissions.<br>\nExample bots: [xlator-bot](https://github.com/circuit/xlator-bot) or [node-sdk-example](https://github.com/circuit/node-sdk-example)<br>\nExample electron bots: [webrtc-bot-example](https://github.com/circuit/webrtc-bot-example) or [live-cam-bot](https://github.com/circuit/live-cam-bot)\n   ```javascript\n   const Circuit = require('circuit-sdk');\n   let client = new Circuit.Client({\n     client_id: '<client_id>',\n     client_secret: '<client_secret>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon()\n     .then(user => console.log('Logged on as bot: ' + user.emailAddress))\n   ```\n\n\n\n### Examples\n\n> JavaScript examples are located at [/examples/js](/examples/js) with more examples on [jsbin](https://circuit.github.io/jssdk.html#jsbin).\n\n> Node.js example apps are on [github](https://github.com/circuit). A summary is listed [here](https://circuit.github.io/nodejs.html). Runkit allows playing with Node.js modules live, similar to jsbin or jsfiddle on the client. [Try it on runkit](https://runkit.com/rogeru/circuit-sdk)\n\nHere are some snippets to get you started.\n\n#### Create Group Conversation and send text message\nLogon as bot, create a group conversation with two users and send a text message.\n```javascript\nclient.logon()\n  .then(user => console.log(`Logged on as ${user.displayName}`, user))\n  .then(() => client.getUsersByEmail(['kim.jackson@mailinator.com', 'maeva.barnaby@mailinator.com']))\n  .then(users => users.map(user => user.userId))\n  .then(userIds => client.createGroupConversation(userIds, 'runkit example'))\n  .then(conv => client.addTextItem(conv.convId, 'I am test bot. What can I do for you?'))\n  .then(client.logout)\n  .catch(console.error)\n```\n\n#### Get Conversations\nGet 10 newest conversations of logged on user.\n```javascript\nclient.getConversations({numberOfConversations: 10})\n  .then(conversations => console.log(`Retrieved ${conversations.length} conversations`))\n```\n\n#### Video call with another Circuit user\nStart a video call with another user. Create conversation if not yet existing.\n> Only applicable to JavaScript SDK and only on browsers supporting WebRTC\n```javascript\nclient.makeCall('bob@company.com', {audio: true, video: true}, true)\n  .then(call => console.log('New call: ', call));\n```\n\n#### Listen for events\n```javascript\n// Register new items added to the feed of this user. E.g. incoming text message\nclient.addEventListener('itemAdded', item =>\n  console.log('itemAdded event received:', item));\n\n// Register for connection state changes\nclient.addEventListener('connectionStateChanged', evt => {\n  console.log(`New state is ${evt.state}`);\n});\n\n// Register and log all events\nCircuit.supportedEvents.forEach(e => client.addEventListener(e, console.log));\n```\n\n#### Create an injector\nInjectors allow extending the conversation, item and user objects within the SDK.\nIn this example a new attribute `teaser` is created on the item object. This `teaser` will be added to item objects in any reponse or event from the SDK.\n```javascript\nCircuit.Injectors.itemInjector = function (item) {\n  if (item.type === Circuit.Enums.ConversationItemType.TEXT) {\n    // Create item.teaser attribute with replacing br and hr tags with a space\n    item.teaser = item.text.content.replace(/<(br[\\/]?|\\/li|hr[\\/]?)>/gi, ' ');\n  } else {\n    item.teaser = item.type;\n  }\n};\n```\n\n### Supported Browsers\nChrome and Firefox are officially supported.\n\n### Help us improve the SDK\nHelp us improve the SDK or examples by sending us a pull-request or opening a [GitHub Issue](https://github.com/circuit/circuit-sdk/issues/new).\n","readmeFilename":"README.md","gitHead":"475366dd6769cfa1f80e9a33231ea54cb9eb5a36","_id":"circuit-sdk@1.2.6900","_nodeVersion":"10.16.1","_npmVersion":"6.9.0","dist":{"integrity":"sha512-KXAMlgSU6v13cerqoai/G3wlA2wkKsiOqispmoGd7dmScFhwalibzT+QcqUB0ScEorKBl/40eDPrFoUGDvMUew==","shasum":"150d5c6f8abb55737c324d48a21d216098dcd77d","tarball":"https://registry.npmjs.org/circuit-sdk/-/circuit-sdk-1.2.6900.tgz","fileCount":10,"unpackedSize":3805756,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdd65jCRA9TVsSAnZWagAAlTEP+wfXJYlgVYDp0LpVoeB+\npoDSp60WzYLuWHoK8+GQai71OqSoVU0b0GVfNV7l2zVC8gL9nFBTqrWgDRpS\n7EDs2oAWfZNf5qC0AexVBrakAYSA1qMldoGmBPrCFOcvKt4Gt0a3kp9RQItC\nftbkmeN7mE9+3b6RFXS7DJMNTFz0LfGAr6XJy/adiD9vN4oaNtAfw4MOO3h4\nUJTjT1xJNVJyfBcG4XN4T7qL0LR43Zs9ci9ArWLlT52t3kpbSP6H/HA+JP7g\ntAgIB8pkUCf20ZTll+cePv0oxeG0KawD77Yf2CSHKyh1cQ+ZMQpuW4EUE6P7\n6j9HNRSuMGKWS/Q2kN3Uwk5y2pXaNBVphpig+gvdhpGUZaRSCUhqwi8VHq7l\nmFF41fiwDhNSlH7xMq6apwo63CKYt6KMw0z639z2wVZySY1Y7IY1iKhG5McU\nvp+heH4qbidoVTjtg/ZohTMGVBSCAtUIkmM3tTloOFMujBdGnjXQpTwKSOCA\n+7zpUJvkyoWh4god7TndPWdvENV7sH/saW+N3mT1W4Ghn9LKVj9tb/ngenN5\nLuFxRb31Nz9beVaL78VFrELFiP9PEJmCoB+324Q6q+tZ+l+899cFecM3hUAv\n4fzFeCgzPnnpfeAOqoLPuhoOgxEjam6m+eO1ZxmXY+SdAMIt59L8S5SoL5Ib\nDddK\r\n=S7Md\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHekTBtAolvwYU/orzcM94QL0V9KoCKm3Wmog621OL5UAiEArC4RYf5B/RTnEq+njEskmZ3s8PkEjprPZ1VJF1c7Q6U="}]},"maintainers":[{"name":"rogeru","email":"roger.urscheler@unify.com"},{"name":"rpastro","email":"rodrigo.pastro@unify.com"}],"_npmUser":{"name":"rogeru","email":"roger.urscheler@atos.net"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/circuit-sdk_1.2.6900_1568124514324_0.8702087735487556"},"_hasShrinkwrap":false},"1.2.7100":{"name":"circuit-sdk","version":"1.2.7100","description":"Circuit SDK","main":"circuit-node.js","scripts":{"test:browser":"node test/index","test:node":"mocha ./test/node/* --recursive --timeout=5000 --exit","test":"npm run test:node && npm run test:browser"},"author":{"name":"Unify Inc."},"contributors":[{"name":"Roger Urscheler","email":"roger.urscheler@atos.net"},{"name":"Rodrigo Pastro","email":"rodrigo.pastro@atos.net"},{"name":"Johannes Ruetschi","email":"johannes.ruetschi@atos.net"}],"license":"Apache-2.0","homepage":"https://github.com/circuit/circuit-sdk","engines":{"node":">= 4.5.0"},"repository":{"type":"git","url":"git://github.com/circuit/circuit-sdk.git"},"bugs":{"url":"http://github.com/circuit/circuit-sdk/issues"},"keywords":["api","webrtc","circuit","collaboration","sdk"],"browser":{"electron":false,"./circuit-node.js":"./circuit.js"},"unpkg":"circuit.min.js","dependencies":{"mime":"^2.4.4","ws":"~3.3.3"},"devDependencies":{"chai":"^4.1.2","express":"^4.16.2","globby":"^8.0.1","minimist":"^1.2.0","mocha":"^5.0.1","puppeteer":"^1.1.1","serve-static":"^1.13.2"},"readme":"Circuit JavaScript and Node.js SDK\n==================================\n\n[![NPM release](https://img.shields.io/npm/v/circuit-sdk/beta.svg)](https://www.npmjs.com/package/circuit-sdk)\n[![Build Status](https://travis-ci.org/circuit/circuit-sdk.svg?branch=beta)](https://travis-ci.org/circuit/circuit-sdk)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n\n### Prerequisites\n* Developer account on circuitsandbox.net. Get it for free at [developer registration](https://www.circuit.com/web/developers/registration).\n* OAuth 2.0 `client_id` and optionally `client_secret`. Get if for free at [circuit.github.com/oauth](https://circuit.github.com/oauth).\n\n\n### API Reference\nhttps://circuitsandbox.net/sdk/ with most APIs described in the [Client](https://circuitsandbox.net/sdk/classes/Client.html) class.\n\nMore info at [circuit.github.io](https://circuit.github.io/).\n\n### Usage\n\n#### JavaScript\nAdd the the line below to the HTML file of your app. This will include the latest version of Circuit SDK and make the `Circuit` object available.\n```html\n<script type=\"text/javascript\" src=\"https://unpkg.com/circuit-sdk@beta\"></script>\n```\n\nJS SDK can also be imported via CommonJS or AMD. View the repo [UMD](https://github.com/circuit/umd) for the different types of usage, or [circuit-ionic-start](https://github.com/circuit/circuit-ionic-starter) for example how import the SDK via `require` using webpack.\n\n#### Node.js\n```bash\nnpm install --save circuit-sdk@beta\n```\n\n### Application Types\nThe majority of apps fall in one of the three types below. Each type uses a different OAuth 2.0 Grant.\n\n1. **Client-side web applications** use the JavaScript SDK with the [OAuth 2.0 Implicit Grant](https://circuit.github.io/oauth.html#implicit).\n   ```javascript\n   // No client_secret needed for Implicit Grant. SDK will obtain access token.\n   let client = new Circuit.Client({\n     client_id: '<your client_id>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon()\n     .then(user => console.log('Logged on as ' + user.displayName))\n   ```\n\n2. **Server-side web applications** use the JavaScript SDK (or [REST API](https://circuitsandbox.net/rest/v2/swagger/ui/index.html)) on the client, but handle the authentication flow on the server using the [OAuth 2.0 Authorization Code Grant](https://circuit.github.io/oauth.html#authorization_code). The access token is obtained on the server and then passed to the client to use in the Circuit JavaScript SDK. These apps may also use the Node.js SDK on the server side to act on behalf of the user.<br>\nExample apps: [node-linkify](https://github.com/circuit/node-linkify) or [circuit-google-assistant](https://github.com/circuit/circuit-google-assistant)\n   ```javascript\n   // access token is obtained and managed by server-side app\n   let client = new Circuit.Client({\n     client_id: '<your client_id>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon({accessToken: '<access_token>'})\n     .then(user => console.log('Logged on as ' + user.displayName))\n   ```\n\n3. **Bots** use the [Node.js SDK](https://www.npmjs.com/package/circuit-sdk) or the [REST API](https://circuitsandbox.net/rest/v2/swagger/ui/index.html) and use the [OAuth 2.0 Client Credentials Grant](https://circuit.github.io/oauth.html#client_credentials). Bots are a special type of user; they don't login on behalf of a regular user, hence no OAuth popup asking for a user`s credentials and permissions.<br>\nExample bots: [xlator-bot](https://github.com/circuit/xlator-bot) or [node-sdk-example](https://github.com/circuit/node-sdk-example)<br>\nExample electron bots: [webrtc-bot-example](https://github.com/circuit/webrtc-bot-example) or [live-cam-bot](https://github.com/circuit/live-cam-bot)\n   ```javascript\n   const Circuit = require('circuit-sdk');\n   let client = new Circuit.Client({\n     client_id: '<client_id>',\n     client_secret: '<client_secret>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon()\n     .then(user => console.log('Logged on as bot: ' + user.emailAddress))\n   ```\n\n\n\n### Examples\n\n> JavaScript examples are located at [/examples/js](/examples/js) with more examples on [jsbin](https://circuit.github.io/jssdk.html#jsbin).\n\n> Node.js example apps are on [github](https://github.com/circuit). A summary is listed [here](https://circuit.github.io/nodejs.html). Runkit allows playing with Node.js modules live, similar to jsbin or jsfiddle on the client. [Try it on runkit](https://runkit.com/rogeru/circuit-sdk)\n\nHere are some snippets to get you started.\n\n#### Create Group Conversation and send text message\nLogon as bot, create a group conversation with two users and send a text message.\n```javascript\nclient.logon()\n  .then(user => console.log(`Logged on as ${user.displayName}`, user))\n  .then(() => client.getUsersByEmail(['kim.jackson@mailinator.com', 'maeva.barnaby@mailinator.com']))\n  .then(users => users.map(user => user.userId))\n  .then(userIds => client.createGroupConversation(userIds, 'runkit example'))\n  .then(conv => client.addTextItem(conv.convId, 'I am test bot. What can I do for you?'))\n  .then(client.logout)\n  .catch(console.error)\n```\n\n#### Get Conversations\nGet 10 newest conversations of logged on user.\n```javascript\nclient.getConversations({numberOfConversations: 10})\n  .then(conversations => console.log(`Retrieved ${conversations.length} conversations`))\n```\n\n#### Video call with another Circuit user\nStart a video call with another user. Create conversation if not yet existing.\n> Only applicable to JavaScript SDK and only on browsers supporting WebRTC\n```javascript\nclient.makeCall('bob@company.com', {audio: true, video: true}, true)\n  .then(call => console.log('New call: ', call));\n```\n\n#### Listen for events\n```javascript\n// Register new items added to the feed of this user. E.g. incoming text message\nclient.addEventListener('itemAdded', item =>\n  console.log('itemAdded event received:', item));\n\n// Register for connection state changes\nclient.addEventListener('connectionStateChanged', evt => {\n  console.log(`New state is ${evt.state}`);\n});\n\n// Register and log all events\nCircuit.supportedEvents.forEach(e => client.addEventListener(e, console.log));\n```\n\n#### Create an injector\nInjectors allow extending the conversation, item and user objects within the SDK.\nIn this example a new attribute `teaser` is created on the item object. This `teaser` will be added to item objects in any reponse or event from the SDK.\n```javascript\nCircuit.Injectors.itemInjector = function (item) {\n  if (item.type === Circuit.Enums.ConversationItemType.TEXT) {\n    // Create item.teaser attribute with replacing br and hr tags with a space\n    item.teaser = item.text.content.replace(/<(br[\\/]?|\\/li|hr[\\/]?)>/gi, ' ');\n  } else {\n    item.teaser = item.type;\n  }\n};\n```\n\n### Supported Browsers\nChrome and Firefox are officially supported.\n\n### Help us improve the SDK\nHelp us improve the SDK or examples by sending us a pull-request or opening a [GitHub Issue](https://github.com/circuit/circuit-sdk/issues/new).\n","readmeFilename":"README.md","gitHead":"99960be64ba37968ecd49d120e73e992bd01ca5e","_id":"circuit-sdk@1.2.7100","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"rogeru","email":"roger.urscheler@atos.net"},"dist":{"integrity":"sha512-l5X9bGMO4d2e52YItscTFMeYOjUCn0Qv4nCQ4ZlhoqV9vZQyLrTXyPMmn/yhJrGLnXV212fFnM18PX8ZswXZ3A==","shasum":"6c6c57a1b5557cf5d9fcb286688b5071bf268ab8","tarball":"https://registry.npmjs.org/circuit-sdk/-/circuit-sdk-1.2.7100.tgz","fileCount":10,"unpackedSize":3842648,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdp6MoCRA9TVsSAnZWagAAURUP/iQ7B/ofZjUxxP3zzYIC\nS+fkQZ862R2t1otx5I9nBgMdPI3JKP0YkuID0JPjFdz+IapF9/r+OmEBrJ19\nQptCoXN6vv0hY1Fwhtg7blnJr6wDrreMzlyL3p/E7s4or3SzysTsRIamVkvM\nVCaxe5XMuRyOTngxmZFYoCHs8BGJmUlXq5MKh38MFPoSMyOJxfhyJUGbdOhQ\nCnP2FQBntO8495wgK2bBXb/N7Loo4WLNpwnbBOhfPzQCiE/zvUaT52iasK9a\nYF3wF0Qyzzy41/WCO4J0h3pkXCkhk4Nwk33Fn98lhUWIKx057beUJX9r2fN3\ncHoapYVWvPnJx+OnRuTkUl9/djZg7LQvTHK5Jf8jmFRaLQkADCiAH1q5jVdg\nRbM0KclvnjgUkQBLtn1kd4FooTSJ1OeU0BB+LY88gDUYWIfal8RCqkqBrndQ\nJbX1hcJhXfX4OhuvMCgEfZtS42ohVmr0PuuZ3/0nWOS/qX3qSwqDknQxpZCa\ni3bUywODipyrEPr2JewOHIB0B52LNs1i2ekFEKuUvg0lnMrzZ22I2tQLpU+5\nK7GNWIKIFU/ckx3GvY1WPqcewPoWTxoJsqx1meedij4Z/ij3nk2LQjEI+AwL\nUC26+CkWfP835c7VsrqPadFaTt7MVlyhEcltij51K6uckwFZlkGS5GwJsvLT\nwELN\r\n=9Xz6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIChHHnMTX1/znPuheDx4TrOL/u9lvLq29SKkY3YGUJ5hAiAncmESbnHlKAz90ySNPysvNxrBTrCuTOjmcMUdUvvFUQ=="}]},"maintainers":[{"name":"rogeru","email":"roger.urscheler@unify.com"},{"name":"rpastro","email":"rodrigo.pastro@unify.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/circuit-sdk_1.2.7100_1571267367276_0.7078956073814133"},"_hasShrinkwrap":false},"1.2.7003":{"name":"circuit-sdk","version":"1.2.7003","description":"Circuit SDK","main":"circuit-node.js","scripts":{"test:browser":"node test/index","test:node":"mocha ./test/node/* --recursive --timeout=5000 --exit","test":"npm run test:node && npm run test:browser"},"author":{"name":"Unify Inc."},"contributors":[{"name":"Roger Urscheler","email":"roger.urscheler@atos.net"},{"name":"Rodrigo Pastro","email":"rodrigo.pastro@atos.net"},{"name":"Johannes Ruetschi","email":"johannes.ruetschi@atos.net"}],"license":"Apache-2.0","homepage":"https://github.com/circuit/circuit-sdk","engines":{"node":">= 4.5.0"},"repository":{"type":"git","url":"git://github.com/circuit/circuit-sdk.git"},"bugs":{"url":"http://github.com/circuit/circuit-sdk/issues"},"keywords":["api","webrtc","circuit","collaboration","sdk"],"browser":{"electron":false,"./circuit-node.js":"./circuit.js"},"unpkg":"circuit.min.js","dependencies":{"mime":"^2.4.4","ws":"~3.3.3"},"devDependencies":{"chai":"^4.1.2","express":"^4.16.2","globby":"^8.0.1","minimist":"^1.2.0","mocha":"^5.0.1","puppeteer":"^1.1.1","serve-static":"^1.13.2"},"gitHead":"86876f0922339304c75081704fb3bfb30dccb6a4","_id":"circuit-sdk@1.2.7003","_nodeVersion":"8.11.1","_npmVersion":"6.9.0","dist":{"integrity":"sha512-MDHTTVfY+xf5JSXdTmWyrJTOCDaJrYyar8lcKtV5gxmOOR63IMDBJ/LyzHJNK+0NLTbFYBXGz44bjD8kngaMNg==","shasum":"885f3a1af13b2a448a2663235ccba0536487746b","tarball":"https://registry.npmjs.org/circuit-sdk/-/circuit-sdk-1.2.7003.tgz","fileCount":11,"unpackedSize":3847029,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdwCMVCRA9TVsSAnZWagAAQgUP/3auA7wBW9HTElUp7zCh\n/EIbrCc0GfLCZwIcanW7laCCo41tj347h5qNimhO80OS4oOMMVsNo7cXagy5\nbswbJ9mgHd4SnlTHHb76iZzFKD7GxOWMLNC06EAbYtkfu2rG8qgcFZvsuo6K\n+Hs4lDmmT1Gg9k68Rf95QJY1yXiwHk5j2/6paCHMhFi0r9fobXZ5SgXXw3B9\ne0kfBwODmO5TxRW5pYKC9wZId9lRPXvDjYaEw999AzsOkgDHsheQtQQWcSj7\nYMVI+hm6M6inb60KPvjYsHaszBEzLBLRLjlapr0GiTFhtOpkfbpg6uVg9y6L\nVeuWqQBok8tf76SLIzTNeNjspYe6/fTPjs/YJLX0NNKX88y0ebBnss62D2Ce\nfZfGVsXgnW/UZ9B9iaOFsGMDzxIjfFOMn2V8x4bceGwv8f5YNxpVSyq1ZFHU\nHsk3GI5oLi0zTCEepfTSd0rxi7PWXSp4qiu5NEParZRzm97AXVtlJ+7OFRZg\nkcrjg6qD3jodJRMHBt1UGagUcmlSJv6whluN+6WSSN8k5fPjtz/35UZikxQE\nTVI78/0AKrKemVIoZrCZZIP+O39WKoiV7Rd+uYRtNI+YLSMr6EDULEjj2sqD\nJ5aqnUqWl7CAyy3WVWNwkynpCg5AVUptoF0wKDVtrS2CXORSM9rMi1jJHF5K\nPnfM\r\n=L54j\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCHfOEKn5bfwODk64MIcZCcSwAJfAjQjm3DgcmbtlVURQIgEBfxkvXvjxDzgSZKk4wX3AVlhtmrNZQb5a9fp5pBN4I="}]},"maintainers":[{"name":"rogeru","email":"roger.urscheler@unify.com"},{"name":"rpastro","email":"rodrigo.pastro@unify.com"}],"_npmUser":{"name":"rogeru","email":"roger.urscheler@atos.net"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/circuit-sdk_1.2.7003_1572872981515_0.3379663879799488"},"_hasShrinkwrap":false},"1.2.7201":{"name":"circuit-sdk","version":"1.2.7201","description":"Circuit SDK","main":"circuit-node.js","scripts":{"test:browser":"node test/index","test:node":"mocha ./test/node/* --recursive --timeout=5000 --exit","test":"npm run test:node && npm run test:browser"},"author":{"name":"Unify Inc."},"contributors":[{"name":"Roger Urscheler","email":"roger.urscheler@atos.net"},{"name":"Rodrigo Pastro","email":"rodrigo.pastro@atos.net"},{"name":"Johannes Ruetschi","email":"johannes.ruetschi@atos.net"}],"license":"Apache-2.0","homepage":"https://github.com/circuit/circuit-sdk","engines":{"node":">= 4.5.0"},"repository":{"type":"git","url":"git://github.com/circuit/circuit-sdk.git"},"bugs":{"url":"http://github.com/circuit/circuit-sdk/issues"},"keywords":["api","webrtc","circuit","collaboration","sdk"],"browser":{"electron":false,"./circuit-node.js":"./circuit.js"},"unpkg":"circuit.min.js","dependencies":{"mime":"^2.4.4","ws":"~3.3.3"},"devDependencies":{"chai":"^4.1.2","express":"^4.16.2","globby":"^8.0.1","minimist":"^1.2.0","mocha":"^5.0.1","puppeteer":"^1.1.1","serve-static":"^1.13.2"},"readme":"Circuit JavaScript and Node.js SDK\n==================================\n\n[![NPM release](https://img.shields.io/npm/v/circuit-sdk/beta.svg)](https://www.npmjs.com/package/circuit-sdk)\n[![Build Status](https://travis-ci.org/circuit/circuit-sdk.svg?branch=beta)](https://travis-ci.org/circuit/circuit-sdk)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n\n### Prerequisites\n* Developer account on circuitsandbox.net. Get it for free at [developer registration](https://www.circuit.com/web/developers/registration).\n* OAuth 2.0 `client_id` and optionally `client_secret`. Get if for free at [circuit.github.com/oauth](https://circuit.github.com/oauth).\n\n\n### API Reference\nhttps://circuitsandbox.net/sdk/ with most APIs described in the [Client](https://circuitsandbox.net/sdk/classes/Client.html) class.\n\nMore info at [circuit.github.io](https://circuit.github.io/).\n\n### Usage\n\n#### JavaScript\nAdd the the line below to the HTML file of your app. This will include the latest version of Circuit SDK and make the `Circuit` object available.\n```html\n<script type=\"text/javascript\" src=\"https://unpkg.com/circuit-sdk@beta\"></script>\n```\n\nJS SDK can also be imported via CommonJS or AMD. View the repo [UMD](https://github.com/circuit/umd) for the different types of usage, or [circuit-ionic-start](https://github.com/circuit/circuit-ionic-starter) for example how import the SDK via `require` using webpack.\n\n#### Node.js\n```bash\nnpm install --save circuit-sdk@beta\n```\n\n### Application Types\nThe majority of apps fall in one of the three types below. Each type uses a different OAuth 2.0 Grant.\n\n1. **Client-side web applications** use the JavaScript SDK with the [OAuth 2.0 Implicit Grant](https://circuit.github.io/oauth.html#implicit).\n   ```javascript\n   // No client_secret needed for Implicit Grant. SDK will obtain access token.\n   let client = new Circuit.Client({\n     client_id: '<your client_id>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon()\n     .then(user => console.log('Logged on as ' + user.displayName))\n   ```\n\n2. **Server-side web applications** use the JavaScript SDK (or [REST API](https://circuitsandbox.net/rest/v2/swagger/ui/index.html)) on the client, but handle the authentication flow on the server using the [OAuth 2.0 Authorization Code Grant](https://circuit.github.io/oauth.html#authorization_code). The access token is obtained on the server and then passed to the client to use in the Circuit JavaScript SDK. These apps may also use the Node.js SDK on the server side to act on behalf of the user.<br>\nExample apps: [node-linkify](https://github.com/circuit/node-linkify) or [circuit-google-assistant](https://github.com/circuit/circuit-google-assistant)\n   ```javascript\n   // access token is obtained and managed by server-side app\n   let client = new Circuit.Client({\n     client_id: '<your client_id>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon({accessToken: '<access_token>'})\n     .then(user => console.log('Logged on as ' + user.displayName))\n   ```\n\n3. **Bots** use the [Node.js SDK](https://www.npmjs.com/package/circuit-sdk) or the [REST API](https://circuitsandbox.net/rest/v2/swagger/ui/index.html) and use the [OAuth 2.0 Client Credentials Grant](https://circuit.github.io/oauth.html#client_credentials). Bots are a special type of user; they don't login on behalf of a regular user, hence no OAuth popup asking for a user`s credentials and permissions.<br>\nExample bots: [xlator-bot](https://github.com/circuit/xlator-bot) or [node-sdk-example](https://github.com/circuit/node-sdk-example)<br>\nExample electron bots: [webrtc-bot-example](https://github.com/circuit/webrtc-bot-example) or [live-cam-bot](https://github.com/circuit/live-cam-bot)\n   ```javascript\n   const Circuit = require('circuit-sdk');\n   let client = new Circuit.Client({\n     client_id: '<client_id>',\n     client_secret: '<client_secret>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon()\n     .then(user => console.log('Logged on as bot: ' + user.emailAddress))\n   ```\n\n\n\n### Examples\n\n> JavaScript examples are located at [/examples/js](/examples/js) with more examples on [jsbin](https://circuit.github.io/jssdk.html#jsbin).\n\n> Node.js example apps are on [github](https://github.com/circuit). A summary is listed [here](https://circuit.github.io/nodejs.html). Runkit allows playing with Node.js modules live, similar to jsbin or jsfiddle on the client. [Try it on runkit](https://runkit.com/rogeru/circuit-sdk)\n\nHere are some snippets to get you started.\n\n#### Create Group Conversation and send text message\nLogon as bot, create a group conversation with two users and send a text message.\n```javascript\nclient.logon()\n  .then(user => console.log(`Logged on as ${user.displayName}`, user))\n  .then(() => client.getUsersByEmail(['kim.jackson@mailinator.com', 'maeva.barnaby@mailinator.com']))\n  .then(users => users.map(user => user.userId))\n  .then(userIds => client.createGroupConversation(userIds, 'runkit example'))\n  .then(conv => client.addTextItem(conv.convId, 'I am test bot. What can I do for you?'))\n  .then(client.logout)\n  .catch(console.error)\n```\n\n#### Get Conversations\nGet 10 newest conversations of logged on user.\n```javascript\nclient.getConversations({numberOfConversations: 10})\n  .then(conversations => console.log(`Retrieved ${conversations.length} conversations`))\n```\n\n#### Video call with another Circuit user\nStart a video call with another user. Create conversation if not yet existing.\n> Only applicable to JavaScript SDK and only on browsers supporting WebRTC\n```javascript\nclient.makeCall('bob@company.com', {audio: true, video: true}, true)\n  .then(call => console.log('New call: ', call));\n```\n\n#### Listen for events\n```javascript\n// Register new items added to the feed of this user. E.g. incoming text message\nclient.addEventListener('itemAdded', item =>\n  console.log('itemAdded event received:', item));\n\n// Register for connection state changes\nclient.addEventListener('connectionStateChanged', evt => {\n  console.log(`New state is ${evt.state}`);\n});\n\n// Register and log all events\nCircuit.supportedEvents.forEach(e => client.addEventListener(e, console.log));\n```\n\n#### Create an injector\nInjectors allow extending the conversation, item and user objects within the SDK.\nIn this example a new attribute `teaser` is created on the item object. This `teaser` will be added to item objects in any reponse or event from the SDK.\n```javascript\nCircuit.Injectors.itemInjector = function (item) {\n  if (item.type === Circuit.Enums.ConversationItemType.TEXT) {\n    // Create item.teaser attribute with replacing br and hr tags with a space\n    item.teaser = item.text.content.replace(/<(br[\\/]?|\\/li|hr[\\/]?)>/gi, ' ');\n  } else {\n    item.teaser = item.type;\n  }\n};\n```\n\n### Supported Browsers\nChrome and Firefox are officially supported.\n\n### Help us improve the SDK\nHelp us improve the SDK or examples by sending us a pull-request or opening a [GitHub Issue](https://github.com/circuit/circuit-sdk/issues/new).\n","readmeFilename":"README.md","gitHead":"c003c7f0dd545e69375928c93a34c472760e8b0d","_id":"circuit-sdk@1.2.7201","_nodeVersion":"8.11.1","_npmVersion":"6.9.0","dist":{"integrity":"sha512-cLAIfE5YJxGFrWLS82rHcTv+KRrTKN7UjMguG8GUYQuFAJFvEdTACUj2m6pXBSbX8LLv8MjPDGm0/CbUYnj6IA==","shasum":"b3bf0cca8d27029c15b613262eb75d96b87ff89d","tarball":"https://registry.npmjs.org/circuit-sdk/-/circuit-sdk-1.2.7201.tgz","fileCount":10,"unpackedSize":3878516,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdwCPLCRA9TVsSAnZWagAAkVwP+gIWbDceRnL2kX5oNU+W\neliqGasgrfiLU0GA2fgNEayvZZ/VEgUHyYNyLkJPRqHnkpkhtS0b+pfbnQeN\nmM+kTgSUpM5XuOrQe7zddoMP9ZUJqDpjWnQvOp22iXAKjm4+DxP8ufxAAUdR\nYhmkbVTaJaUhz7q7mXRSXphthGFnarn156u+b0ePsxoYpEIeeYwVtSUuE4HL\ny+6WiZsgjFCQKYovsx9/Ty+/JgodsFL5dthNcOrts/7fmVrGInMQV1sxHNve\nVxbIoAiTjLK97HeYTnSAZdWlx/lS82jpJHxbPO8eNYvfUrqEKqHDLtiAYkoP\nk/tgpE9BbQ3ILo67RkxSr2tL2WZEXzWBYL6R+ti9Yxs2T4wBJEFK9Y1Hf9rq\nK0o8B3JeTe8+kXwnsRQwx2XYY2SMvGkcmGuCpctCekmZ10YurC+cstoi7fUs\n5cctgpW+8YH1St0512WCIVBzC2SGsOvF79Jkm7KnK+lQVJK7XZGLcC83o9QR\nvKFUxb29APQ1KqbQOgnOxk1XfnW0jLNIM3r7BL8MnCFyYB4a7jRyFDCfAfED\n5d0ZcK5FVjkoGFV41oMRscYjffXYAwsfhpBHs2bH2LWwMzRcXk5A8Dm9IAeu\nzH8Hij2fx7b3kAWRu4zopqcHZTExFNnsBY820F1YIpVSNJV+wLO8F7pdKlUt\nYGB7\r\n=1ZjA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGpDMH9FYay+0wOu7T8C5H+dxAbsBlDRrSWqEaEMqKkaAiAQbZDKgImv/Nalz8p86z7r5ueCKqpZkoyfVOSdhgmTMw=="}]},"maintainers":[{"name":"rogeru","email":"roger.urscheler@unify.com"},{"name":"rpastro","email":"rodrigo.pastro@unify.com"}],"_npmUser":{"name":"rogeru","email":"roger.urscheler@atos.net"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/circuit-sdk_1.2.7201_1572873162649_0.5212721932383066"},"_hasShrinkwrap":false},"1.2.7202":{"name":"circuit-sdk","version":"1.2.7202","description":"Circuit SDK","main":"circuit-node.js","scripts":{"test:browser":"node test/index","test:node":"mocha ./test/node/* --recursive --timeout=5000 --exit","test":"npm run test:node && npm run test:browser"},"author":{"name":"Unify Inc."},"contributors":[{"name":"Roger Urscheler","email":"roger.urscheler@atos.net"},{"name":"Rodrigo Pastro","email":"rodrigo.pastro@atos.net"},{"name":"Johannes Ruetschi","email":"johannes.ruetschi@atos.net"}],"license":"Apache-2.0","homepage":"https://github.com/circuit/circuit-sdk","engines":{"node":">= 4.5.0"},"repository":{"type":"git","url":"git://github.com/circuit/circuit-sdk.git"},"bugs":{"url":"http://github.com/circuit/circuit-sdk/issues"},"keywords":["api","webrtc","circuit","collaboration","sdk"],"browser":{"electron":false,"./circuit-node.js":"./circuit.js"},"unpkg":"circuit.min.js","dependencies":{"mime":"^2.4.4","ws":"~3.3.3"},"devDependencies":{"chai":"^4.1.2","express":"^4.16.2","globby":"^8.0.1","minimist":"^1.2.0","mocha":"^5.0.1","puppeteer":"^1.1.1","serve-static":"^1.13.2"},"readme":"Circuit JavaScript and Node.js SDK\n==================================\n\n[![NPM release](https://img.shields.io/npm/v/circuit-sdk/beta.svg)](https://www.npmjs.com/package/circuit-sdk)\n[![Build Status](https://travis-ci.org/circuit/circuit-sdk.svg?branch=beta)](https://travis-ci.org/circuit/circuit-sdk)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n\n### Prerequisites\n* Developer account on circuitsandbox.net. Get it for free at [developer registration](https://www.circuit.com/web/developers/registration).\n* OAuth 2.0 `client_id` and optionally `client_secret`. Get if for free at [circuit.github.com/oauth](https://circuit.github.com/oauth).\n\n\n### API Reference\nhttps://circuitsandbox.net/sdk/ with most APIs described in the [Client](https://circuitsandbox.net/sdk/classes/Client.html) class.\n\nMore info at [circuit.github.io](https://circuit.github.io/).\n\n### Usage\n\n#### JavaScript\nAdd the the line below to the HTML file of your app. This will include the latest version of Circuit SDK and make the `Circuit` object available.\n```html\n<script type=\"text/javascript\" src=\"https://unpkg.com/circuit-sdk@beta\"></script>\n```\n\nJS SDK can also be imported via CommonJS or AMD. View the repo [UMD](https://github.com/circuit/umd) for the different types of usage, or [circuit-ionic-start](https://github.com/circuit/circuit-ionic-starter) for example how import the SDK via `require` using webpack.\n\n#### Node.js\n```bash\nnpm install --save circuit-sdk@beta\n```\n\n### Application Types\nThe majority of apps fall in one of the three types below. Each type uses a different OAuth 2.0 Grant.\n\n1. **Client-side web applications** use the JavaScript SDK with the [OAuth 2.0 Implicit Grant](https://circuit.github.io/oauth.html#implicit).\n   ```javascript\n   // No client_secret needed for Implicit Grant. SDK will obtain access token.\n   let client = new Circuit.Client({\n     client_id: '<your client_id>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon()\n     .then(user => console.log('Logged on as ' + user.displayName))\n   ```\n\n2. **Server-side web applications** use the JavaScript SDK (or [REST API](https://circuitsandbox.net/rest/v2/swagger/ui/index.html)) on the client, but handle the authentication flow on the server using the [OAuth 2.0 Authorization Code Grant](https://circuit.github.io/oauth.html#authorization_code). The access token is obtained on the server and then passed to the client to use in the Circuit JavaScript SDK. These apps may also use the Node.js SDK on the server side to act on behalf of the user.<br>\nExample apps: [node-linkify](https://github.com/circuit/node-linkify) or [circuit-google-assistant](https://github.com/circuit/circuit-google-assistant)\n   ```javascript\n   // access token is obtained and managed by server-side app\n   let client = new Circuit.Client({\n     client_id: '<your client_id>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon({accessToken: '<access_token>'})\n     .then(user => console.log('Logged on as ' + user.displayName))\n   ```\n\n3. **Bots** use the [Node.js SDK](https://www.npmjs.com/package/circuit-sdk) or the [REST API](https://circuitsandbox.net/rest/v2/swagger/ui/index.html) and use the [OAuth 2.0 Client Credentials Grant](https://circuit.github.io/oauth.html#client_credentials). Bots are a special type of user; they don't login on behalf of a regular user, hence no OAuth popup asking for a user`s credentials and permissions.<br>\nExample bots: [xlator-bot](https://github.com/circuit/xlator-bot) or [node-sdk-example](https://github.com/circuit/node-sdk-example)<br>\nExample electron bots: [webrtc-bot-example](https://github.com/circuit/webrtc-bot-example) or [live-cam-bot](https://github.com/circuit/live-cam-bot)\n   ```javascript\n   const Circuit = require('circuit-sdk');\n   let client = new Circuit.Client({\n     client_id: '<client_id>',\n     client_secret: '<client_secret>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon()\n     .then(user => console.log('Logged on as bot: ' + user.emailAddress))\n   ```\n\n\n\n### Examples\n\n> JavaScript examples are located at [/examples/js](/examples/js) with more examples on [jsbin](https://circuit.github.io/jssdk.html#jsbin).\n\n> Node.js example apps are on [github](https://github.com/circuit). A summary is listed [here](https://circuit.github.io/nodejs.html). Runkit allows playing with Node.js modules live, similar to jsbin or jsfiddle on the client. [Try it on runkit](https://runkit.com/rogeru/circuit-sdk)\n\nHere are some snippets to get you started.\n\n#### Create Group Conversation and send text message\nLogon as bot, create a group conversation with two users and send a text message.\n```javascript\nclient.logon()\n  .then(user => console.log(`Logged on as ${user.displayName}`, user))\n  .then(() => client.getUsersByEmail(['kim.jackson@mailinator.com', 'maeva.barnaby@mailinator.com']))\n  .then(users => users.map(user => user.userId))\n  .then(userIds => client.createGroupConversation(userIds, 'runkit example'))\n  .then(conv => client.addTextItem(conv.convId, 'I am test bot. What can I do for you?'))\n  .then(client.logout)\n  .catch(console.error)\n```\n\n#### Get Conversations\nGet 10 newest conversations of logged on user.\n```javascript\nclient.getConversations({numberOfConversations: 10})\n  .then(conversations => console.log(`Retrieved ${conversations.length} conversations`))\n```\n\n#### Video call with another Circuit user\nStart a video call with another user. Create conversation if not yet existing.\n> Only applicable to JavaScript SDK and only on browsers supporting WebRTC\n```javascript\nclient.makeCall('bob@company.com', {audio: true, video: true}, true)\n  .then(call => console.log('New call: ', call));\n```\n\n#### Listen for events\n```javascript\n// Register new items added to the feed of this user. E.g. incoming text message\nclient.addEventListener('itemAdded', item =>\n  console.log('itemAdded event received:', item));\n\n// Register for connection state changes\nclient.addEventListener('connectionStateChanged', evt => {\n  console.log(`New state is ${evt.state}`);\n});\n\n// Register and log all events\nCircuit.supportedEvents.forEach(e => client.addEventListener(e, console.log));\n```\n\n#### Create an injector\nInjectors allow extending the conversation, item and user objects within the SDK.\nIn this example a new attribute `teaser` is created on the item object. This `teaser` will be added to item objects in any reponse or event from the SDK.\n```javascript\nCircuit.Injectors.itemInjector = function (item) {\n  if (item.type === Circuit.Enums.ConversationItemType.TEXT) {\n    // Create item.teaser attribute with replacing br and hr tags with a space\n    item.teaser = item.text.content.replace(/<(br[\\/]?|\\/li|hr[\\/]?)>/gi, ' ');\n  } else {\n    item.teaser = item.type;\n  }\n};\n```\n\n### Supported Browsers\nChrome and Firefox are officially supported.\n\n### Help us improve the SDK\nHelp us improve the SDK or examples by sending us a pull-request or opening a [GitHub Issue](https://github.com/circuit/circuit-sdk/issues/new).\n","readmeFilename":"README.md","gitHead":"32330fcdcabd184ff118247df6c33f969af3be0e","_id":"circuit-sdk@1.2.7202","_nodeVersion":"8.11.1","_npmVersion":"6.9.0","dist":{"integrity":"sha512-WBbJ+s4MsJu2GYah8MCu0gXUMSfyVgvwVFqp7zYWyDBrEp8gAh+8FuoQjuzs63hp48///ocPKGKCSU+KnwaewA==","shasum":"108bcc5bd1ee9da1665fcccd7bb2e9d6bb6dc450","tarball":"https://registry.npmjs.org/circuit-sdk/-/circuit-sdk-1.2.7202.tgz","fileCount":11,"unpackedSize":3880264,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdwDeKCRA9TVsSAnZWagAAGpIP+gORkqXdFmm9TNoTw3sk\nApo+FzjKvGBFJ1eVEgObujH5jKy8Zx0YNJ2hs0XBdqq6ByIKgR6QH+VQ7hLZ\nsMr5IfeE/fCBmSkiK29GnPARun1SDv9cXTukk2L5+iTDaY+s87PXINEnOQZi\n56mbewJSZhbCN4oSThs6ECZNrIC0QOjfNOjez1b/gBuVlC4PGDzvDO20RU6N\nlWETUQ9xq5N/zr8xD9UUvgv15FFLVpyoqbRd5xlo9zfFkoTakrWQvNM4zrDh\nxBWSJzxXBSDxBTe5Oo4oEuJVan89Ww2mB+JJtPaStp3braNJYSQeuyhWg2lc\nTRhl0hrQX15jcrVeW42GFscirykRlNiMabsiWuwU7PHT9Bkdq6jHYcPc3acZ\nBxBTf/pumx4AAB67LE/hOVnGWYtvbUPLlksXM+CeTopvJBvpKt3w4opnTK7t\nSR8Gl34pIArMFTQY/ocPSxrOLSX1lxZioYudJq24p/K0kgmkzYwJEwMgeA25\nM+k/vQ/j/qE+xcXgL8fnq39AnC6OkQoQ5KmA++fvy7Y49RI3RCi8lSpJQrG8\nLCaJQ5VTMhtCpQtzt8wJlBMNC1orE0azpMdhP6Rx5lAQtj56lsEeLFm24pKB\n3BprgxHS32lxMtnfETMvYIIGVNkhFEUQOhl2AgAfsToK2hOEhYblH2mjhaW3\nGGrR\r\n=kgon\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHgIVgaRF06rPXEiJWJ+eRRFah5mJ+1xpEKaKR8A6VBPAiEAzJgnAcgzXXP04Jh2tS/rXyiuGYoX2zsqPnnumyahlHU="}]},"maintainers":[{"name":"rogeru","email":"roger.urscheler@unify.com"},{"name":"rpastro","email":"rodrigo.pastro@unify.com"}],"_npmUser":{"name":"rogeru","email":"roger.urscheler@atos.net"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/circuit-sdk_1.2.7202_1572878218333_0.7661383900595007"},"_hasShrinkwrap":false},"1.2.7004":{"name":"circuit-sdk","version":"1.2.7004","description":"Circuit SDK","main":"circuit-node.js","scripts":{"test:browser":"node test/index","test:node":"mocha ./test/node/* --recursive --timeout=5000 --exit","test":"npm run test:node && npm run test:browser"},"author":{"name":"Unify Inc."},"contributors":[{"name":"Roger Urscheler","email":"roger.urscheler@atos.net"},{"name":"Rodrigo Pastro","email":"rodrigo.pastro@atos.net"},{"name":"Johannes Ruetschi","email":"johannes.ruetschi@atos.net"}],"license":"Apache-2.0","homepage":"https://github.com/circuit/circuit-sdk","engines":{"node":">= 4.5.0"},"repository":{"type":"git","url":"git://github.com/circuit/circuit-sdk.git"},"bugs":{"url":"http://github.com/circuit/circuit-sdk/issues"},"keywords":["api","webrtc","circuit","collaboration","sdk"],"browser":{"electron":false,"./circuit-node.js":"./circuit.js"},"unpkg":"circuit.min.js","dependencies":{"mime":"^2.4.4","ws":"~3.3.3"},"devDependencies":{"chai":"^4.1.2","express":"^4.16.2","globby":"^8.0.1","minimist":"^1.2.0","mocha":"^5.0.1","puppeteer":"^1.1.1","serve-static":"^1.13.2"},"gitHead":"7379db861b7d7872102b365f63a835bfa2580b91","_id":"circuit-sdk@1.2.7004","_nodeVersion":"8.11.1","_npmVersion":"6.9.0","dist":{"integrity":"sha512-J54IeoggjbCBEtrLP/0wnlSnihqZ53jQvy1mBdFnhs2IfCic+junKi8AIuALrGJvIEJWJHA6J8S7eC3odsHOnw==","shasum":"7bd7e1c7a6babf858a1b4310f443f7fdeea9104a","tarball":"https://registry.npmjs.org/circuit-sdk/-/circuit-sdk-1.2.7004.tgz","fileCount":12,"unpackedSize":3848777,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdwDfeCRA9TVsSAnZWagAA4iEP+QE+URwAO8L2BQ1zCJaB\nW0oH+jnsAyUTFDm50nBM3aYRgj9yeaampSpVs3iPG1ksx72k7V/ONmqSQGia\nqsszw7wfsGcNmjFQz/8EmoaPfsUj79eNuvB9jb8CK502QWeADZAoA8Jo0cBF\nCihckAwlaNoEPmovpHkhJPWozb0FywW1JaTeORFlGNwZ5sWXlIzf4rgXrqPn\nQ+gRIdcNNUBocFTtX9NFqlGj8tFOzzFNJ+S2aV6C3+fq/fZvB5iGZE2Z4DEo\nERNemeWN8XtocuAy8BnUqj/HpevLeVvbdbxII8kfFzG9DWHcU4sQ9vJMSlPV\nYIbltINA2yDLHiq2ABDdG8+qSOr2EeEhiTSA0xYfPqq5CFzuSO2hAtnFXYsi\nB26Kgt2qB0MBFmf9Di0+9lHCgG0HHLxu/nRoeuQkrg0zEHLaKm/+nNc/uAqD\nDPdlSNj4/8NUJElJktbnrdMCb7QTWOD7JqRLNhjHtd5WUJ9RF3mfa/UB4Skc\niJnbuB/719I6LAPChphi4ewL5Jb1GzqGmZsv/jzt81SmNEI7s6IwhWjSCb/C\nqzmON1Fjh5boyibpqHGf7zv2zIM1A1x/e/Y3dbuaDUi9lqoxuwk33CCwiy1Z\nagCHBxoMeuG/p/5wnwmRMxA0FqiSZK7NeemF2AhrB/+OnlcGHN8lkH/6k3mJ\nSdq3\r\n=g+o9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBvhcTBKESWXRluSXgvp5dwKFHMj0nNQhVL0gO+8QX/HAiEAsI56ux7NBGs9hW0zo/8xzQujqcLQ/ZPT5QQF4hcFmQw="}]},"maintainers":[{"name":"rogeru","email":"roger.urscheler@unify.com"},{"name":"rpastro","email":"rodrigo.pastro@unify.com"}],"_npmUser":{"name":"rogeru","email":"roger.urscheler@atos.net"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/circuit-sdk_1.2.7004_1572878301894_0.6407775007303671"},"_hasShrinkwrap":false},"1.2.7203":{"name":"circuit-sdk","version":"1.2.7203","description":"Circuit SDK","main":"circuit-node.js","scripts":{"test:browser":"node test/index","test:node":"mocha ./test/node/* --recursive --timeout=5000 --exit","test":"npm run test:node && npm run test:browser"},"author":{"name":"Unify Inc."},"contributors":[{"name":"Roger Urscheler","email":"roger.urscheler@atos.net"},{"name":"Rodrigo Pastro","email":"rodrigo.pastro@atos.net"},{"name":"Johannes Ruetschi","email":"johannes.ruetschi@atos.net"}],"license":"Apache-2.0","homepage":"https://github.com/circuit/circuit-sdk","engines":{"node":">= 4.5.0"},"repository":{"type":"git","url":"git://github.com/circuit/circuit-sdk.git"},"bugs":{"url":"http://github.com/circuit/circuit-sdk/issues"},"keywords":["api","webrtc","circuit","collaboration","sdk"],"browser":{"electron":false,"./circuit-node.js":"./circuit.js"},"unpkg":"circuit.min.js","dependencies":{"mime":"^2.4.4","ws":"~3.3.3"},"devDependencies":{"chai":"^4.1.2","express":"^4.16.2","globby":"^8.0.1","minimist":"^1.2.0","mocha":"^5.0.1","puppeteer":"^1.1.1","serve-static":"^1.13.2"},"readme":"Circuit JavaScript and Node.js SDK\n==================================\n\n[![NPM release](https://img.shields.io/npm/v/circuit-sdk/beta.svg)](https://www.npmjs.com/package/circuit-sdk)\n[![Build Status](https://travis-ci.org/circuit/circuit-sdk.svg?branch=beta)](https://travis-ci.org/circuit/circuit-sdk)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n\n### Prerequisites\n* Developer account on circuitsandbox.net. Get it for free at [developer registration](https://www.circuit.com/web/developers/registration).\n* OAuth 2.0 `client_id` and optionally `client_secret`. Get if for free at [circuit.github.com/oauth](https://circuit.github.com/oauth).\n\n\n### API Reference\nhttps://circuitsandbox.net/sdk/ with most APIs described in the [Client](https://circuitsandbox.net/sdk/classes/Client.html) class.\n\nMore info at [circuit.github.io](https://circuit.github.io/).\n\n### Usage\n\n#### JavaScript\nAdd the the line below to the HTML file of your app. This will include the latest version of Circuit SDK and make the `Circuit` object available.\n```html\n<script type=\"text/javascript\" src=\"https://unpkg.com/circuit-sdk@beta\"></script>\n```\n\nJS SDK can also be imported via CommonJS or AMD. View the repo [UMD](https://github.com/circuit/umd) for the different types of usage, or [circuit-ionic-start](https://github.com/circuit/circuit-ionic-starter) for example how import the SDK via `require` using webpack.\n\n#### Node.js\n```bash\nnpm install --save circuit-sdk@beta\n```\n\n### Application Types\nThe majority of apps fall in one of the three types below. Each type uses a different OAuth 2.0 Grant.\n\n1. **Client-side web applications** use the JavaScript SDK with the [OAuth 2.0 Implicit Grant](https://circuit.github.io/oauth.html#implicit).\n   ```javascript\n   // No client_secret needed for Implicit Grant. SDK will obtain access token.\n   let client = new Circuit.Client({\n     client_id: '<your client_id>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon()\n     .then(user => console.log('Logged on as ' + user.displayName))\n   ```\n\n2. **Server-side web applications** use the JavaScript SDK (or [REST API](https://circuitsandbox.net/rest/v2/swagger/ui/index.html)) on the client, but handle the authentication flow on the server using the [OAuth 2.0 Authorization Code Grant](https://circuit.github.io/oauth.html#authorization_code). The access token is obtained on the server and then passed to the client to use in the Circuit JavaScript SDK. These apps may also use the Node.js SDK on the server side to act on behalf of the user.<br>\nExample apps: [node-linkify](https://github.com/circuit/node-linkify) or [circuit-google-assistant](https://github.com/circuit/circuit-google-assistant)\n   ```javascript\n   // access token is obtained and managed by server-side app\n   let client = new Circuit.Client({\n     client_id: '<your client_id>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon({accessToken: '<access_token>'})\n     .then(user => console.log('Logged on as ' + user.displayName))\n   ```\n\n3. **Bots** use the [Node.js SDK](https://www.npmjs.com/package/circuit-sdk) or the [REST API](https://circuitsandbox.net/rest/v2/swagger/ui/index.html) and use the [OAuth 2.0 Client Credentials Grant](https://circuit.github.io/oauth.html#client_credentials). Bots are a special type of user; they don't login on behalf of a regular user, hence no OAuth popup asking for a user`s credentials and permissions.<br>\nExample bots: [xlator-bot](https://github.com/circuit/xlator-bot) or [node-sdk-example](https://github.com/circuit/node-sdk-example)<br>\nExample electron bots: [webrtc-bot-example](https://github.com/circuit/webrtc-bot-example) or [live-cam-bot](https://github.com/circuit/live-cam-bot)\n   ```javascript\n   const Circuit = require('circuit-sdk');\n   let client = new Circuit.Client({\n     client_id: '<client_id>',\n     client_secret: '<client_secret>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon()\n     .then(user => console.log('Logged on as bot: ' + user.emailAddress))\n   ```\n\n\n\n### Examples\n\n> JavaScript examples are located at [/examples/js](/examples/js) with more examples on [jsbin](https://circuit.github.io/jssdk.html#jsbin).\n\n> Node.js example apps are on [github](https://github.com/circuit). A summary is listed [here](https://circuit.github.io/nodejs.html). Runkit allows playing with Node.js modules live, similar to jsbin or jsfiddle on the client. [Try it on runkit](https://runkit.com/rogeru/circuit-sdk)\n\nHere are some snippets to get you started.\n\n#### Create Group Conversation and send text message\nLogon as bot, create a group conversation with two users and send a text message.\n```javascript\nclient.logon()\n  .then(user => console.log(`Logged on as ${user.displayName}`, user))\n  .then(() => client.getUsersByEmail(['kim.jackson@mailinator.com', 'maeva.barnaby@mailinator.com']))\n  .then(users => users.map(user => user.userId))\n  .then(userIds => client.createGroupConversation(userIds, 'runkit example'))\n  .then(conv => client.addTextItem(conv.convId, 'I am test bot. What can I do for you?'))\n  .then(client.logout)\n  .catch(console.error)\n```\n\n#### Get Conversations\nGet 10 newest conversations of logged on user.\n```javascript\nclient.getConversations({numberOfConversations: 10})\n  .then(conversations => console.log(`Retrieved ${conversations.length} conversations`))\n```\n\n#### Video call with another Circuit user\nStart a video call with another user. Create conversation if not yet existing.\n> Only applicable to JavaScript SDK and only on browsers supporting WebRTC\n```javascript\nclient.makeCall('bob@company.com', {audio: true, video: true}, true)\n  .then(call => console.log('New call: ', call));\n```\n\n#### Listen for events\n```javascript\n// Register new items added to the feed of this user. E.g. incoming text message\nclient.addEventListener('itemAdded', item =>\n  console.log('itemAdded event received:', item));\n\n// Register for connection state changes\nclient.addEventListener('connectionStateChanged', evt => {\n  console.log(`New state is ${evt.state}`);\n});\n\n// Register and log all events\nCircuit.supportedEvents.forEach(e => client.addEventListener(e, console.log));\n```\n\n#### Create an injector\nInjectors allow extending the conversation, item and user objects within the SDK.\nIn this example a new attribute `teaser` is created on the item object. This `teaser` will be added to item objects in any reponse or event from the SDK.\n```javascript\nCircuit.Injectors.itemInjector = function (item) {\n  if (item.type === Circuit.Enums.ConversationItemType.TEXT) {\n    // Create item.teaser attribute with replacing br and hr tags with a space\n    item.teaser = item.text.content.replace(/<(br[\\/]?|\\/li|hr[\\/]?)>/gi, ' ');\n  } else {\n    item.teaser = item.type;\n  }\n};\n```\n\n### Supported Browsers\nChrome and Firefox are officially supported.\n\n### Help us improve the SDK\nHelp us improve the SDK or examples by sending us a pull-request or opening a [GitHub Issue](https://github.com/circuit/circuit-sdk/issues/new).\n","readmeFilename":"README.md","gitHead":"bf58441c47e3976f7ca680aab7b9672fda34f9be","_id":"circuit-sdk@1.2.7203","_nodeVersion":"12.3.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-0EXvu9XbLKvlh6kwk4F6huELjHLtG5B/IhmJV/+p5iXiCPlEJGnKrWrD53+NxBbin6mUsGrpc1AaZaiyo1DJmg==","shasum":"578f2cdf6a41ed895a6607767b02d4b89eda4874","tarball":"https://registry.npmjs.org/circuit-sdk/-/circuit-sdk-1.2.7203.tgz","fileCount":11,"unpackedSize":3880149,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdzEiwCRA9TVsSAnZWagAAs8oP/jkJhtwj6cgBhDrbWcbU\nTzl/X0mlivW7lPaoi1OHd+kfQOKgXsnp5WVUpEhfzA5LIH/Gu++ZKNKfJTZN\n701XORBo8d3shECSf3X6Pen4opZV0/PCMepk7PA8NUYVeQYCVcL2j5AI83jR\n51cjqzeRoALlY3G5tu7DFBa6WnuVBAXpE9DKN/x9VascfgvJq8CksJ//w+25\ncisNhMhUd+N7msAUdtx4LmMRNLFID7OB28F6psO4ntWQLZCCkAKcWQ2/Vv5f\nSLJFNJOqCMaLBoSCDs4+Gh33OA0SH/Hx19edbe4jBg5uj5OVI1xdPuZ8GnVa\ngWorLkuNHKaRCOtz8JyNwpi4dMrTMBp0B8vUkBL1QIlkAfppmFVQFIK5L6Pp\nND883mZbttADW89GUUM22cFrStAuQRYsA8gRu1qxmc5+vbCd+LbSwBOwLORt\nEtOMWyWMdq7qFLt6vf0Hc75pKzXpdJGT9/+0PByuo3vw2TKIiCb/uIk/ArTa\naH02TpqB1cA7FeE7VmTGWIW1C1l0IKc1Z7fXYp/jm7bvvTT0n/m9ZmkK0Ihx\nLFL3kZ9LXr4WJQWmDsVNsg+JV6tVjXIxwCEy0Ocr4DKsHzYcZQG7/9lNxIHX\niWKYxkjV1OCyiYdWSiJwxr+wPAk6e91iWQ4aa/MVQmjtd3ZHzRVBvw9L3iE9\nIrvg\r\n=I9Ke\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC6eVAi03ZsBdERKvogggTt/+BXyy/rMyGg07W3+Dwn6QIgIvE1Wt7CYxsVJLcDC5ueZ+MWuO+kq1qCH0xvC8jL2Ws="}]},"maintainers":[{"name":"rogeru","email":"roger.urscheler@unify.com"},{"name":"rpastro","email":"rodrigo.pastro@unify.com"}],"_npmUser":{"name":"rogeru","email":"roger.urscheler@atos.net"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/circuit-sdk_1.2.7203_1573669039339_0.3036185914605054"},"_hasShrinkwrap":false},"1.2.7005":{"name":"circuit-sdk","version":"1.2.7005","description":"Circuit SDK","main":"circuit-node.js","scripts":{"test:browser":"node test/index","test:node":"mocha ./test/node/* --recursive --timeout=5000 --exit","test":"npm run test:node && npm run test:browser"},"author":{"name":"Unify Inc."},"contributors":[{"name":"Roger Urscheler","email":"roger.urscheler@atos.net"},{"name":"Rodrigo Pastro","email":"rodrigo.pastro@atos.net"},{"name":"Johannes Ruetschi","email":"johannes.ruetschi@atos.net"}],"license":"Apache-2.0","homepage":"https://github.com/circuit/circuit-sdk","engines":{"node":">= 4.5.0"},"repository":{"type":"git","url":"git://github.com/circuit/circuit-sdk.git"},"bugs":{"url":"http://github.com/circuit/circuit-sdk/issues"},"keywords":["api","webrtc","circuit","collaboration","sdk"],"browser":{"electron":false,"./circuit-node.js":"./circuit.js"},"unpkg":"circuit.min.js","dependencies":{"mime":"^2.4.4","ws":"~3.3.3"},"devDependencies":{"chai":"^4.1.2","express":"^4.16.2","globby":"^8.0.1","minimist":"^1.2.0","mocha":"^5.0.1","puppeteer":"^1.1.1","serve-static":"^1.13.2"},"gitHead":"f2ba0b60a83fa8bec431a1b60c695e7c504f29f1","_id":"circuit-sdk@1.2.7005","_nodeVersion":"12.3.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-txUa4gI66V8fk5qrqyEgLdLK7GAyrfTgidrSGcA3fLr7qssjbWbLGsdkR0pnysJqo2pXtUkkD4vNHIKU2vlUtw==","shasum":"54ac1d87a7b1fb539fc7b02d2212599506391ff1","tarball":"https://registry.npmjs.org/circuit-sdk/-/circuit-sdk-1.2.7005.tgz","fileCount":12,"unpackedSize":3848777,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdzErDCRA9TVsSAnZWagAA/kwP/A05jkXNh+B/OBv9Nr9H\naadPrYuePw7eoAjOA6M4tUOIcDjAndVRQnEPUX0eI628wwn+szBTCY6c8C2G\nk5Hu3j2kruxZhpzf5XoR/uGbJ7LyuJAHQORbnP/2zIW2kjwJiB+UuR7g61nT\nJYn7E3ccLHYt2pChg4z9N++lvwIVZpcI6kaVUaiS3hwqUiJeA0nX52sMa4qb\nJ1oYCvBMe0Axsdab8Zqf+HqcOKyXkqXvLl575aK6zMgtarzHFlARo9Ufv/0v\nAQgx3gOSsreXYwT/qrKHiPL1ZQbxxJuwvP2oPuQMZIH883gIlQbKf04yeYHa\nUSgUnDpx1q6emE8eo5zdp3JFByCFPBgusnwbhvS11E+VQ4ZtNqSCy2Vcbh8j\nwKfaEcS6nHUbka4yjbj4I8LCs60ewFlo2t6YgvTQZgOdH3ulnnWG3MMAV5B0\njKJR4ocxypr9S8h0SIK761M3r8+kduof+5SiGmttXynt8kPXykAEyWFEaptE\nFlEuuRMPKilt7YHekpBMCZTJT4zDPeNF52zndV/vqDrmlJ7T+hwur+VvFSv0\nCNoEgc1vppKW84Y6bTr2HWg6/VT4oRpSkw3dA7iVHfNYazpurIZIW4kySS2f\nqIBib0gJDuEFmozdWS1NSJx+4QeAqdsYAZA3D+e631HV5OS1fNNJyeZhkCBJ\nmVXM\r\n=9t0H\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDpr0QGbqzXjzN2HAkNZmmQmdb+kXjyZwQqsF3Bu16mWAIhAK7JRtHgJ3exBDZ+Gt/OwYdlGkRf0zD/goxOvQlPp7s8"}]},"maintainers":[{"name":"rogeru","email":"roger.urscheler@unify.com"},{"name":"rpastro","email":"rodrigo.pastro@unify.com"}],"_npmUser":{"name":"rogeru","email":"roger.urscheler@atos.net"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/circuit-sdk_1.2.7005_1573669571000_0.7410444842843098"},"_hasShrinkwrap":false},"1.2.7403":{"name":"circuit-sdk","version":"1.2.7403","description":"Circuit SDK","main":"circuit-node.js","scripts":{"test:browser":"node test/index","test:node":"mocha ./test/node/* --recursive --timeout=5000 --exit","test":"npm run test:node && npm run test:browser"},"author":{"name":"Unify Inc."},"contributors":[{"name":"Roger Urscheler","email":"roger.urscheler@atos.net"},{"name":"Rodrigo Pastro","email":"rodrigo.pastro@atos.net"},{"name":"Johannes Ruetschi","email":"johannes.ruetschi@atos.net"}],"license":"Apache-2.0","homepage":"https://github.com/circuit/circuit-sdk","engines":{"node":">= 4.5.0"},"repository":{"type":"git","url":"git://github.com/circuit/circuit-sdk.git"},"bugs":{"url":"http://github.com/circuit/circuit-sdk/issues"},"keywords":["api","webrtc","circuit","collaboration","sdk"],"browser":{"electron":false,"./circuit-node.js":"./circuit.js"},"unpkg":"circuit.min.js","dependencies":{"mime":"^2.4.4","ws":"~3.3.3"},"devDependencies":{"chai":"^4.1.2","express":"^4.16.2","globby":"^8.0.1","minimist":"^1.2.0","mocha":"^5.0.1","puppeteer":"^1.1.1","serve-static":"^1.13.2"},"readme":"Circuit JavaScript and Node.js SDK\n==================================\n\n[![NPM release](https://img.shields.io/npm/v/circuit-sdk/beta.svg)](https://www.npmjs.com/package/circuit-sdk)\n[![Build Status](https://travis-ci.org/circuit/circuit-sdk.svg?branch=beta)](https://travis-ci.org/circuit/circuit-sdk)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n\n### Prerequisites\n* Developer account on circuitsandbox.net. Get it for free at [developer registration](https://www.circuit.com/web/developers/registration).\n* OAuth 2.0 `client_id` and optionally `client_secret`. Get if for free at [circuit.github.com/oauth](https://circuit.github.com/oauth).\n\n\n### API Reference\nhttps://circuitsandbox.net/sdk/ with most APIs described in the [Client](https://circuitsandbox.net/sdk/classes/Client.html) class.\n\nMore info at [circuit.github.io](https://circuit.github.io/).\n\n### Usage\n\n#### JavaScript\nAdd the the line below to the HTML file of your app. This will include the latest version of Circuit SDK and make the `Circuit` object available.\n```html\n<script type=\"text/javascript\" src=\"https://unpkg.com/circuit-sdk@beta\"></script>\n```\n\nJS SDK can also be imported via CommonJS or AMD. View the repo [UMD](https://github.com/circuit/umd) for the different types of usage, or [circuit-ionic-start](https://github.com/circuit/circuit-ionic-starter) for example how import the SDK via `require` using webpack.\n\n#### Node.js\n```bash\nnpm install --save circuit-sdk@beta\n```\n\n### Application Types\nThe majority of apps fall in one of the three types below. Each type uses a different OAuth 2.0 Grant.\n\n1. **Client-side web applications** use the JavaScript SDK with the [OAuth 2.0 Implicit Grant](https://circuit.github.io/oauth.html#implicit).\n   ```javascript\n   // No client_secret needed for Implicit Grant. SDK will obtain access token.\n   let client = new Circuit.Client({\n     client_id: '<your client_id>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon()\n     .then(user => console.log('Logged on as ' + user.displayName))\n   ```\n\n2. **Server-side web applications** use the JavaScript SDK (or [REST API](https://circuitsandbox.net/rest/v2/swagger/ui/index.html)) on the client, but handle the authentication flow on the server using the [OAuth 2.0 Authorization Code Grant](https://circuit.github.io/oauth.html#authorization_code). The access token is obtained on the server and then passed to the client to use in the Circuit JavaScript SDK. These apps may also use the Node.js SDK on the server side to act on behalf of the user.<br>\nExample apps: [node-linkify](https://github.com/circuit/node-linkify) or [circuit-google-assistant](https://github.com/circuit/circuit-google-assistant)\n   ```javascript\n   // access token is obtained and managed by server-side app\n   let client = new Circuit.Client({\n     client_id: '<your client_id>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon({accessToken: '<access_token>'})\n     .then(user => console.log('Logged on as ' + user.displayName))\n   ```\n\n3. **Bots** use the [Node.js SDK](https://www.npmjs.com/package/circuit-sdk) or the [REST API](https://circuitsandbox.net/rest/v2/swagger/ui/index.html) and use the [OAuth 2.0 Client Credentials Grant](https://circuit.github.io/oauth.html#client_credentials). Bots are a special type of user; they don't login on behalf of a regular user, hence no OAuth popup asking for a user`s credentials and permissions.<br>\nExample bots: [xlator-bot](https://github.com/circuit/xlator-bot) or [node-sdk-example](https://github.com/circuit/node-sdk-example)<br>\nExample electron bots: [webrtc-bot-example](https://github.com/circuit/webrtc-bot-example) or [live-cam-bot](https://github.com/circuit/live-cam-bot)\n   ```javascript\n   const Circuit = require('circuit-sdk');\n   let client = new Circuit.Client({\n     client_id: '<client_id>',\n     client_secret: '<client_secret>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon()\n     .then(user => console.log('Logged on as bot: ' + user.emailAddress))\n   ```\n\n\n\n### Examples\n\n> JavaScript examples are located at [/examples/js](/examples/js) with more examples on [jsbin](https://circuit.github.io/jssdk.html#jsbin).\n\n> Node.js example apps are on [github](https://github.com/circuit). A summary is listed [here](https://circuit.github.io/nodejs.html). Runkit allows playing with Node.js modules live, similar to jsbin or jsfiddle on the client. [Try it on runkit](https://runkit.com/rogeru/circuit-sdk)\n\nHere are some snippets to get you started.\n\n#### Create Group Conversation and send text message\nLogon as bot, create a group conversation with two users and send a text message.\n```javascript\nclient.logon()\n  .then(user => console.log(`Logged on as ${user.displayName}`, user))\n  .then(() => client.getUsersByEmail(['kim.jackson@mailinator.com', 'maeva.barnaby@mailinator.com']))\n  .then(users => users.map(user => user.userId))\n  .then(userIds => client.createGroupConversation(userIds, 'runkit example'))\n  .then(conv => client.addTextItem(conv.convId, 'I am test bot. What can I do for you?'))\n  .then(client.logout)\n  .catch(console.error)\n```\n\n#### Get Conversations\nGet 10 newest conversations of logged on user.\n```javascript\nclient.getConversations({numberOfConversations: 10})\n  .then(conversations => console.log(`Retrieved ${conversations.length} conversations`))\n```\n\n#### Video call with another Circuit user\nStart a video call with another user. Create conversation if not yet existing.\n> Only applicable to JavaScript SDK and only on browsers supporting WebRTC\n```javascript\nclient.makeCall('bob@company.com', {audio: true, video: true}, true)\n  .then(call => console.log('New call: ', call));\n```\n\n#### Listen for events\n```javascript\n// Register new items added to the feed of this user. E.g. incoming text message\nclient.addEventListener('itemAdded', item =>\n  console.log('itemAdded event received:', item));\n\n// Register for connection state changes\nclient.addEventListener('connectionStateChanged', evt => {\n  console.log(`New state is ${evt.state}`);\n});\n\n// Register and log all events\nCircuit.supportedEvents.forEach(e => client.addEventListener(e, console.log));\n```\n\n#### Create an injector\nInjectors allow extending the conversation, item and user objects within the SDK.\nIn this example a new attribute `teaser` is created on the item object. This `teaser` will be added to item objects in any reponse or event from the SDK.\n```javascript\nCircuit.Injectors.itemInjector = function (item) {\n  if (item.type === Circuit.Enums.ConversationItemType.TEXT) {\n    // Create item.teaser attribute with replacing br and hr tags with a space\n    item.teaser = item.text.content.replace(/<(br[\\/]?|\\/li|hr[\\/]?)>/gi, ' ');\n  } else {\n    item.teaser = item.type;\n  }\n};\n```\n\n### Supported Browsers\nChrome and Firefox are officially supported.\n\n### Help us improve the SDK\nHelp us improve the SDK or examples by sending us a pull-request or opening a [GitHub Issue](https://github.com/circuit/circuit-sdk/issues/new).\n","readmeFilename":"README.md","gitHead":"574c5d8460f4f1391b63f7e631728ad974b0401e","_id":"circuit-sdk@1.2.7403","_nodeVersion":"12.13.1","_npmVersion":"6.12.1","dist":{"integrity":"sha512-Qs4sUR3IT2fIxlItvZh22q807Gz5D5uBUQAk+Fm5sP4Z3COVGm6Q1/VxnUoeW+/FJ649UOPq75JVVdCG8dkzRg==","shasum":"c01d3ae9543781a8e0a4afffec7b01a996ad7792","tarball":"https://registry.npmjs.org/circuit-sdk/-/circuit-sdk-1.2.7403.tgz","fileCount":11,"unpackedSize":3936667,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd88xNCRA9TVsSAnZWagAA0E4P/0VESHZHK/p4yPiiP+Xu\n1sCFqLMVx2ugXsB1/FPPXfAQH4zhE/nAzksoHUh52rFlqLY8ngwrzU86RV4h\n254OKIupl9Dw+pCAK9Zs+28T5ceYn44uBM/ty0UwHK275zdGScG1MhT/PeyR\nYJti9l2AxDKkHCsW1OyuRJ9TryTLaVExX4qOcDZm0+f+aJ2MBvjVmmP0Z27E\n2q5iZHhUCDHME8xcQCtlssWiN7CT3DFcyronr+P5vghPSxWpwI2Ms2xIs1F1\nyvOx+su7pzON27zXeALBbNonz+3wkQI6GDwwGAGLnb9jOSNPhy+dnbgAOA+a\n9AV5uPBNyH7I6ghKVZCBYJQZSKgdzitfLO2jbaMdvtNPP3/VAZeVPG1T+Eou\nxcAtw1U8qPEBRUcOH7whCeVYEOBr1qdgzxu8hL3fGOClvEhjjy0OZoJtyOHr\n+hQwBRBGOus0NPq/JXe0aQUjLtXEZBME7wWqMHqTuwrLzsbfTO3PBw43dvES\nKtiBauBIFcF9hcQJJhgEJuybeWbm9OfQpAuEmCHOmmr42nK0uP9H/0NxYWcN\nzUP7KkFIGmO+3fBMLvFqzqElgzRdzzV0S5R/hEgLs1nm7zc5RR3z1dbKn9ev\nvlRqnDiukY0mSnKP20Zp6UrCsGxYO+VZDcScHTBdZpuosGU/KAhI2iz1V3ET\nFPrW\r\n=kHWK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDSN7t706Jo7L1T7STV5OiGT8j/Ey7ngmpg3aJBB+LqXAiBylbFFddQe6mg2bdVe8XhCKAX5rDTKCWHKoReuz4jAxQ=="}]},"maintainers":[{"name":"rogeru","email":"roger.urscheler@unify.com"},{"name":"rpastro","email":"rodrigo.pastro@unify.com"}],"_npmUser":{"name":"rogeru","email":"roger.urscheler@atos.net"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/circuit-sdk_1.2.7403_1576258637079_0.04579884921103283"},"_hasShrinkwrap":false},"1.2.7402":{"name":"circuit-sdk","version":"1.2.7402","description":"Circuit SDK","main":"circuit-node.js","scripts":{"test:browser":"node test/index","test:node":"mocha ./test/node/* --recursive --timeout=5000 --exit","test":"npm run test:node && npm run test:browser"},"author":{"name":"Unify Inc."},"contributors":[{"name":"Roger Urscheler","email":"roger.urscheler@atos.net"},{"name":"Rodrigo Pastro","email":"rodrigo.pastro@atos.net"},{"name":"Johannes Ruetschi","email":"johannes.ruetschi@atos.net"}],"license":"Apache-2.0","homepage":"https://github.com/circuit/circuit-sdk","engines":{"node":">= 4.5.0"},"repository":{"type":"git","url":"git://github.com/circuit/circuit-sdk.git"},"bugs":{"url":"http://github.com/circuit/circuit-sdk/issues"},"keywords":["api","webrtc","circuit","collaboration","sdk"],"browser":{"electron":false,"./circuit-node.js":"./circuit.js"},"unpkg":"circuit.min.js","dependencies":{"mime":"^2.4.4","ws":"~3.3.3"},"devDependencies":{"chai":"^4.1.2","express":"^4.16.2","globby":"^8.0.1","minimist":"^1.2.0","mocha":"^5.0.1","puppeteer":"^1.1.1","serve-static":"^1.13.2"},"gitHead":"4633a46d948dedcffa421e0ad090bacc94df0443","_id":"circuit-sdk@1.2.7402","_nodeVersion":"12.13.1","_npmVersion":"6.12.1","dist":{"integrity":"sha512-rkOUtndoO18oSI3zbJE+SWJUxcB8egCsGbChLYc6LXTsgrRBMpX1nLQ5WN1xT//QA/1sGGDnA8bA696yIUFT2Q==","shasum":"cf964ca35bf9b7add2ea924a421ce621b671c06b","tarball":"https://registry.npmjs.org/circuit-sdk/-/circuit-sdk-1.2.7402.tgz","fileCount":12,"unpackedSize":3954144,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd8857CRA9TVsSAnZWagAAlIcP/iCbIEc1QG0ic39OGlEg\nw6RpULMK0qQF4pEBKH6RR1pF0uiqUbosv9mYpy+20dRI5iyK1N6ju6Z1CEpG\nbcVctqaUWncHuDU4aiBy8N+aSjMdSDNlRAKGe4z2YbBA7CJo6/u/NFVcr2b2\no+VO3WUhGhprtzTN2V7xwmGGTFgdpzsqQF5qN52mGtN/KVZPuJzt6LZgHq1c\ny9iP6bnYrJsoKsYonFxjTpMvsWehCUEBHQk7+I/014XSo262GNxBjSorD1xQ\nMBh/x2dTmOyggaJB5PTtQbd00aog3TH/4+2To/5Kykah2tGs0zG7q60Wf0mv\n1OMr6cBfNdLdy83hTRXRu5B6dyafUR/wSSNwEoQkOuvNjIQPM/l3LD5t6USx\nvue/mAGjdHc9OWFDGm1bKWOxPrz76L2EVvGb20kD+7TDm7LS5szss2yLXuen\n4NIWhKOqi4bsxZjTvXJsl0HIMvhP1RipkS0gWUW5UpqIeWoRERN2EYvQLu9z\nhN5Ef/a5sxzY2uiF1Wc093/DVWCKpuwbUTWdk/Jbr5z/SrwfrBOHnkCSJkTk\n4L0TC8FdvFIXB4LELAKcPnrlNjhYTSLZ1XBljlQJccWCbJRqu8E8lmzicvMv\nVLPMp7n9npJWdEmBpfz3ZtK6mLYT/z5u5MPQ6vRe0DA6y2yytGlTOyDSoPSx\nd7Mg\r\n=whXh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCKSUNhV+zvdt0tToqSmab3jPp6kr/zAOTqjl405L0hlAIgVrrjlK8fcLNaoehu78xsHUWL/dWEXGMNMu6wWbb+ZrA="}]},"maintainers":[{"name":"rogeru","email":"roger.urscheler@unify.com"},{"name":"rpastro","email":"rodrigo.pastro@unify.com"}],"_npmUser":{"name":"rogeru","email":"roger.urscheler@atos.net"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/circuit-sdk_1.2.7402_1576259195219_0.48462901162406946"},"_hasShrinkwrap":false},"1.2.7604":{"name":"circuit-sdk","version":"1.2.7604","description":"Circuit SDK","main":"circuit-node.js","scripts":{"test:browser":"node test/index","test:node":"mocha ./test/node/* --recursive --timeout=5000 --exit","test":"npm run test:node && npm run test:browser"},"author":{"name":"Unify Inc."},"contributors":[{"name":"Roger Urscheler","email":"roger.urscheler@atos.net"},{"name":"Rodrigo Pastro","email":"rodrigo.pastro@atos.net"},{"name":"Johannes Ruetschi","email":"johannes.ruetschi@atos.net"}],"license":"Apache-2.0","homepage":"https://github.com/circuit/circuit-sdk","engines":{"node":">= 4.5.0"},"repository":{"type":"git","url":"git://github.com/circuit/circuit-sdk.git"},"bugs":{"url":"http://github.com/circuit/circuit-sdk/issues"},"keywords":["api","webrtc","circuit","collaboration","sdk"],"browser":{"electron":false,"./circuit-node.js":"./circuit.js"},"unpkg":"circuit.min.js","dependencies":{"mime":"^2.4.4","ws":"~3.3.3"},"devDependencies":{"chai":"^4.1.2","express":"^4.16.2","globby":"^8.0.1","minimist":"^1.2.0","mocha":"^5.0.1","puppeteer":"^1.1.1","serve-static":"^1.13.2"},"gitHead":"3078de951ec2f9618a01246bf41e219fe7b0dcd3","_id":"circuit-sdk@1.2.7604","_nodeVersion":"12.13.1","_npmVersion":"6.13.6","dist":{"integrity":"sha512-mZEawXETHYpnypqtUTwveMvE7c8ay5Xkdv6TSR+bGCI7Yy6fIFhOoFFvGqHwtwDKgbm45tfo5rKTvy0z9xvJrw==","shasum":"890bc3492ded372e99a9a932d3cd5b57deb161dd","tarball":"https://registry.npmjs.org/circuit-sdk/-/circuit-sdk-1.2.7604.tgz","fileCount":11,"unpackedSize":3970255,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeGKmeCRA9TVsSAnZWagAAvpUP/2ZBdLcKQMsYZw8GdHyH\nn82T/bL9Rc6EEegwKlio84/mkGRDLR5YAF77l253TVKTdtBy5fKxfQsjyFA6\ndBm1qX6wsoRaWPaYbwHEtJ6r24tcwzU9OliyFxuKNlt1slJ04S3Bsjz1yioZ\nlZgZg0BaNP1MoT8tlc+ZGutbo1/w2TKOj5IAPNaNes51c7xvKjmLhviZqdmu\nIbrgu5zYo3mhWLMpMqNA4WPlr/AFqPfxKUIfOiE2VYD034u9Ovi6pqQBs4xm\n6WLKmwVCcsWbHaf4w9q7VzCjmwoSOlKep9m1NR1Y/uXbgPYs/N6oty2U05gS\n2/K0ImwEqJbezDe/QrGRQnqlxRNnQMT/zRtE+rMpkwv6ImC4NmRtRz4KttWc\nnthyWnKSrZvJR0hkj9TM/jfqS1wfH24jwdagd8NpzALDLkBq9w+LTKbdXzMB\nX3dQRGq5hHRGRSy8/whM4s4vDspDopOZtfxoxNzoHtvR8lJRCihd9OBMY/0u\nLBD9smWp9lq8MmfC3n1WqVHZFzyhRJ+D9wXARlTqNGiPm+qEbdxrA/0tADSw\npuuNgtEZKJLSJVHsfJDHJqW9Dtxc+uSnycwPSUTOQVwztJZJqlSN8lIyqmvz\nEGk3fNdgJJ0yqfj1RJvjw7PH57g8yN9dzSEdlJlVtr8erQ9G1Mg/vDOtj95X\ngvSu\r\n=Ksvv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDb+sWzl93pGsRBATuf3WEqt1RTZWuNbebHw9mnbwsWuQIhAOdlSL3GWntjBT7hmkTBYB74mNKtvinsLUtAKeUxBSk6"}]},"maintainers":[{"name":"rogeru","email":"roger.urscheler@unify.com"},{"name":"rpastro","email":"rodrigo.pastro@unify.com"}],"_npmUser":{"name":"rogeru","email":"roger.urscheler@atos.net"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/circuit-sdk_1.2.7604_1578674589404_0.11351707284074175"},"_hasShrinkwrap":false},"1.2.7801":{"name":"circuit-sdk","version":"1.2.7801","description":"Circuit SDK","main":"circuit-node.js","scripts":{"test:browser":"node test/index","test:node":"mocha ./test/node/* --recursive --timeout=5000 --exit","test":"npm run test:node && npm run test:browser"},"author":{"name":"Unify Inc."},"contributors":[{"name":"Roger Urscheler","email":"roger.urscheler@atos.net"},{"name":"Rodrigo Pastro","email":"rodrigo.pastro@atos.net"},{"name":"Johannes Ruetschi","email":"johannes.ruetschi@atos.net"}],"license":"Apache-2.0","homepage":"https://github.com/circuit/circuit-sdk","engines":{"node":">= 4.5.0"},"repository":{"type":"git","url":"git://github.com/circuit/circuit-sdk.git"},"bugs":{"url":"http://github.com/circuit/circuit-sdk/issues"},"keywords":["api","webrtc","circuit","collaboration","sdk"],"browser":{"electron":false,"./circuit-node.js":"./circuit.js"},"unpkg":"circuit.min.js","dependencies":{"mime":"^2.4.4","ws":"~3.3.3"},"devDependencies":{"chai":"^4.1.2","express":"^4.16.2","globby":"^8.0.1","minimist":"^1.2.0","mocha":"^5.0.1","puppeteer":"^1.1.1","serve-static":"^1.13.2"},"readme":"Circuit JavaScript and Node.js SDK\n==================================\n\n[![NPM release](https://img.shields.io/npm/v/circuit-sdk/beta.svg)](https://www.npmjs.com/package/circuit-sdk)\n[![Build Status](https://travis-ci.org/circuit/circuit-sdk.svg?branch=beta)](https://travis-ci.org/circuit/circuit-sdk)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n\n### Prerequisites\n* Developer account on circuitsandbox.net. Get it for free at [developer registration](https://www.circuit.com/web/developers/registration).\n* OAuth 2.0 `client_id` and optionally `client_secret`. Get if for free at [circuit.github.com/oauth](https://circuit.github.com/oauth).\n\n\n### API Reference\nhttps://circuitsandbox.net/sdk/ with most APIs described in the [Client](https://circuitsandbox.net/sdk/classes/Client.html) class.\n\nMore info at [circuit.github.io](https://circuit.github.io/).\n\n### Usage\n\n#### JavaScript\nAdd the the line below to the HTML file of your app. This will include the latest version of Circuit SDK and make the `Circuit` object available.\n```html\n<script type=\"text/javascript\" src=\"https://unpkg.com/circuit-sdk@beta\"></script>\n```\n\nJS SDK can also be imported via CommonJS or AMD. View the repo [UMD](https://github.com/circuit/umd) for the different types of usage, or [circuit-ionic-start](https://github.com/circuit/circuit-ionic-starter) for example how import the SDK via `require` using webpack.\n\n#### Node.js\n```bash\nnpm install --save circuit-sdk@beta\n```\n\n### Application Types\nThe majority of apps fall in one of the three types below. Each type uses a different OAuth 2.0 Grant.\n\n1. **Client-side web applications** use the JavaScript SDK with the [OAuth 2.0 Implicit Grant](https://circuit.github.io/oauth.html#implicit).\n   ```javascript\n   // No client_secret needed for Implicit Grant. SDK will obtain access token.\n   let client = new Circuit.Client({\n     client_id: '<your client_id>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon()\n     .then(user => console.log('Logged on as ' + user.displayName))\n   ```\n\n2. **Server-side web applications** use the JavaScript SDK (or [REST API](https://circuitsandbox.net/rest/v2/swagger/ui/index.html)) on the client, but handle the authentication flow on the server using the [OAuth 2.0 Authorization Code Grant](https://circuit.github.io/oauth.html#authorization_code). The access token is obtained on the server and then passed to the client to use in the Circuit JavaScript SDK. These apps may also use the Node.js SDK on the server side to act on behalf of the user.<br>\nExample apps: [node-linkify](https://github.com/circuit/node-linkify) or [circuit-google-assistant](https://github.com/circuit/circuit-google-assistant)\n   ```javascript\n   // access token is obtained and managed by server-side app\n   let client = new Circuit.Client({\n     client_id: '<your client_id>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon({accessToken: '<access_token>'})\n     .then(user => console.log('Logged on as ' + user.displayName))\n   ```\n\n3. **Bots** use the [Node.js SDK](https://www.npmjs.com/package/circuit-sdk) or the [REST API](https://circuitsandbox.net/rest/v2/swagger/ui/index.html) and use the [OAuth 2.0 Client Credentials Grant](https://circuit.github.io/oauth.html#client_credentials). Bots are a special type of user; they don't login on behalf of a regular user, hence no OAuth popup asking for a user`s credentials and permissions.<br>\nExample bots: [xlator-bot](https://github.com/circuit/xlator-bot) or [node-sdk-example](https://github.com/circuit/node-sdk-example)<br>\nExample electron bots: [webrtc-bot-example](https://github.com/circuit/webrtc-bot-example) or [live-cam-bot](https://github.com/circuit/live-cam-bot)\n   ```javascript\n   const Circuit = require('circuit-sdk');\n   let client = new Circuit.Client({\n     client_id: '<client_id>',\n     client_secret: '<client_secret>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon()\n     .then(user => console.log('Logged on as bot: ' + user.emailAddress))\n   ```\n\n\n\n### Examples\n\n> JavaScript examples are located at [/examples/js](/examples/js) with more examples on [jsbin](https://circuit.github.io/jssdk.html#jsbin).\n\n> Node.js example apps are on [github](https://github.com/circuit). A summary is listed [here](https://circuit.github.io/nodejs.html). Runkit allows playing with Node.js modules live, similar to jsbin or jsfiddle on the client. [Try it on runkit](https://runkit.com/rogeru/circuit-sdk)\n\nHere are some snippets to get you started.\n\n#### Create Group Conversation and send text message\nLogon as bot, create a group conversation with two users and send a text message.\n```javascript\nclient.logon()\n  .then(user => console.log(`Logged on as ${user.displayName}`, user))\n  .then(() => client.getUsersByEmail(['kim.jackson@mailinator.com', 'maeva.barnaby@mailinator.com']))\n  .then(users => users.map(user => user.userId))\n  .then(userIds => client.createGroupConversation(userIds, 'runkit example'))\n  .then(conv => client.addTextItem(conv.convId, 'I am test bot. What can I do for you?'))\n  .then(client.logout)\n  .catch(console.error)\n```\n\n#### Get Conversations\nGet 10 newest conversations of logged on user.\n```javascript\nclient.getConversations({numberOfConversations: 10})\n  .then(conversations => console.log(`Retrieved ${conversations.length} conversations`))\n```\n\n#### Video call with another Circuit user\nStart a video call with another user. Create conversation if not yet existing.\n> Only applicable to JavaScript SDK and only on browsers supporting WebRTC\n```javascript\nclient.makeCall('bob@company.com', {audio: true, video: true}, true)\n  .then(call => console.log('New call: ', call));\n```\n\n#### Listen for events\n```javascript\n// Register new items added to the feed of this user. E.g. incoming text message\nclient.addEventListener('itemAdded', item =>\n  console.log('itemAdded event received:', item));\n\n// Register for connection state changes\nclient.addEventListener('connectionStateChanged', evt => {\n  console.log(`New state is ${evt.state}`);\n});\n\n// Register and log all events\nCircuit.supportedEvents.forEach(e => client.addEventListener(e, console.log));\n```\n\n#### Create an injector\nInjectors allow extending the conversation, item and user objects within the SDK.\nIn this example a new attribute `teaser` is created on the item object. This `teaser` will be added to item objects in any reponse or event from the SDK.\n```javascript\nCircuit.Injectors.itemInjector = function (item) {\n  if (item.type === Circuit.Enums.ConversationItemType.TEXT) {\n    // Create item.teaser attribute with replacing br and hr tags with a space\n    item.teaser = item.text.content.replace(/<(br[\\/]?|\\/li|hr[\\/]?)>/gi, ' ');\n  } else {\n    item.teaser = item.type;\n  }\n};\n```\n\n### Supported Browsers\nChrome and Firefox are officially supported.\n\n### Help us improve the SDK\nHelp us improve the SDK or examples by sending us a pull-request or opening a [GitHub Issue](https://github.com/circuit/circuit-sdk/issues/new).\n","readmeFilename":"README.md","gitHead":"adfcb69d646c4c7ce13b19009ae7e07ef5c1c48c","_id":"circuit-sdk@1.2.7801","_nodeVersion":"12.14.1","_npmVersion":"6.13.4","dist":{"integrity":"sha512-Qid7szyWEIHLm6/zgHvCXcFXiE+BL71uaVQqxgNBhpti0+S+UCkKSegaDNw232Y8wq/C+PjlOPI8nS2HOFA55g==","shasum":"140371fbd8c7c3acf24281db058acee7823ec4e8","tarball":"https://registry.npmjs.org/circuit-sdk/-/circuit-sdk-1.2.7801.tgz","fileCount":11,"unpackedSize":4103089,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeOxUPCRA9TVsSAnZWagAAgtsP/jijMwSPFiBGW34mGrrw\nUTT6kLz/GGH89Oz4T9iFJoGMI0rb8yxgPohFg993b5XwzEH8dGkUA+RFm/Jt\nylFJrrbwmip+SRUWi8hvFiBERt2rYLzPLe2cAaoHweBwcy8QgdYT0sbStgPL\nF07MVGT9tQb9Amvroa/IBmAEIg3el/s6yXKaZovmX3Poi5ECr9t6sMnlusQV\n0YIcy4HzdzGBWpcb3l99bIC+YhgkoUZY7Fytg2dSNWHZOLNZAx+eS8Mcyua3\nNoq28NQhA0qt2rspOuwkpjXTFeYB+eIi85+lSlC1thlbu6F/AUl+5xEOHd/F\nGJo//Wz0yBNeCJVP8YLIcnVcrDZ5M7PQHYWOJOiav6KYC8TfZ91thrH56vZy\nZgJ4qd2T6+GkwtsSKXGM3YY/yV3LQl+nGj3V/gE+vZrWeUr39c1LQGTSvK0O\nViUG4QsM6WdijYpparNbgLcFJJ7kW2pIt6xQL8yCYFUwEbX2kXLDqKAVcK+I\nkMBLftOyjvqMRlddU+ktMGST1BPreKzmsYV98qQ9TOmA5c3yE6PgknCMUOvP\n+E57NhUW71Rnb5oCVxk154A7WHao9j6CqQm+G9oyZHhkN7J8bO+s+4G1vRDo\nyzPsMw8ElF6rKO/pNemtzs4MHv30ifhCJ8jOPYajbMI3SQpmgdQ6gs4KgzQE\n2Cdj\r\n=uZsR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD74Z0tCweGBdcVqYYeuCSFv2sabr0JUULV95IIYmmKdgIgIZr79evcdf9Jrky8fEmmGEyN625Ew5XUBR0YaHX9QJI="}]},"maintainers":[{"name":"rogeru","email":"roger.urscheler@unify.com"},{"name":"rpastro","email":"rodrigo.pastro@unify.com"}],"_npmUser":{"name":"rogeru","email":"roger.urscheler@atos.net"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/circuit-sdk_1.2.7801_1580930318710_0.8140863079469087"},"_hasShrinkwrap":false},"1.2.7900":{"name":"circuit-sdk","version":"1.2.7900","description":"Circuit SDK","main":"circuit-node.js","scripts":{"test:browser":"node test/index","test:node":"mocha ./test/node/* --recursive --timeout=5000 --exit","test":"npm run test:node && npm run test:browser"},"author":{"name":"Unify Inc."},"contributors":[{"name":"Roger Urscheler","email":"roger.urscheler@atos.net"},{"name":"Rodrigo Pastro","email":"rodrigo.pastro@atos.net"},{"name":"Johannes Ruetschi","email":"johannes.ruetschi@atos.net"}],"license":"Apache-2.0","homepage":"https://github.com/circuit/circuit-sdk","engines":{"node":">= 4.5.0"},"repository":{"type":"git","url":"git://github.com/circuit/circuit-sdk.git"},"bugs":{"url":"http://github.com/circuit/circuit-sdk/issues"},"keywords":["api","webrtc","circuit","collaboration","sdk"],"browser":{"electron":false,"./circuit-node.js":"./circuit.js"},"unpkg":"circuit.min.js","dependencies":{"mime":"^2.4.4","ws":"~3.3.3"},"devDependencies":{"chai":"^4.1.2","express":"^4.16.2","globby":"^8.0.1","minimist":"^1.2.0","mocha":"^5.0.1","puppeteer":"^1.1.1","serve-static":"^1.13.2"},"readme":"Circuit JavaScript and Node.js SDK\n==================================\n\n[![NPM release](https://img.shields.io/npm/v/circuit-sdk/beta.svg)](https://www.npmjs.com/package/circuit-sdk)\n[![Build Status](https://travis-ci.org/circuit/circuit-sdk.svg?branch=beta)](https://travis-ci.org/circuit/circuit-sdk)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n\n### Prerequisites\n* Developer account on circuitsandbox.net. Get it for free at [developer registration](https://www.circuit.com/web/developers/registration).\n* OAuth 2.0 `client_id` and optionally `client_secret`. Get if for free at [circuit.github.com/oauth](https://circuit.github.com/oauth).\n\n\n### API Reference\nhttps://circuitsandbox.net/sdk/ with most APIs described in the [Client](https://circuitsandbox.net/sdk/classes/Client.html) class.\n\nMore info at [circuit.github.io](https://circuit.github.io/).\n\n### Usage\n\n#### JavaScript\nAdd the the line below to the HTML file of your app. This will include the latest version of Circuit SDK and make the `Circuit` object available.\n```html\n<script type=\"text/javascript\" src=\"https://unpkg.com/circuit-sdk@beta\"></script>\n```\n\nJS SDK can also be imported via CommonJS or AMD. View the repo [UMD](https://github.com/circuit/umd) for the different types of usage, or [circuit-ionic-start](https://github.com/circuit/circuit-ionic-starter) for example how import the SDK via `require` using webpack.\n\n#### Node.js\n```bash\nnpm install --save circuit-sdk@beta\n```\n\n### Application Types\nThe majority of apps fall in one of the three types below. Each type uses a different OAuth 2.0 Grant.\n\n1. **Client-side web applications** use the JavaScript SDK with the [OAuth 2.0 Implicit Grant](https://circuit.github.io/oauth.html#implicit).\n   ```javascript\n   // No client_secret needed for Implicit Grant. SDK will obtain access token.\n   let client = new Circuit.Client({\n     client_id: '<your client_id>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon()\n     .then(user => console.log('Logged on as ' + user.displayName))\n   ```\n\n2. **Server-side web applications** use the JavaScript SDK (or [REST API](https://circuitsandbox.net/rest/v2/swagger/ui/index.html)) on the client, but handle the authentication flow on the server using the [OAuth 2.0 Authorization Code Grant](https://circuit.github.io/oauth.html#authorization_code). The access token is obtained on the server and then passed to the client to use in the Circuit JavaScript SDK. These apps may also use the Node.js SDK on the server side to act on behalf of the user.<br>\nExample apps: [node-linkify](https://github.com/circuit/node-linkify) or [circuit-google-assistant](https://github.com/circuit/circuit-google-assistant)\n   ```javascript\n   // access token is obtained and managed by server-side app\n   let client = new Circuit.Client({\n     client_id: '<your client_id>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon({accessToken: '<access_token>'})\n     .then(user => console.log('Logged on as ' + user.displayName))\n   ```\n\n3. **Bots** use the [Node.js SDK](https://www.npmjs.com/package/circuit-sdk) or the [REST API](https://circuitsandbox.net/rest/v2/swagger/ui/index.html) and use the [OAuth 2.0 Client Credentials Grant](https://circuit.github.io/oauth.html#client_credentials). Bots are a special type of user; they don't login on behalf of a regular user, hence no OAuth popup asking for a user`s credentials and permissions.<br>\nExample bots: [xlator-bot](https://github.com/circuit/xlator-bot) or [node-sdk-example](https://github.com/circuit/node-sdk-example)<br>\nExample electron bots: [webrtc-bot-example](https://github.com/circuit/webrtc-bot-example) or [live-cam-bot](https://github.com/circuit/live-cam-bot)\n   ```javascript\n   const Circuit = require('circuit-sdk');\n   let client = new Circuit.Client({\n     client_id: '<client_id>',\n     client_secret: '<client_secret>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon()\n     .then(user => console.log('Logged on as bot: ' + user.emailAddress))\n   ```\n\n\n\n### Examples\n\n> JavaScript examples are located at [/examples/js](/examples/js) with more examples on [jsbin](https://circuit.github.io/jssdk.html#jsbin).\n\n> Node.js example apps are on [github](https://github.com/circuit). A summary is listed [here](https://circuit.github.io/nodejs.html). Runkit allows playing with Node.js modules live, similar to jsbin or jsfiddle on the client. [Try it on runkit](https://runkit.com/rogeru/circuit-sdk)\n\nHere are some snippets to get you started.\n\n#### Create Group Conversation and send text message\nLogon as bot, create a group conversation with two users and send a text message.\n```javascript\nclient.logon()\n  .then(user => console.log(`Logged on as ${user.displayName}`, user))\n  .then(() => client.getUsersByEmail(['kim.jackson@mailinator.com', 'maeva.barnaby@mailinator.com']))\n  .then(users => users.map(user => user.userId))\n  .then(userIds => client.createGroupConversation(userIds, 'runkit example'))\n  .then(conv => client.addTextItem(conv.convId, 'I am test bot. What can I do for you?'))\n  .then(client.logout)\n  .catch(console.error)\n```\n\n#### Get Conversations\nGet 10 newest conversations of logged on user.\n```javascript\nclient.getConversations({numberOfConversations: 10})\n  .then(conversations => console.log(`Retrieved ${conversations.length} conversations`))\n```\n\n#### Video call with another Circuit user\nStart a video call with another user. Create conversation if not yet existing.\n> Only applicable to JavaScript SDK and only on browsers supporting WebRTC\n```javascript\nclient.makeCall('bob@company.com', {audio: true, video: true}, true)\n  .then(call => console.log('New call: ', call));\n```\n\n#### Listen for events\n```javascript\n// Register new items added to the feed of this user. E.g. incoming text message\nclient.addEventListener('itemAdded', item =>\n  console.log('itemAdded event received:', item));\n\n// Register for connection state changes\nclient.addEventListener('connectionStateChanged', evt => {\n  console.log(`New state is ${evt.state}`);\n});\n\n// Register and log all events\nCircuit.supportedEvents.forEach(e => client.addEventListener(e, console.log));\n```\n\n#### Create an injector\nInjectors allow extending the conversation, item and user objects within the SDK.\nIn this example a new attribute `teaser` is created on the item object. This `teaser` will be added to item objects in any reponse or event from the SDK.\n```javascript\nCircuit.Injectors.itemInjector = function (item) {\n  if (item.type === Circuit.Enums.ConversationItemType.TEXT) {\n    // Create item.teaser attribute with replacing br and hr tags with a space\n    item.teaser = item.text.content.replace(/<(br[\\/]?|\\/li|hr[\\/]?)>/gi, ' ');\n  } else {\n    item.teaser = item.type;\n  }\n};\n```\n\n### Supported Browsers\nChrome and Firefox are officially supported.\n\n### Help us improve the SDK\nHelp us improve the SDK or examples by sending us a pull-request or opening a [GitHub Issue](https://github.com/circuit/circuit-sdk/issues/new).\n","readmeFilename":"README.md","gitHead":"ef98c60d5727173563373fefc328d247733af396","_id":"circuit-sdk@1.2.7900","_nodeVersion":"12.14.1","_npmVersion":"6.13.4","dist":{"integrity":"sha512-aru7MDVD2/vUCUVVasK7whFegozche4ayDsM9JSY3qCK3IjsuhMpt2SSPFZDRUd6MicBp6uU6IzJd6hBHUXLuw==","shasum":"c1cb4028cf7ceafe029f39b67377c8cdecf1dcf2","tarball":"https://registry.npmjs.org/circuit-sdk/-/circuit-sdk-1.2.7900.tgz","fileCount":11,"unpackedSize":4112292,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeOzH0CRA9TVsSAnZWagAAAtwP/AiOr4YYssSAglPO5eQa\nikYqPgEB0RkFbTo+SGdDCVY+gntQ+gXIebho8dSM+nbkXH+K/k/WxOkm9/KG\n5MsciZ2MRp5uJsBuVVif9cK1+/sgmPDsO7lbMr25XpzgaerSVaBtxRykU7Oz\n18i/5C9T7P9rL+SY+lGiE2/J3/UMQjc2f3sFZs9UvtWGnSgFG5N58p526rhO\n2VLZGYhsVkn7UYqRRUkeHEP4EfEYs4WsQi5sbHaU+PPpBXP0XYLZOJEp5/KC\nZw1rLUjIXPI1w/qI4GuIrhhm5IIXwt0BOWecnYoaX6rj1XVs5eaggkJXjCZl\nZlcSishiZrK2T/HknBFjM0QUYV6SdKixuCWKKcze+CR12N+sFSvlwUBaL49N\nkN+oMaw2Ey5p6qP12erlcOnniE0cAGiTo9NmAStzlMiRs3e0o/rWWvTKhI4T\nZwPmF/6jonOH+t187nhTyURCRPpnsTnUBq5OCpSgx5+dVVLs9oMjjrqb9mSy\n36qnDRBw1/mK5i7DjIyO8u7MpERpDuX947wEkJj5VpXxwlRUshJzJKVYLJ//\nz8TlcBSk46JEiDO8XREVdALs1Yc0vQosxSvEihZVz4bMcRjWW/qp4Ni8l8lp\nIQm+Ien1iHgKGR7p1RKPiIgi2fqSNPVPr9uymokqpxUxi/W8qagOmZuKSOY7\n1G3D\r\n=mDFT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDKb1d0e/LpMRL3jY7jWWZy7CirYav9CW4NoVg0jFbOzAiEAlk4ONts/dZk5Ne+7d8ZzlhRL9qjMprLSfNnh8idFxR8="}]},"maintainers":[{"name":"rogeru","email":"roger.urscheler@unify.com"},{"name":"rpastro","email":"rodrigo.pastro@unify.com"}],"_npmUser":{"name":"rogeru","email":"roger.urscheler@atos.net"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/circuit-sdk_1.2.7900_1580937715656_0.5307524864968438"},"_hasShrinkwrap":false},"1.2.7901":{"name":"circuit-sdk","version":"1.2.7901","description":"Circuit SDK","main":"circuit-node.js","scripts":{"test:browser":"node test/index","test:node":"mocha ./test/node/* --recursive --timeout=5000 --exit","test":"npm run test:node && npm run test:browser"},"author":{"name":"Unify Inc."},"contributors":[{"name":"Roger Urscheler","email":"roger.urscheler@atos.net"},{"name":"Rodrigo Pastro","email":"rodrigo.pastro@atos.net"},{"name":"Johannes Ruetschi","email":"johannes.ruetschi@atos.net"}],"license":"Apache-2.0","homepage":"https://github.com/circuit/circuit-sdk","engines":{"node":">= 4.5.0"},"repository":{"type":"git","url":"git://github.com/circuit/circuit-sdk.git"},"bugs":{"url":"http://github.com/circuit/circuit-sdk/issues"},"keywords":["api","webrtc","circuit","collaboration","sdk"],"browser":{"electron":false,"./circuit-node.js":"./circuit.js"},"unpkg":"circuit.min.js","dependencies":{"mime":"^2.4.4","ws":"~3.3.3"},"devDependencies":{"chai":"^4.1.2","express":"^4.16.2","globby":"^8.0.1","minimist":"^1.2.0","mocha":"^5.0.1","puppeteer":"^1.1.1","serve-static":"^1.13.2"},"readme":"Circuit JavaScript and Node.js SDK\n==================================\n\n[![NPM release](https://img.shields.io/npm/v/circuit-sdk/beta.svg)](https://www.npmjs.com/package/circuit-sdk)\n[![Build Status](https://travis-ci.org/circuit/circuit-sdk.svg?branch=beta)](https://travis-ci.org/circuit/circuit-sdk)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n\n### Prerequisites\n* Developer account on circuitsandbox.net. Get it for free at [developer registration](https://www.circuit.com/web/developers/registration).\n* OAuth 2.0 `client_id` and optionally `client_secret`. Get if for free at [circuit.github.com/oauth](https://circuit.github.com/oauth).\n\n\n### API Reference\nhttps://circuitsandbox.net/sdk/ with most APIs described in the [Client](https://circuitsandbox.net/sdk/classes/Client.html) class.\n\nMore info at [circuit.github.io](https://circuit.github.io/).\n\n### Usage\n\n#### JavaScript\nAdd the the line below to the HTML file of your app. This will include the latest version of Circuit SDK and make the `Circuit` object available.\n```html\n<script type=\"text/javascript\" src=\"https://unpkg.com/circuit-sdk@beta\"></script>\n```\n\nJS SDK can also be imported via CommonJS or AMD. View the repo [UMD](https://github.com/circuit/umd) for the different types of usage, or [circuit-ionic-start](https://github.com/circuit/circuit-ionic-starter) for example how import the SDK via `require` using webpack.\n\n#### Node.js\n```bash\nnpm install --save circuit-sdk@beta\n```\n\n### Application Types\nThe majority of apps fall in one of the three types below. Each type uses a different OAuth 2.0 Grant.\n\n1. **Client-side web applications** use the JavaScript SDK with the [OAuth 2.0 Implicit Grant](https://circuit.github.io/oauth.html#implicit).\n   ```javascript\n   // No client_secret needed for Implicit Grant. SDK will obtain access token.\n   let client = new Circuit.Client({\n     client_id: '<your client_id>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon()\n     .then(user => console.log('Logged on as ' + user.displayName))\n   ```\n\n2. **Server-side web applications** use the JavaScript SDK (or [REST API](https://circuitsandbox.net/rest/v2/swagger/ui/index.html)) on the client, but handle the authentication flow on the server using the [OAuth 2.0 Authorization Code Grant](https://circuit.github.io/oauth.html#authorization_code). The access token is obtained on the server and then passed to the client to use in the Circuit JavaScript SDK. These apps may also use the Node.js SDK on the server side to act on behalf of the user.<br>\nExample apps: [node-linkify](https://github.com/circuit/node-linkify) or [circuit-google-assistant](https://github.com/circuit/circuit-google-assistant)\n   ```javascript\n   // access token is obtained and managed by server-side app\n   let client = new Circuit.Client({\n     client_id: '<your client_id>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon({accessToken: '<access_token>'})\n     .then(user => console.log('Logged on as ' + user.displayName))\n   ```\n\n3. **Bots** use the [Node.js SDK](https://www.npmjs.com/package/circuit-sdk) or the [REST API](https://circuitsandbox.net/rest/v2/swagger/ui/index.html) and use the [OAuth 2.0 Client Credentials Grant](https://circuit.github.io/oauth.html#client_credentials). Bots are a special type of user; they don't login on behalf of a regular user, hence no OAuth popup asking for a user`s credentials and permissions.<br>\nExample bots: [xlator-bot](https://github.com/circuit/xlator-bot) or [node-sdk-example](https://github.com/circuit/node-sdk-example)<br>\nExample electron bots: [webrtc-bot-example](https://github.com/circuit/webrtc-bot-example) or [live-cam-bot](https://github.com/circuit/live-cam-bot)\n   ```javascript\n   const Circuit = require('circuit-sdk');\n   let client = new Circuit.Client({\n     client_id: '<client_id>',\n     client_secret: '<client_secret>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon()\n     .then(user => console.log('Logged on as bot: ' + user.emailAddress))\n   ```\n\n\n\n### Examples\n\n> JavaScript examples are located at [/examples/js](/examples/js) with more examples on [jsbin](https://circuit.github.io/jssdk.html#jsbin).\n\n> Node.js example apps are on [github](https://github.com/circuit). A summary is listed [here](https://circuit.github.io/nodejs.html). Runkit allows playing with Node.js modules live, similar to jsbin or jsfiddle on the client. [Try it on runkit](https://runkit.com/rogeru/circuit-sdk)\n\nHere are some snippets to get you started.\n\n#### Create Group Conversation and send text message\nLogon as bot, create a group conversation with two users and send a text message.\n```javascript\nclient.logon()\n  .then(user => console.log(`Logged on as ${user.displayName}`, user))\n  .then(() => client.getUsersByEmail(['kim.jackson@mailinator.com', 'maeva.barnaby@mailinator.com']))\n  .then(users => users.map(user => user.userId))\n  .then(userIds => client.createGroupConversation(userIds, 'runkit example'))\n  .then(conv => client.addTextItem(conv.convId, 'I am test bot. What can I do for you?'))\n  .then(client.logout)\n  .catch(console.error)\n```\n\n#### Get Conversations\nGet 10 newest conversations of logged on user.\n```javascript\nclient.getConversations({numberOfConversations: 10})\n  .then(conversations => console.log(`Retrieved ${conversations.length} conversations`))\n```\n\n#### Video call with another Circuit user\nStart a video call with another user. Create conversation if not yet existing.\n> Only applicable to JavaScript SDK and only on browsers supporting WebRTC\n```javascript\nclient.makeCall('bob@company.com', {audio: true, video: true}, true)\n  .then(call => console.log('New call: ', call));\n```\n\n#### Listen for events\n```javascript\n// Register new items added to the feed of this user. E.g. incoming text message\nclient.addEventListener('itemAdded', item =>\n  console.log('itemAdded event received:', item));\n\n// Register for connection state changes\nclient.addEventListener('connectionStateChanged', evt => {\n  console.log(`New state is ${evt.state}`);\n});\n\n// Register and log all events\nCircuit.supportedEvents.forEach(e => client.addEventListener(e, console.log));\n```\n\n#### Create an injector\nInjectors allow extending the conversation, item and user objects within the SDK.\nIn this example a new attribute `teaser` is created on the item object. This `teaser` will be added to item objects in any reponse or event from the SDK.\n```javascript\nCircuit.Injectors.itemInjector = function (item) {\n  if (item.type === Circuit.Enums.ConversationItemType.TEXT) {\n    // Create item.teaser attribute with replacing br and hr tags with a space\n    item.teaser = item.text.content.replace(/<(br[\\/]?|\\/li|hr[\\/]?)>/gi, ' ');\n  } else {\n    item.teaser = item.type;\n  }\n};\n```\n\n### Supported Browsers\nChrome and Firefox are officially supported.\n\n### Help us improve the SDK\nHelp us improve the SDK or examples by sending us a pull-request or opening a [GitHub Issue](https://github.com/circuit/circuit-sdk/issues/new).\n","readmeFilename":"README.md","gitHead":"973d5b92fff66546c7c4655ac9272dd3dad7d667","_id":"circuit-sdk@1.2.7901","_nodeVersion":"12.14.1","_npmVersion":"6.13.4","dist":{"integrity":"sha512-PAbzIC78kQr2QEafPqLIIJg8OJtWZifRUQSUKEUok3dSKlHSQf13MICIVdVe7N1M0Z+WuCtO82IaqDI/llE3XQ==","shasum":"f0865792a83cce1a83ac1c8065bdeb42f4622ee0","tarball":"https://registry.npmjs.org/circuit-sdk/-/circuit-sdk-1.2.7901.tgz","fileCount":11,"unpackedSize":4112365,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJePIsmCRA9TVsSAnZWagAAmzcQAJzdm82Zr/4A2e0pUt3/\nxdFGUy3EwsOO6vuF6NRLWSXQX4nkaxTyYjm9DIFT4VqJh6ICLOy1TR7EbZH8\nRIM/Hy+T75k+l2GGh1u1UvT/ZF00MmeuG6to9j9V8tHt5cMpRduh4BzsTsoM\nnby48bTLUct9CV07l4ow9CfjHvCEYtlhuCF7cjNUxsotncB8gHaNlxM3hyzI\nThZxT4xkbBc3VNdHqkNY9/Y3aq0PAfR+tm9qfb9Jq8M+CtKCHaNaUASixZr8\nx3yPnwo3gCJwQ87nhbonANePYes/G/BVwV2rRQyDETFKSGfNt0i7V0hbpwz3\nSfoBLINssMvLX2A6sJc+Kg7gIW/okxak6B0rrMmYjZYyA4qqEyg6WlN1g20H\neIrGtx5M1ihdtG7FlrPfgLkZPOJr1n1AnQLLF4MxySWA+Kdpap/yUf422Ylo\ncO7ss/JXnygndX7GiW2xdxXaCw9QWWr84eLDvOUFVo+kdB1augFeVd/AvBpm\n/kf177bEVPOSn/KGaB1g7M3I5gOLxfCx4Ar2wfpyQiBaFgtxN3o2UglQcSkJ\nc5goEMv6IcPQr9avqyyVSoqdvPy7fp8kzX8rOOo2hUq64MtBW9BIY+F0gxK1\nPC8pFqDJRfE//xFKaEvOZYT9OjEUliiRf6FZ93KcBHzPa8RWybjDZW5okxuu\nuiW/\r\n=awU9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCypBy2z+2e0gvMES5yljqEMUEkvVZzpKUOc/pT9ZGAtwIgdjkrUSr/B4S967ei1lA+ebJwvTPv1a+3bz/fVkLra0Y="}]},"maintainers":[{"name":"rogeru","email":"roger.urscheler@unify.com"},{"name":"rpastro","email":"rodrigo.pastro@unify.com"}],"_npmUser":{"name":"rogeru","email":"roger.urscheler@atos.net"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/circuit-sdk_1.2.7901_1581026085608_0.37951083371526306"},"_hasShrinkwrap":false},"1.2.8600":{"name":"circuit-sdk","version":"1.2.8600","description":"Circuit SDK","main":"circuit-node.js","scripts":{"test:browser":"node test/index","test:node":"mocha ./test/node/* --recursive --timeout=5000 --exit","test":"npm run test:node && npm run test:browser"},"author":{"name":"Unify Inc."},"contributors":[{"name":"Roger Urscheler","email":"roger.urscheler@atos.net"},{"name":"Rodrigo Pastro","email":"rodrigo.pastro@atos.net"},{"name":"Johannes Ruetschi","email":"johannes.ruetschi@atos.net"}],"license":"Apache-2.0","homepage":"https://github.com/circuit/circuit-sdk","engines":{"node":">= 4.5.0"},"repository":{"type":"git","url":"git://github.com/circuit/circuit-sdk.git"},"bugs":{"url":"http://github.com/circuit/circuit-sdk/issues"},"keywords":["api","webrtc","circuit","collaboration","sdk"],"browser":{"electron":false,"./circuit-node.js":"./circuit.js"},"unpkg":"circuit.min.js","dependencies":{"mime":"^2.4.4","ws":"~3.3.3"},"devDependencies":{"chai":"^4.1.2","express":"^4.16.2","globby":"^8.0.1","minimist":"^1.2.0","mocha":"^5.0.1","puppeteer":"^1.1.1","serve-static":"^1.13.2"},"readme":"Circuit JavaScript and Node.js SDK\n==================================\n\n[![NPM release](https://img.shields.io/npm/v/circuit-sdk/beta.svg)](https://www.npmjs.com/package/circuit-sdk)\n[![Build Status](https://travis-ci.org/circuit/circuit-sdk.svg?branch=beta)](https://travis-ci.org/circuit/circuit-sdk)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n\n### Prerequisites\n* Developer account on circuitsandbox.net. Get it for free at [developer registration](https://www.circuit.com/web/developers/registration).\n* OAuth 2.0 `client_id` and optionally `client_secret`. Get if for free at [circuit.github.com/oauth](https://circuit.github.com/oauth).\n\n\n### API Reference\nhttps://circuitsandbox.net/sdk/ with most APIs described in the [Client](https://circuitsandbox.net/sdk/classes/Client.html) class.\n\nMore info at [circuit.github.io](https://circuit.github.io/).\n\n### Usage\n\n#### JavaScript\nAdd the the line below to the HTML file of your app. This will include the latest version of Circuit SDK and make the `Circuit` object available.\n```html\n<script type=\"text/javascript\" src=\"https://unpkg.com/circuit-sdk@beta\"></script>\n```\n\nJS SDK can also be imported via CommonJS or AMD. View the repo [UMD](https://github.com/circuit/umd) for the different types of usage, or [circuit-ionic-start](https://github.com/circuit/circuit-ionic-starter) for example how import the SDK via `require` using webpack.\n\n#### Node.js\n```bash\nnpm install --save circuit-sdk@beta\n```\n\n### Application Types\nThe majority of apps fall in one of the three types below. Each type uses a different OAuth 2.0 Grant.\n\n1. **Client-side web applications** use the JavaScript SDK with the [OAuth 2.0 Implicit Grant](https://circuit.github.io/oauth.html#implicit).\n   ```javascript\n   // No client_secret needed for Implicit Grant. SDK will obtain access token.\n   let client = new Circuit.Client({\n     client_id: '<your client_id>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon()\n     .then(user => console.log('Logged on as ' + user.displayName))\n   ```\n\n2. **Server-side web applications** use the JavaScript SDK (or [REST API](https://circuitsandbox.net/rest/v2/swagger/ui/index.html)) on the client, but handle the authentication flow on the server using the [OAuth 2.0 Authorization Code Grant](https://circuit.github.io/oauth.html#authorization_code). The access token is obtained on the server and then passed to the client to use in the Circuit JavaScript SDK. These apps may also use the Node.js SDK on the server side to act on behalf of the user.<br>\nExample apps: [node-linkify](https://github.com/circuit/node-linkify) or [circuit-google-assistant](https://github.com/circuit/circuit-google-assistant)\n   ```javascript\n   // access token is obtained and managed by server-side app\n   let client = new Circuit.Client({\n     client_id: '<your client_id>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon({accessToken: '<access_token>'})\n     .then(user => console.log('Logged on as ' + user.displayName))\n   ```\n\n3. **Bots** use the [Node.js SDK](https://www.npmjs.com/package/circuit-sdk) or the [REST API](https://circuitsandbox.net/rest/v2/swagger/ui/index.html) and use the [OAuth 2.0 Client Credentials Grant](https://circuit.github.io/oauth.html#client_credentials). Bots are a special type of user; they don't login on behalf of a regular user, hence no OAuth popup asking for a user`s credentials and permissions.<br>\nExample bots: [xlator-bot](https://github.com/circuit/xlator-bot) or [node-sdk-example](https://github.com/circuit/node-sdk-example)<br>\nExample electron bots: [webrtc-bot-example](https://github.com/circuit/webrtc-bot-example) or [live-cam-bot](https://github.com/circuit/live-cam-bot)\n   ```javascript\n   const Circuit = require('circuit-sdk');\n   let client = new Circuit.Client({\n     client_id: '<client_id>',\n     client_secret: '<client_secret>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon()\n     .then(user => console.log('Logged on as bot: ' + user.emailAddress))\n   ```\n\n\n\n### Examples\n\n> JavaScript examples are located at [/examples/js](/examples/js) with more examples on [jsbin](https://circuit.github.io/jssdk.html#jsbin).\n\n> Node.js example apps are on [github](https://github.com/circuit). A summary is listed [here](https://circuit.github.io/nodejs.html). Runkit allows playing with Node.js modules live, similar to jsbin or jsfiddle on the client. [Try it on runkit](https://runkit.com/rogeru/circuit-sdk)\n\nHere are some snippets to get you started.\n\n#### Create Group Conversation and send text message\nLogon as bot, create a group conversation with two users and send a text message.\n```javascript\nclient.logon()\n  .then(user => console.log(`Logged on as ${user.displayName}`, user))\n  .then(() => client.getUsersByEmail(['kim.jackson@mailinator.com', 'maeva.barnaby@mailinator.com']))\n  .then(users => users.map(user => user.userId))\n  .then(userIds => client.createGroupConversation(userIds, 'runkit example'))\n  .then(conv => client.addTextItem(conv.convId, 'I am test bot. What can I do for you?'))\n  .then(client.logout)\n  .catch(console.error)\n```\n\n#### Get Conversations\nGet 10 newest conversations of logged on user.\n```javascript\nclient.getConversations({numberOfConversations: 10})\n  .then(conversations => console.log(`Retrieved ${conversations.length} conversations`))\n```\n\n#### Video call with another Circuit user\nStart a video call with another user. Create conversation if not yet existing.\n> Only applicable to JavaScript SDK and only on browsers supporting WebRTC\n```javascript\nclient.makeCall('bob@company.com', {audio: true, video: true}, true)\n  .then(call => console.log('New call: ', call));\n```\n\n#### Listen for events\n```javascript\n// Register new items added to the feed of this user. E.g. incoming text message\nclient.addEventListener('itemAdded', item =>\n  console.log('itemAdded event received:', item));\n\n// Register for connection state changes\nclient.addEventListener('connectionStateChanged', evt => {\n  console.log(`New state is ${evt.state}`);\n});\n\n// Register and log all events\nCircuit.supportedEvents.forEach(e => client.addEventListener(e, console.log));\n```\n\n#### Create an injector\nInjectors allow extending the conversation, item and user objects within the SDK.\nIn this example a new attribute `teaser` is created on the item object. This `teaser` will be added to item objects in any reponse or event from the SDK.\n```javascript\nCircuit.Injectors.itemInjector = function (item) {\n  if (item.type === Circuit.Enums.ConversationItemType.TEXT) {\n    // Create item.teaser attribute with replacing br and hr tags with a space\n    item.teaser = item.text.content.replace(/<(br[\\/]?|\\/li|hr[\\/]?)>/gi, ' ');\n  } else {\n    item.teaser = item.type;\n  }\n};\n```\n\n### Supported Browsers\nChrome and Firefox are officially supported.\n\n### Help us improve the SDK\nHelp us improve the SDK or examples by sending us a pull-request or opening a [GitHub Issue](https://github.com/circuit/circuit-sdk/issues/new).\n","readmeFilename":"README.md","gitHead":"7c22955aefe5b4959d9376ef377726975f331d78","_id":"circuit-sdk@1.2.8600","_nodeVersion":"12.14.1","_npmVersion":"6.13.4","dist":{"integrity":"sha512-bWMePYFuboIpFo1pRTfV5xF/Eyj5ZIKelx2+fm2IhZbzprO3rb+0C+QV+B8bt2Oy5orojUZNGCnRWNJO4s436A==","shasum":"5c5eef867e2b5316e3a6dee0b9e342d646238dd1","tarball":"https://registry.npmjs.org/circuit-sdk/-/circuit-sdk-1.2.8600.tgz","fileCount":11,"unpackedSize":4024105,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDezhCRA9TVsSAnZWagAAgT0P+QHLfQW71Lyz8C8PjGDN\nqC5M9JCnzZzX6hTc4FILaf5xC3EW960HAyRjHEz7p4MLybSRkx7ZAPVFE7pH\nnzV2fCyf0X/y+eZMdGOdA8s/vQQ7UroAltr72sGUkL6t12lncDS8C006Qwwa\njXmWoBL7co0Hlkpzdcc3mqviZgH8OpaBBfI9gVu7gASNE1euz2mgfDH5SAke\n3X2D4G5jv0RNdjMhA7ClpCjb0YSEdUdKg4b48BtdHMQuGQ4IJMVCu2n3GEpr\nW9i5qiMCRascRSql9+E/GvgosGRAmrB74sfpGQddUbMrBzOueWqrnKhamjwF\ncxHNqxfnbFhSw9L5V/D04BYIGWzq4UXpu6t0/mDKTw66mD+CF9NfotUT1aN2\n0QC4osHVfc2CmwoWRVdWMEuXlzhAVoxXqCncMPKD/S2OYlywMJ51kClvbH20\nf/peMdiwVk74UP0XetOZnHOYeJgo0ncR+xh184+GenvE+TKRQksA6PbYLGhW\naqiC6kOX1AD1bxCQ3f7o0+wBiNbHxNDWYynJ9aPGDKVfKKEqiFICzEAwLhit\n3G5SIFCaeHMVH4jr7kJ8Mm7C6lGp/Fdfaw1IQ00PBR4VHOa3fJwuXImVx8sQ\nwkBAJ0KyGkFALb8RwrmSb7aJ11dg4wbykHqihsFysHzMWptagoNBIEZxoFvs\n3Ps3\r\n=HyHC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICacPEcv5aZkMbwXGB8215y45wMKSudRZv9Prh6WcdfmAiApHgaJDS5i0dgrhx8ae4x3mgXpWTRD/ArcX9I2u5fpXg=="}]},"maintainers":[{"name":"rogeru","email":"roger.urscheler@unify.com"},{"name":"rpastro","email":"rodrigo.pastro@unify.com"}],"_npmUser":{"name":"rogeru","email":"roger.urscheler@atos.net"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/circuit-sdk_1.2.8600_1594748128459_0.2779191595531003"},"_hasShrinkwrap":false},"1.2.8401":{"name":"circuit-sdk","version":"1.2.8401","description":"Circuit SDK","main":"circuit-node.js","scripts":{"test:browser":"node test/index","test:node":"mocha ./test/node/* --recursive --timeout=5000 --exit","test":"npm run test:node && npm run test:browser"},"author":{"name":"Unify Inc."},"contributors":[{"name":"Roger Urscheler","email":"roger.urscheler@atos.net"},{"name":"Rodrigo Pastro","email":"rodrigo.pastro@atos.net"},{"name":"Johannes Ruetschi","email":"johannes.ruetschi@atos.net"}],"license":"Apache-2.0","homepage":"https://github.com/circuit/circuit-sdk","engines":{"node":">= 4.5.0"},"repository":{"type":"git","url":"git://github.com/circuit/circuit-sdk.git"},"bugs":{"url":"http://github.com/circuit/circuit-sdk/issues"},"keywords":["api","webrtc","circuit","collaboration","sdk"],"browser":{"electron":false,"./circuit-node.js":"./circuit.js"},"unpkg":"circuit.min.js","dependencies":{"mime":"^2.4.4","ws":"~3.3.3"},"devDependencies":{"chai":"^4.1.2","express":"^4.16.2","globby":"^8.0.1","minimist":"^1.2.0","mocha":"^5.0.1","puppeteer":"^1.1.1","serve-static":"^1.13.2"},"gitHead":"69bbfbd323e581ae6db250ddc6cfe0ac0889829b","_id":"circuit-sdk@1.2.8401","_nodeVersion":"12.14.1","_npmVersion":"6.13.4","dist":{"integrity":"sha512-LkZBIIubNvB3mVw/jjGcJyfwWU7uRUj/Tz38NPBJGJWnbOa7uQRa/8GLI88npAdq7Yy1xYMfKc2ckSCM7TCy5A==","shasum":"b242439c9c3f4ea0a75ec78b4844f805762a69af","tarball":"https://registry.npmjs.org/circuit-sdk/-/circuit-sdk-1.2.8401.tgz","fileCount":12,"unpackedSize":4165736,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDe2oCRA9TVsSAnZWagAAQhIP/Ryq2VNpUfj3PTP4MAsi\nC2WFuJngC0CBof+OGjAb3I9U6cf0oiO3s+PACpFHCU1H1J6tsTB9CA/NMa0s\noA9+iZFbixMOpthLyiPbO0LtM2CgUUEAx9KoRdJvemR+sPNWAKQu6Pefca1r\nN8+cfFARHyIyhwMJY3ToS/vHF5ug3YhAsLRLuOsqJc1jKekUXDIe1+o8FuXF\nYsL92jmTB7ktPZBWL/iRhRlkIcWUCp7CCfLvjjr3dA7cKEDLgEOVugV6QTFw\nsURX1DOENLTKFO9ZLUq7zeAowI38hb67HEfzROjTIZEm57d0xzZeK+qjZqDA\nW7loXGK3MmoocR/JE4bpU1zEQzxBRFjdLDEQFDB23efTMNgbuqSBAMzR865/\nLMtwFlbI/Tpr/7hMTrb8L32ehqU0FeE37CsybPzccO2h0s08yKWqmGUTzY7o\nuevUMJ/6xmj3svrpEdiX28gjIEOcQYHsITpKGoDQiABRmi7IindTyYBhnxiO\n/ii0NErnh5VqfNzsRmX/lCD3NDynKCL9G+gtMMaXHz+zhT2cmHdWJpNIBB/g\nhJRTobDlZW/VANOdM6QtWPuL2YoxSnevHIFQrmt3ScCav4THInGufRaXAluG\nY8JSzR2g18p/H+lYwaL/dcfDyKPPLUdIpRu2Dk2P5XYkY0AgHKHAxJvQDpW8\nnvv4\r\n=Anof\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFylBSruVeTOLtMxkyJsYdmVWDoxVbAcV0q5HFBiQpnjAiAEjDmdWJn+yAjjDWTeK8yBr34F5Bs/lgCxVMe1S6WXyQ=="}]},"maintainers":[{"name":"rogeru","email":"roger.urscheler@unify.com"},{"name":"rpastro","email":"rodrigo.pastro@unify.com"}],"_npmUser":{"name":"rogeru","email":"roger.urscheler@atos.net"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/circuit-sdk_1.2.8401_1594748328315_0.26445617582250236"},"_hasShrinkwrap":false}},"readme":"Circuit JavaScript and Node.js SDK\n==================================\n\n[![GitHub release](https://img.shields.io/github/release/circuit/circuit-sdk.svg)](https://github.com/circuit/circuit-sdk)\n[![Build Status](https://travis-ci.org/circuit/circuit-sdk.svg?branch=master)](https://travis-ci.org/circuit/circuit-sdk)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n\n### Prerequisites\n* Register for a free developer account and create your own OAuth app to get a `client_id`. See [Getting Started](https://circuit.github.io/) for details.\n\n### API Reference\nhttps://circuitsandbox.net/sdk/ with most APIs described in the [Client](https://circuitsandbox.net/sdk/classes/Client.html) class.\n\n### Usage\n\n#### JavaScript\nAdd the the line below to the HTML file of your app. This will include the latest version of Circuit SDK and make the `Circuit` object available.\n```html\n<script type=\"text/javascript\" src=\"https://unpkg.com/circuit-sdk\"></script>\n```\n\nJS SDK can also be imported via CommonJS or AMD. View the repo [UMD](https://github.com/circuit/umd) for the different types of usage, or [circuit-ionic-start](https://github.com/circuit/circuit-ionic-starter) for example how import the SDK via `require` using webpack.\n\n#### Node.js\n```bash\nnpm install --save circuit-sdk\n```\n\n### Application Types\nThe majority of apps fall in one of the three types below. Each type uses a different OAuth 2.0 Grant.\n\n1. **Client-side web applications** use the JavaScript SDK with the [OAuth 2.0 Implicit Grant](https://circuit.github.io/oauth.html#implicit).\n   ```javascript\n   // No client_secret needed for Implicit Grant. SDK will obtain access token.\n   const client = new Circuit.Client({\n     client_id: '<your client_id>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon()\n     .then(user => console.log('Logged on as ' + user.displayName))\n   ```\n\n2. **Server-side web applications** use the JavaScript SDK (or [REST API](https://circuitsandbox.net/rest/v2/swagger/ui/index.html)) on the client, but handle the authentication flow on the server using the [OAuth 2.0 Authorization Code Grant](https://circuit.github.io/oauth.html#authorization_code). The access token is obtained on the server and then passed to the client to use in the Circuit JavaScript SDK. These apps may also use the Node.js SDK on the server side to act on behalf of the user.<br>\nExample apps: [node-linkify](https://github.com/circuit/node-linkify) or [circuit-google-assistant](https://github.com/circuit/circuit-google-assistant)\n   ```javascript\n   // access token is obtained and managed by server-side app\n   const client = new Circuit.Client({\n     client_id: '<your client_id>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon({accessToken: '<access_token>'})\n     .then(user => console.log('Logged on as ' + user.displayName))\n   ```\n\n3. **Bots** use the [Node.js SDK](https://www.npmjs.com/package/circuit-sdk) or the [REST API](https://circuitsandbox.net/rest/v2/swagger/ui/index.html) and use the [OAuth 2.0 Client Credentials Grant](https://circuit.github.io/oauth.html#client_credentials). Bots are a special type of user; they don't login on behalf of a regular user, hence no OAuth popup asking for a user`s credentials and permissions.<br>\nExample bots: [xlator-bot](https://github.com/circuit/xlator-bot) or [node-sdk-example](https://github.com/circuit/node-sdk-example)<br>\nExample electron bots: [webrtc-bot-example](https://github.com/circuit/webrtc-bot-example) or [live-cam-bot](https://github.com/circuit/live-cam-bot)\n   ```javascript\n   const Circuit = require('circuit-sdk');\n   const client = new Circuit.Client({\n     client_id: '<client_id>',\n     client_secret: '<client_secret>',\n     domain: 'circuitsandbox.net'\n   });\n   client.logon()\n     .then(user => console.log('Logged on as bot: ' + user.emailAddress))\n   ```\n\n\n\n### Examples\n\n> JavaScript examples are located at [/examples/js](/examples/js) with more examples on [jsbin](https://circuit.github.io/jssdk.html#jsbin).\n\n> Node.js example apps are on [github](https://github.com/circuit). A summary is listed [here](https://circuit.github.io/nodejs.html). Runkit allows playing with Node.js modules live, similar to jsbin or jsfiddle on the client. [Try it on runkit](https://runkit.com/rogeru/circuit-sdk)\n\nHere are some snippets to get you started.\n\n#### Create Group Conversation and send text message\nLogon as bot, create a group conversation with two users and send a text message.\n```javascript\nclient.logon()\n  .then(user => console.log(`Logged on as ${user.displayName}`, user))\n  .then(() => client.getUsersByEmail(['kim.jackson@mailinator.com', 'maeva.barnaby@mailinator.com']))\n  .then(users => users.map(user => user.userId))\n  .then(userIds => client.createGroupConversation(userIds, 'runkit example'))\n  .then(conv => client.addTextItem(conv.convId, 'I am test bot. What can I do for you?'))\n  .then(client.logout)\n  .catch(console.error)\n```\n\n#### Get Conversations\nGet 10 newest conversations of logged on user.\n```javascript\nclient.getConversations({numberOfConversations: 10})\n  .then(conversations => console.log(`Retrieved ${conversations.length} conversations`))\n```\n\n#### Video call with another Circuit user\nStart a video call with another user. Create conversation if not yet existing.\n> Only applicable to JavaScript SDK and only on browsers supporting WebRTC\n```javascript\nclient.makeCall('bob@company.com', {audio: true, video: true}, true)\n  .then(call => console.log('New call: ', call));\n```\n\n#### Listen for events\n```javascript\n// Register new items added to the feed of this user. E.g. incoming text message\nclient.addEventListener('itemAdded', item =>\n  console.log('itemAdded event received:', item));\n\n// Register for connection state changes\nclient.addEventListener('connectionStateChanged', evt => {\n  console.log(`New state is ${evt.state}`);\n});\n\n// Register and log all events\nCircuit.supportedEvents.forEach(e => client.addEventListener(e, console.log));\n```\n\n#### Create an injector\nInjectors allow extending the conversation, item and user objects within the SDK.\nIn this example a new attribute `teaser` is created on the item object. This `teaser` will be added to item objects in any reponse or event from the SDK.\n```javascript\nCircuit.Injectors.itemInjector = function (item) {\n  if (item.type === Circuit.Enums.ConversationItemType.TEXT) {\n    // Create item.teaser attribute with replacing br and hr tags with a space\n    item.teaser = item.text.content.replace(/<(br[\\/]?|\\/li|hr[\\/]?)>/gi, ' ');\n  } else {\n    item.teaser = item.type;\n  }\n};\n```\n\n### Supported Browsers\nChrome and Firefox are officially supported.\n\n### Help us improve the SDK\nHelp us improve the SDK or examples by sending us a pull-request or opening a [GitHub Issue](https://github.com/circuit/circuit-sdk/issues/new). \n","maintainers":[{"name":"rogeru","email":"roger.urscheler@unify.com"},{"name":"rpastro","email":"rodrigo.pastro@unify.com"}],"time":{"modified":"2022-06-13T06:03:05.726Z","created":"2017-07-29T03:42:52.048Z","1.2.1202":"2017-07-29T03:42:52.048Z","1.2.1402":"2017-08-22T14:15:02.883Z","1.2.1403":"2017-08-25T12:17:41.372Z","1.2.1800":"2017-09-30T16:56:02.051Z","1.2.1801":"2017-10-02T12:58:02.286Z","1.2.1900":"2017-10-13T13:47:37.048Z","1.2.2000":"2017-10-27T13:29:40.875Z","1.2.2100":"2017-11-15T14:58:55.483Z","1.2.2200":"2017-11-29T00:34:18.159Z","1.2.2300":"2017-12-15T00:38:18.467Z","1.2.2400":"2017-12-23T15:05:36.701Z","1.2.2600":"2018-01-20T18:11:41.436Z","1.2.2401":"2018-01-20T18:34:10.446Z","1.2.2402":"2018-01-21T00:04:14.023Z","1.2.2800":"2018-02-01T22:32:07.808Z","1.2.2700":"2018-02-07T16:03:50.774Z","1.2.2801":"2018-02-14T13:30:28.736Z","1.2.2802":"2018-02-16T20:12:44.271Z","1.2.2701":"2018-02-17T23:59:15.634Z","1.2.2803":"2018-02-23T20:33:21.732Z","1.2.2804":"2018-02-23T20:43:20.094Z","1.2.2805":"2018-02-24T19:27:02.907Z","1.2.3000":"2018-03-28T15:22:38.564Z","1.2.2902":"2018-03-29T00:40:51.643Z","1.2.3302":"2018-05-14T18:32:19.846Z","1.2.3400":"2018-05-14T20:53:32.369Z","1.2.3600":"2018-06-08T11:49:53.785Z","1.2.3503":"2018-06-18T13:54:38.439Z","1.2.3700":"2018-06-22T15:57:55.668Z","1.2.3900":"2018-07-20T15:33:59.574Z","1.2.3704":"2018-07-23T14:59:52.202Z","1.2.3902":"2018-08-14T16:45:50.828Z","1.2.4000":"2018-08-14T16:55:00.091Z","1.2.4101":"2018-09-05T12:57:57.362Z","1.2.4200":"2018-09-05T13:00:00.489Z","1.2.4502":"2018-10-30T14:43:19.880Z","1.2.4600":"2018-11-01T14:33:55.434Z","1.2.4700":"2018-11-08T11:47:53.950Z","1.2.4703":"2018-12-03T13:23:43.596Z","1.2.4800":"2018-12-03T13:29:46.860Z","1.2.5000":"2019-01-13T13:29:11.473Z","1.2.4903":"2019-01-13T13:38:54.449Z","1.2.5201":"2019-02-15T01:11:40.303Z","1.2.5300":"2019-02-15T01:13:10.975Z","1.2.5500":"2019-03-01T00:25:43.089Z","1.2.5601":"2019-03-19T12:43:56.187Z","1.2.5402":"2019-03-19T12:55:12.994Z","1.2.5603":"2019-04-16T12:37:45.304Z","1.2.6100":"2019-06-04T17:39:40.767Z","1.2.6002":"2019-06-10T11:54:31.713Z","1.2.6402":"2019-07-22T13:11:50.515Z","1.2.6900":"2019-09-10T14:08:34.503Z","1.2.7100":"2019-10-16T23:09:27.442Z","1.2.7003":"2019-11-04T13:09:41.679Z","1.2.7201":"2019-11-04T13:12:42.797Z","1.2.7202":"2019-11-04T14:36:58.550Z","1.2.7004":"2019-11-04T14:38:22.164Z","1.2.7203":"2019-11-13T18:17:19.596Z","1.2.7005":"2019-11-13T18:26:11.156Z","1.2.7403":"2019-12-13T17:37:17.249Z","1.2.7402":"2019-12-13T17:46:35.381Z","1.2.7604":"2020-01-10T16:43:09.602Z","1.2.7801":"2020-02-05T19:18:38.831Z","1.2.7900":"2020-02-05T21:21:56.214Z","1.2.7901":"2020-02-06T21:54:45.880Z","1.2.8600":"2020-07-14T17:35:28.729Z","1.2.8401":"2020-07-14T17:38:48.503Z"},"author":{"name":"Unify Inc."},"readmeFilename":"README.md","contributors":[{"name":"Roger Urscheler","email":"roger.urscheler@atos.net"},{"name":"Rodrigo Pastro","email":"rodrigo.pastro@atos.net"},{"name":"Johannes Ruetschi","email":"johannes.ruetschi@atos.net"}],"license":"Apache-2.0","homepage":"https://github.com/circuit/circuit-sdk","keywords":["api","webrtc","circuit","collaboration","sdk"],"repository":{"type":"git","url":"git://github.com/circuit/circuit-sdk.git"},"bugs":{"url":"http://github.com/circuit/circuit-sdk/issues"}}