{"_id":"@hyperbeam/iframe","_rev":"31-2c5f7a793d3cd73448fe79e0cbc00359","name":"@hyperbeam/iframe","dist-tags":{"latest":"0.0.14","alpha":"0.0.8-alpha.1"},"versions":{"0.0.0":{"name":"@hyperbeam/iframe","version":"0.0.0","description":"iframe client library for the Hyperbeam multiplayer browser API","keywords":["hyperbeam","hyperbeam api","hyperbeam cobrowser","hyperbeam cobrowser api","hyperbeam cobrowsing","hyperbeam cobrowsing api","hyperbeam iframe","hyperbeam iframe api","hyperbeam browser","hyperbeam browser api","multiplayer browser","multiplayer browser api","shared browser","shared browser api","cobrowsing","cobrowsing api","cobrowser","cobrowser api"],"homepage":"https://hyperbeam.dev/","bugs":{"url":"https://hyperbeam.support/Get-in-touch-ad6c0bdc9d074923950a0df76ac516b0","email":"amby@hyperbeam.com"},"author":{"name":"Ambareesh Balaji","email":"amby@hyperbeam.com"},"contributors":[{"name":"Philip Scott","email":"scotty@hyperbeam.com"},{"name":"Declan Goncalves","email":"declan@hyperbeam.com"}],"module":"dist/index.js","types":"dist/index.d.ts","dependencies":{"@types/chrome":"^0.0.178"},"gitHead":"5179a322ad225fc5bb583cb87d3beb2c8366bef1","_id":"@hyperbeam/iframe@0.0.0","_nodeVersion":"16.13.2","_npmVersion":"8.5.0","dist":{"integrity":"sha512-erRm0WTzHK4ml2oUaO5q5pch6vm/m2FTOLbG51XEe6HvTpKBD2S01+VcRTLbYOUF2MhxJtkMDEUgdm+lLhFfKw==","shasum":"a5a984846e574e64231b4a2cac96ea888b675f01","tarball":"https://registry.npmjs.org/@hyperbeam/iframe/-/iframe-0.0.0.tgz","fileCount":4,"unpackedSize":26462,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiECmHACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpqhBAAlBFtRFnvMMkuxjJR2YhR8Io1FYr/0VkXU4OVNpsQoxBwxddl\r\niZYy37QwRLD3NdiVbgTnpDSQldx1rC0UkboAQZs7Td7/aEyRtZx5Ok5GH0gw\r\nNZTGsNHIXHHg7ooDeoPb7B/b4hKOYiVwEdpOmkDvjN2uAlY3czD1RrtzYyiO\r\nfbDnEFzOSa62nbbahsk8tKh7tLQvqaYuAYL/GpLZBJ1OzYd11o4E/1hZ5QwY\r\nAICkXmE2RLlrV3UrRrGQmTOWhI083eUh7ds0qBkUKZjD3qzn5R7TsfJ9yv3J\r\nq4Xlk2neozwam2L8lq6QmPtJXbpZkJtOO2t960dZkWJoOOr+o/txzhhOYsx4\r\nWbUHEzzdMTgyRTJ3K+lBtfnDL58JzatqOj9ASU2489xRKZnlk7C0TWTeBh+8\r\nq7zMW0mnF/0q9+KcA6j7BEFSEAd5Ijr1LpfFDY1Az6eYaBEWPm2SBi5Uxu68\r\nxfu8sAtuSvRxOOdnwIWL/a4LZacP7vDkGsWfZ3n8yawpmm7xA4z5OQ5nc4Gr\r\noBHih97BONaXO2Z3CxHqv+Wcbn4CCy7YOKip/FO4YJo4vRfFCXRZPdHbERJ9\r\n5wZuUwaV3Vd1sT9iX1tXqvBgvXLq8pL3zZipdoC4gyBkSMWqeil4mectDMiw\r\nJmAV7GLyw+xM2j1T8Dgrp4Wy4NX98dW72dM=\r\n=LpTq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH7RXEissOmjYWW+DGcwTJlEWTuX2qflGXTKdPYhziCvAiEA5FGC34CopvsaAqo66NQeS1eoXGEZLMiuRv8IjcgKIR0="}]},"_npmUser":{"name":"scottyfillups","email":"scotty@hyperbeam.com"},"directories":{},"maintainers":[{"name":"ambyjkl","email":"ambareeshbalaji@gmail.com"},{"name":"scottyfillups","email":"scotty@hyperbeam.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/iframe_0.0.0_1645226375803_0.0006048880417288682"},"_hasShrinkwrap":false,"deprecated":"please use https://www.npmjs.com/package/@hyperbeam/web instead"},"0.0.1":{"name":"@hyperbeam/iframe","version":"0.0.1","description":"iframe client library for the Hyperbeam multiplayer browser API","keywords":["hyperbeam","hyperbeam api","hyperbeam cobrowser","hyperbeam cobrowser api","hyperbeam cobrowsing","hyperbeam cobrowsing api","hyperbeam iframe","hyperbeam iframe api","hyperbeam browser","hyperbeam browser api","multiplayer browser","multiplayer browser api","shared browser","shared browser api","cobrowsing","cobrowsing api","cobrowser","cobrowser api"],"homepage":"https://hyperbeam.dev/","bugs":{"url":"https://hyperbeam.support/Get-in-touch-ad6c0bdc9d074923950a0df76ac516b0","email":"amby@hyperbeam.com"},"author":{"name":"Ambareesh Balaji","email":"amby@hyperbeam.com"},"contributors":[{"name":"Philip Scott","email":"scotty@hyperbeam.com"},{"name":"Declan Goncalves","email":"declan@hyperbeam.com"}],"module":"dist/index.js","types":"dist/index.d.ts","dependencies":{"@types/chrome":"^0.0.178"},"gitHead":"c9583fb19c3a07228ace909735db3b20df3442f6","_id":"@hyperbeam/iframe@0.0.1","_nodeVersion":"16.13.2","_npmVersion":"8.5.0","dist":{"integrity":"sha512-6YrwMJWq/8Ej3gxB1Qilexu3s10xkHsFsa+/fELNRcADFTrObBs+ujfJ+KN5vnxkS0Fb9Py+UUFUloIqGJAojA==","shasum":"b06769e85fbec42d9c48eb46ab08298eb80d50bf","tarball":"https://registry.npmjs.org/@hyperbeam/iframe/-/iframe-0.0.1.tgz","fileCount":4,"unpackedSize":26461,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiEDz5ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr0GQ/+Jq16WZ2B7WvmzXNy/8k24xCPx+K3nFS3z6idSUfLwL1iLnf0\r\n5bb7aoUV3dUk6JcI4HMzDUwsM480pQ73I1Nv406gGPxBkp6ZISuR0Mvle/ZB\r\nyQArjUow/aimXL/FEe7f14MveabNXmuoa+nlmbAt3LuyUDg5vDTkuQiJISPd\r\nfuE8WSm8tZavgEP1txQEVAEL0HShxgoaFU0P33meiahx/1Jy5sn9PbJ/ZKg8\r\nNOGVflGI+etlzHkXm27381OH+pKolM8aoSkm7+Het97oVfMMVsTTEErtK7Fr\r\nb4Ra5rgoDMKElb1jN/aBTfZ4fBrRdUVontU4hA/JCL/yEdma7HLbBi5PgmwI\r\nNSbStrzKZwn7xXyrNw9yNfVOYC6lYFCLQVmm4aRmD3oWflPlxxCbiUALlPBj\r\nWIeA3YX8zgWqPGEeOFB25f3qh2DVuZJOh5Y3ntzQSYDV8ZAK7+wsFrLxAyU7\r\ni2BGvIUarqlAFaVFQSZX+rqM0jYnTTC/55EH8PEeKRF3fhEb3QLsJgSXSzqK\r\nF+l2tmEqZIebYFpzCZ7rqVB73M1YDc3wk2s3f0eUpPmA471qVZBgJAosyAT5\r\n0Mokg95cZ3zZDy/kYpqAkhNjyFQJ0Xcm59Yng7qiKrV/qJiVW3H8b9nP4zvI\r\nNiaYx82WeebnzdLU2A1NBYPLdgunDWAIbeU=\r\n=O+ok\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAoRizLUzjPh9m8lC0EbToMNFzyNWn80MBxkspU25uPIAiEAn9D7qo5rNb6qhF9+w7viz7YNN4CP+v3J2AsWGf6049I="}]},"_npmUser":{"name":"scottyfillups","email":"scotty@hyperbeam.com"},"directories":{},"maintainers":[{"name":"ambyjkl","email":"ambareeshbalaji@gmail.com"},{"name":"scottyfillups","email":"scotty@hyperbeam.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/iframe_0.0.1_1645231353246_0.7017151138258042"},"_hasShrinkwrap":false,"deprecated":"please use https://www.npmjs.com/package/@hyperbeam/web instead"},"0.0.2":{"name":"@hyperbeam/iframe","version":"0.0.2","description":"iframe client library for the Hyperbeam multiplayer browser API","keywords":["hyperbeam","hyperbeam api","hyperbeam cobrowser","hyperbeam cobrowser api","hyperbeam cobrowsing","hyperbeam cobrowsing api","hyperbeam iframe","hyperbeam iframe api","hyperbeam browser","hyperbeam browser api","multiplayer browser","multiplayer browser api","shared browser","shared browser api","cobrowsing","cobrowsing api","cobrowser","cobrowser api"],"homepage":"https://hyperbeam.dev/","bugs":{"url":"https://hyperbeam.support/Get-in-touch-ad6c0bdc9d074923950a0df76ac516b0","email":"amby@hyperbeam.com"},"author":{"name":"Ambareesh Balaji","email":"amby@hyperbeam.com"},"contributors":[{"name":"Philip Scott","email":"scotty@hyperbeam.com"},{"name":"Declan Goncalves","email":"declan@hyperbeam.com"}],"module":"dist/index.js","types":"dist/index.d.ts","dependencies":{"@types/chrome":"^0.0.178"},"gitHead":"52415394bfcc2fdcb10d45b9ea3549e16bfd20d0","_id":"@hyperbeam/iframe@0.0.2","_nodeVersion":"16.13.2","_npmVersion":"8.5.0","dist":{"integrity":"sha512-vCwyRj19V87pvXCzvsvNhXyjf69bvr/kvIonWgb1Qnks1cUPpI25tUvHrwsu25oO4m6TyBHb10jod3M9XYNbeg==","shasum":"1d4f3db22143e86e1ac9c191f881d674e1b5180a","tarball":"https://registry.npmjs.org/@hyperbeam/iframe/-/iframe-0.0.2.tgz","fileCount":4,"unpackedSize":27022,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiEZ9BACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq3aA//ZhB+KSZAjmRNN+41qpjakqJKC+Ko56wTZP/eLMxhOVSSB036\r\nzBYiAhsJWnH4IKKUI20pVmb9fJ3HCp38JIVo6Q+5weAQjCfytNBS7/V/SULk\r\nsuf8g39X2FFKpf7MPmqi0cY1ztfB2uRcLwl7Es5JGIkY3orpoOO7L5e4crDn\r\nLpcpQyN7HBU5n2CpcOksHeFfIx77YwBRdc6hWT/9t1zEQcndOWq1BjFNYt9w\r\nsDkrTYBhC+B6ynvrx95PxN6bYZ4taGhPZwtvDjB/IRSu2hzz5QDckKdE+9CS\r\nfuhhjP5m4E6oLI9V6sYBuad4vQfpjxuVGnbzsSwGUVADOCxUQBEYiKJrX0rN\r\n/0Bo2JVNmbMKYBTcS6+Lf1se5rmMKl/y9RlIWjtSneahs7SWUBUe1lhyJwZm\r\ng+ajN3nByg9YeILgyjTXM52ucBnvy4WvPLGKBIHuitep1HVggWJvwxn8EV0a\r\nPvXf6cBPwLKAn5yWok0N32282O68OR7KF++PJQHsn9umdZ6FKRM6sYUABKEH\r\nFjSB7/2gK0a3PDXXVWPLcnOEQ/7rfkE90f2/blX0TK5tmd9CHgH7It5irm00\r\nad0+4Fk6CQB/XbVcqkFTYgPhAvrYpH4AxY0an/NohqLMv4e/gQfEs/m1O3yC\r\n/svHg0ZZgWBWwyL4IAcumdUREIKeTc3nJtw=\r\n=viFz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGPX8YDDJCxq1pl7U4fbiIzEqIOUsJKZ7n2oNJ5voluyAiAwfoebf3UZidSvE7uJlPxe4UEDk3h1ZUXyKCIsIM16Jg=="}]},"_npmUser":{"name":"scottyfillups","email":"scotty@hyperbeam.com"},"directories":{},"maintainers":[{"name":"ambyjkl","email":"ambareeshbalaji@gmail.com"},{"name":"scottyfillups","email":"scotty@hyperbeam.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/iframe_0.0.2_1645322049129_0.3404580327214326"},"_hasShrinkwrap":false,"deprecated":"please use https://www.npmjs.com/package/@hyperbeam/web instead"},"0.0.3":{"name":"@hyperbeam/iframe","version":"0.0.3","description":"iframe client library for the Hyperbeam multiplayer browser API","keywords":["hyperbeam","hyperbeam api","hyperbeam cobrowser","hyperbeam cobrowser api","hyperbeam cobrowsing","hyperbeam cobrowsing api","hyperbeam iframe","hyperbeam iframe api","hyperbeam browser","hyperbeam browser api","multiplayer browser","multiplayer browser api","shared browser","shared browser api","cobrowsing","cobrowsing api","cobrowser","cobrowser api"],"homepage":"https://hyperbeam.dev/","bugs":{"url":"https://hyperbeam.support/Get-in-touch-ad6c0bdc9d074923950a0df76ac516b0","email":"amby@hyperbeam.com"},"author":{"name":"Ambareesh Balaji","email":"amby@hyperbeam.com"},"contributors":[{"name":"Philip Scott","email":"scotty@hyperbeam.com"},{"name":"Declan Goncalves","email":"declan@hyperbeam.com"}],"module":"dist/index.js","types":"dist/index.d.ts","dependencies":{"@types/chrome":"^0.0.178"},"gitHead":"52415394bfcc2fdcb10d45b9ea3549e16bfd20d0","_id":"@hyperbeam/iframe@0.0.3","_nodeVersion":"16.13.2","_npmVersion":"8.5.0","dist":{"integrity":"sha512-wdbYn+pi1cHLHZwk7ex8SDQQOBLqKNC36D4Wb2+JVHPWIVVQZSjCH1GYiNnTyWFYIankutJ9v+ncODyAlGa9AA==","shasum":"e555f3951480ae2c0fbcbf829c909ff7e2e5f960","tarball":"https://registry.npmjs.org/@hyperbeam/iframe/-/iframe-0.0.3.tgz","fileCount":4,"unpackedSize":27125,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiEaVhACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpjiQ/9EKNpLoki2AeyqowBpLgEbpcXWITlJAWzHdSP1gqvQfYl7Wps\r\naMHt6cEm4CXe3btCNZa0BZhML9gpP9neR1zSaeZuKl2XWbrrshH/TeFUM/CN\r\nz0nis7GN4MM/kE6KlV++OuBWCNqR7r6ne61wX0LXfeA/kEkrXfflq9Uo8PiB\r\nxM/pQ1doaw28t5z9U1bXDeW/kj61/Eg6MjsTwJmOTsdYTrEORqF/SaKOO4xE\r\ngPUSyWG0gGjvGUHn4+C/z0PRUHKAYiCGMl4OFQYFE9x6TqFcSpmImZWM01xb\r\nuJroUH2ec8JtbVgR8KulGKEZGRNwoQ8dWRBGwQvXIi16FnRTO5MFMkyRkTOt\r\nSHLKkUg56Bw/+VANCvKvhzjRcUe7ZVccl6Klgfa7BjM0IuM8y0QEC2niNSHo\r\nRe7TEjEDWRp0udF4wrsFf3jt71EfIfwyB5dXFoaMhp3IHBbu9X/yhh+oqJDS\r\nvFZ88PxRZUV+dAfF6oetv/LhgFWh8PMQWwZmlDDIM6ciHs/lRJhTNJUwtIgv\r\nHSgQmxx8Etd6xFOZu/+TA6zb1Ipi33Dfps17sKfGYulYU1AKaqPjijmL6v2t\r\nTXFFdjYe6Gow6N7eAtmk6+f6l5y0x6QNdjOlAFw4/7KGLAftwMvYLyjjFbC5\r\nYzFv7/A3RMlBxEQkmjT9B27jqX1bCtpgdCQ=\r\n=hp4e\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE4Ik6cbILJTvum/9tXTfGJ4Ao/nkUwUS54ayeYajltqAiAe36Kv7LSo2uBYdBtox6gejTcrE4fI76O9D/ja8/qsIg=="}]},"_npmUser":{"name":"scottyfillups","email":"scotty@hyperbeam.com"},"directories":{},"maintainers":[{"name":"ambyjkl","email":"ambareeshbalaji@gmail.com"},{"name":"scottyfillups","email":"scotty@hyperbeam.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/iframe_0.0.3_1645323617841_0.05672839996274548"},"_hasShrinkwrap":false,"deprecated":"please use https://www.npmjs.com/package/@hyperbeam/web instead"},"0.0.4":{"name":"@hyperbeam/iframe","version":"0.0.4","description":"iframe client library for the Hyperbeam multiplayer browser API","keywords":["hyperbeam","hyperbeam api","hyperbeam cobrowser","hyperbeam cobrowser api","hyperbeam cobrowsing","hyperbeam cobrowsing api","hyperbeam iframe","hyperbeam iframe api","hyperbeam browser","hyperbeam browser api","multiplayer browser","multiplayer browser api","shared browser","shared browser api","cobrowsing","cobrowsing api","cobrowser","cobrowser api"],"homepage":"https://hyperbeam.dev/","bugs":{"url":"https://hyperbeam.support/Get-in-touch-ad6c0bdc9d074923950a0df76ac516b0","email":"amby@hyperbeam.com"},"author":{"name":"Ambareesh Balaji","email":"amby@hyperbeam.com"},"contributors":[{"name":"Philip Scott","email":"scotty@hyperbeam.com"},{"name":"Declan Goncalves","email":"declan@hyperbeam.com"}],"module":"dist/index.js","types":"dist/index.d.ts","dependencies":{"@types/chrome":"^0.0.178"},"gitHead":"d6fe79247921959ea9e42506fef733c8a4eeab11","_id":"@hyperbeam/iframe@0.0.4","_nodeVersion":"16.13.2","_npmVersion":"8.5.0","dist":{"integrity":"sha512-Etv7nupiLLfLFLkKWISG9Ilk3rOcngSe2s+wiYnd+Ayf0uj/bdUkNgcK/bbSqqh1jhKa1rKkj74IH2hPsd0Utg==","shasum":"91847549a61c6e668fc160e16f760e2987b57872","tarball":"https://registry.npmjs.org/@hyperbeam/iframe/-/iframe-0.0.4.tgz","fileCount":4,"unpackedSize":27197,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiEa+JACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpkWQ//b/+Dtd7rqrNZfiKO7Y766H3DYxwaRUTtJhgTHrUJC4w0HLqC\r\n9Y69WHVmImCWH3K5uji2Gft4vI0fhjH4p81maQbLb08CWTS9u0LResGeEs/B\r\nSQARqeSBj0UkVqncEakrOKVpczR3npagMa670IyG1IfL1kvDCqTc93BymRQ2\r\ntNt2cqLFxEc5L2XMnyPBLrtr1zt8fMno4aSBo/MdeegMb7MM7VtsWDI7prar\r\ngSaoAYNZ3tRLNVLwZA8qOWqMVAnOdVPbUdTDohQ9lJ6ulqqM88as9uTAe1Kb\r\nLRqfHZLrVbUG7r1rk9+RVsyWxI7W6++levjcAXrNTVPiJxw2aJchMpovnV4e\r\nRMUyMVOuC/a6nK6xlO+5U8KZ54x8+vqsOZ8stB7Q2ofyfoKVvhLJtz0oKUHy\r\nmfOc6aYBvDInWyvakyEcf8T4AHvEdKsEYwotWk5Dff2MZiTJ5HvcLGRMfnQA\r\nEViw73AjAAzg0wCustq899kE6lIqVhCZT6HURceLLUk21aTDJClZQG2sXw+5\r\nwmi2ZRcL1bsi9LY5uhgRzWbkkWAblPZHN040Ds7lWQDgEl7xH6BqoqFdleAk\r\n7O/mIwCK2N8T0RfmaOdreqWtlM9I/5frnmx7RSt6sMF62En78z6Won9sjzEb\r\nmrThgotKngQtI06xjACqd5ogmOu1S1v89E4=\r\n=uf6O\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCTYK5RP2ts131+w+iDARvAeN2Qe5Kq9CVpm9OiFF19KgIgPtQxTJofW4vnkNNrc/H9m5U3h6v8UHOt5tNCwuT71Vs="}]},"_npmUser":{"name":"scottyfillups","email":"scotty@hyperbeam.com"},"directories":{},"maintainers":[{"name":"ambyjkl","email":"ambareeshbalaji@gmail.com"},{"name":"scottyfillups","email":"scotty@hyperbeam.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/iframe_0.0.4_1645326217795_0.6262667919912808"},"_hasShrinkwrap":false,"deprecated":"please use https://www.npmjs.com/package/@hyperbeam/web instead"},"0.0.5-beta.0":{"name":"@hyperbeam/iframe","version":"0.0.5-beta.0","description":"iframe client library for the Hyperbeam multiplayer browser API","keywords":["hyperbeam","hyperbeam api","hyperbeam cobrowser","hyperbeam cobrowser api","hyperbeam cobrowsing","hyperbeam cobrowsing api","hyperbeam iframe","hyperbeam iframe api","hyperbeam browser","hyperbeam browser api","multiplayer browser","multiplayer browser api","shared browser","shared browser api","cobrowsing","cobrowsing api","cobrowser","cobrowser api"],"homepage":"https://hyperbeam.dev/","bugs":{"url":"https://hyperbeam.support/Get-in-touch-ad6c0bdc9d074923950a0df76ac516b0","email":"amby@hyperbeam.com"},"author":{"name":"Ambareesh Balaji","email":"amby@hyperbeam.com"},"contributors":[{"name":"Philip Scott","email":"scotty@hyperbeam.com"},{"name":"Declan Goncalves","email":"declan@hyperbeam.com"}],"module":"dist/index.js","types":"dist/index.d.ts","dependencies":{"@types/chrome":"^0.0.178"},"readme":"# @hyperbeam/iframe\n\niframe client library for the Hyperbeam multiplayer browser API.\n\nUnfamiliar with the Hyperbeam API? Read the full documentation <a href=\"https://hyperbeam.support/API-Design-eb9874bd1ef54c22ba7197324ce22231\" target=\"_blank\">here</a>.\n\n## Table of Contents\n\n- [Features](#features)\n- [Installation](#installation)\n- [Example](#example)\n- [API](#api)\n  - [Loading multiplayer browser](#loading-multiplayer-browser)\n  - [Setting video volume](#setting-video-volume)\n  - [Getting user ID](#getting-user-id)\n  - [Setting admin token](#setting-admin-token)\n  - [Setting permissions](#setting-permissions)\n  - [Control tabs programmatically](#control-tabs-programmatically)\n  - [Listen to tab events](#listen-to-tab-events)\n\n## Features\n\n- Connect to a multiplayer browser\n- Control browser navigation programmatically\n- Query browser state and listen to events\n- Manage user control permissions\n- Set local multiplayer browser volume\n\n## Installation\n\nUsing npm:\n\n```bash\n$ npm install @hyperbeam/iframe --save\n```\n\nUsing unpkg:\n\n```html\n<script type=\"module\">\n  import Hyperbeam from \"https://unpkg.com/@hyperbeam/iframe@0.0.4/dist/index.js\"\n  // ...\n</script>\n```\n\n## Example\n\nYou can save this code snippet as `example.html` and run it in your browser. Make sure you set the embed URL variable to the response data from the [REST API](https://hyperbeam.support/Hyperbeam-API-eb9874bd1ef54c22ba7197324ce22231#d326c958e95244b89cf7ffdbcb07e9bd).\n\n```html\n<div style=\"font-family: Arial\">\n  <button id=\"reload\">Reload</button>\n  <button id=\"back\">Go Back</button>\n  <button id=\"forward\">Go Forward</button>\n  <button id=\"youtube\">Open Youtube.com</button>\n  Volume: <input type=\"range\" min=\"0\" max=\"100\" value=\"100\" id=\"range\">\n  <p>User ID: <span id=\"userId\"></span></p>\n  <p>Current website: <span id=\"currentSite\"></p>\n</div>\n<iframe id=\"iframe\" style=\"height:720px;width:1280px\"></iframe>\n<script type=\"module\">\n  import Hyperbeam from \"https://unpkg.com/@hyperbeam/iframe@0.0.4/dist/index.js\"\n  // TODO: Set the embedURL variable\n  const embedURL = \"<your-embed-url>\"\n  const hb = await Hyperbeam(iframe, embedURL)\n  userId.innerText = hb.userId\n  reload.addEventListener(\"click\", () => {\n    hb.tabs.reload()\n  })\n  back.addEventListener(\"click\", () => {\n    hb.tabs.goBack()\n  })\n  forward.addEventListener(\"click\", () => {\n    hb.tabs.goForward()\n  })\n  youtube.addEventListener(\"click\", () => {\n    hb.tabs.update({ url: \"https://youtube.com\" })\n  })\n  range.addEventListener(\"change\", (e) => {\n    hb.volume = e.target.value / 100\n  })\n  hb.tabs.onUpdated.addListener((tabId, changeInfo) => {\n    if (changeInfo.title) {\n      currentSite.innerText = changeInfo.title\n    }\n  })\n</script>\n```\n\n## API Reference\n\n### Loading multiplayer browser\n\n**Hyperbeam(iframe: IFrame, embedURL: string, opts?: HyperbeamOptions): Promise\\<HyperbeamClient\\>**\n\nCreates a new Hyperbeam IFrame client.\n\n```js\n// The embedURL is retrieved from the REST API\n// Documentation for the REST API can be found here:\n// hyperbeam.support/API-Design-eb9874bd1ef54c22ba7197324ce22231\nconst embedURL = \"https://abc.hyperbeam.com/foo?token=bar\"\nconst iframe = document.getElementById(\"iframe-id\")\n\nconst hb = await Hyperbeam(iframe, embedURL, {\n  // Number of milliseconds until the request to the multiplayer browser times out.\n  // If the request times out, the returned promise will be rejected.\n  timeout: 5000, // default = 2000\n\n  // An admin token returned from the REST API that will grant this user\n  // access to managing user permissions and programmatic navigation.\n  admin_token: \"admin_token_from_rest_api_response\",\n\n  // Starting volume of the multiplayer browser\n  volume: 0.2    // default = 1.0\n})\n```\n\n### Setting video volume\n\n**hb.volume = 0.5**\n\nSets the volume for the multiplayer browser *locally*. Volume changes only apply to the local user. This setting is *not* persisted on refreshing the page.\n\n```js\nconst hb = await Hyperbeam(iframe, embedURL)\n// Valid values range from 0.0 to 1.0\nhb.volume = 0.5 // default = 1.0\n```\n\n### Getting user ID\n\n**hb.userId: string**\n\nGets the client's user ID. A \"user\" is defined as a single connection to the multiplayer browser. If a person has multiple tabs connected to the multiplayer browser, each tab with an active connection will be assigned a different user ID.\n\n```js\nconst hb = await Hyperbeam(iframe, embedURL)\nconsole.log(hb.userId) // A unique string identifying the user\n```\n\n### Setting admin token\n\n**hb.admin_token = \"admin_token\"**\n\nSets the client's admin token. The client must have an admin token set to manage user permissions and control the tabs programmatically.\n\n```js\n// You can provide the admin token during initialization\nconst hb = await Hyperbeam(iframe, embedURL, {\n  admin_token: \"admin_token_from_rest_api_response\"\n})\n\n// In some situations, you may want to promote the user to\n// an admin after initialization. For example, promoting a \"user\" to a \"moderator\".\nconst hb = await Hyperbeam(iframe, embedURL)\nhb.admin_token = \"admin_token_from_rest_api_response\"\n```\n\n### Setting permissions\n\n**hb.setPermission(userId: string, permissionData: PremissionData): Promise\\<void\\>**\n\nSets the permission of a user by their ID. The client must have an admin token set to manage user permissions.\n\n```js\n// You can provide the admin token during initialization\nconst hb = await Hyperbeam(iframe, embedURL, {\n  admin_token: \"admin_token_from_rest_api_response\"\n})\n\nconst targetUserId = \"a_user_id\"\n\n// All keys can be omitted: if the key is omitted, then the existing value will be unchanged\nconst permissions = {\n  // Higher value = higher priority\n  // Users with a higher priority will preempt the control of lower priority users.\n  priority: 2,           // default = 0\n\n  // Number of milliseconds until a user is considered \"idle\". Once a user is considered\n  // idle, they no longer preempt lower priority users until they interact with the\n  // multiplayer browser again.\n  idle_timeout: 3000,    // default = 0\n\n  // If control_disabled = true, all control input (mouse movements, keyboard presses)\n  // will be ignored. Note that disabling control does not restrict access to any\n  // APIs that require admin tokens.\n  control_disabled: true // default = control_disable_default (see REST API)\n}\n\nhb.setPermissions(targetUserId, permissions)\n```\n\n### Control tabs programmatically\n\nHyperbeam's tab API mirrors Chrome extension tab API, found <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method\" target=\"_blank\">here</a>.\n\nRather than calling `chrome.tabs.create({ active: true })`, you will would call `hb.tabs.create({ active: true })`.\n\nWe support the following methods:\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-create\" target=\"_blank\">tabs.create</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-detectLanguage\" target=\"_blank\">tabs.detectLanguage</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-discard\" target=\"_blank\">tabs.discard</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-duplicate\" target=\"_blank\">tabs.duplicate</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-get\" target=\"_blank\">tabs.get</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-getZoom\" target=\"_blank\">tabs.getZoom</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-getZoomSettings\" target=\"_blank\">tabs.getZoomSettings</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-goBack\" target=\"_blank\">tabs.goBack</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-goForward\" target=\"_blank\">tabs.goForward</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-group\" target=\"_blank\">tabs.group</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-highlight\" target=\"_blank\">tabs.highlight</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-move\" target=\"_blank\">tabs.move</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-query\" target=\"_blank\">tabs.query</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-reload\" target=\"_blank\">tabs.reload</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-remove\" target=\"_blank\">tabs.remove</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-setZoom\" target=\"_blank\">tabs.setZoom</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-setZoomSettings\" target=\"_blank\">tabs.setZoomSettings</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-ungroup\" target=\"_blank\">tabs.ungroup</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-update\" target=\"_blank\">tabs.update</a>\n\n```js\nconst hb = await Hyperbeam(iframe, embedURL)\n\n// Create a tab\nconst tab = await hb.tabs.create({ active: true })\n\n// Duplicate a tab\nconst tab2 = await hb.tabs.duplicate(tab.id)\n\n// Set the URL of the active tab\nconst updatedTab = await hb.tabs.update({url: \"https://hyperbeam.dev/\"})\n```\n\n### Listen to tab events\n\nHyperbeam's tab event listener API mirrors Chrome extension tab API, found <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event\" target=\"_blank\">here</a>.\n\nRather than calling `chrome.tabs.onCreated.addListener((tab) => {})`, you will would call `hb.tabs.onCreated.addListener((tab) => {})`.\n\nWe support the following events:\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onActivated\" target=\"_blank\">tabs.onActivated</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onCreated\" target=\"_blank\">tabs.onCreated</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onHighlighted\" target=\"_blank\">tabs.onHighlighted</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onMoved\" target=\"_blank\">tabs.onMoved</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onRemoved\" target=\"_blank\">tabs.onRemoved</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onReplaced\" target=\"_blank\">tabs.onReplaced</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onUpdated\" target=\"_blank\">tabs.onUpdated</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onZoomChange\" target=\"_blank\">tabs.onZoomChange</a>\n\n```js\nconst hb = await Hyperbeam(iframe, embedURL)\n\nfunction onTabCreated(tab) {\n  console.log(tab.id)\n}\n\n// Listen for when a new tab is created\nhb.tabs.onCreated.addListener(onTabCreated)\n\n// Create a new tab\nawait hb.tabs.create({ active: true })\n\n// Remove the event listener\nhb.tabs.onCreated.removeListener(onTabCreated)\n```\n","readmeFilename":"README.md","gitHead":"cb465df2a80c63533c8645fcfdafa4c4acc07024","_id":"@hyperbeam/iframe@0.0.5-beta.0","_nodeVersion":"16.13.2","_npmVersion":"8.5.3","dist":{"integrity":"sha512-QRTBE8Rm4OrJ0rbSOlWLvPSxS/VGDd/MApv3YuK93ttUIyLCKZxn8oEMV9EFX1PMadFhd8+AtHvYCOoqYBTQTA==","shasum":"debc18e1a518a87d927f9c0cd17d18f5a2ac0b8a","tarball":"https://registry.npmjs.org/@hyperbeam/iframe/-/iframe-0.0.5-beta.0.tgz","fileCount":4,"unpackedSize":27363,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiK/6LACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrROw//TE0rxRRLgy5Bg+NRk0SBqC57eQl4GPETf2DkZWL9r66Ngl8o\r\n7/8Kbhmhsd7IcN+zsnbEtzVXXg3BqyNbgZ9fBejUu4j20ZkIqP77puWNbGOZ\r\nHzQMMA6smuGxWau3j1KwkBH+N4lxtC2u/OAecCmYyEM2ay5bpvvcqpu88DLP\r\nqCjFy/QVwv2PzuLWcib+dsP6w/Fbq6E8ZBw2omhi0Ctrdjx7Hn3iLEmppdvo\r\ndjDqqp3oN/n7CJAUb4/LsjAKs+aF4beTeUkXQqbopBym2PwO0W5CL3WuvzA0\r\nTR1SMaoOD0aIM05h8B8U/SbmvBo9KxV1W853x0DWJ5cj1CwOPaI755mKjCKL\r\nXmZdIbj65vqVzsv9x8kDEI/B+bWFwlK+nDFow5Vk5O4/J/mKtYiPxfmFuRUp\r\nsC1FoMcErHKGqD9NUz5fP7G+mI8+41oxve4kitSoAQgG9kSWpVpiEhVlkLVx\r\nOXoA/pozg7R4SUDQULx1ijLAas51DyU6zDO6quuRdD1ml03mGeVn9hTS0YFM\r\nvQbKAGpvsh66gATRdQvzRS0hAy5FUV6HVsM2qAcx2xuvxNzlzJ5l3ON2iINJ\r\nW5vhvXcvIIX5g11O0SiYWq5r6KmCKOnBZkzafREoEZrWLuIvTY88jKeZ8VsQ\r\nx93SABWglh/aYIeWk7KHYMg19Pqq51xQFaI=\r\n=GOIx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICWEFOI0qgmB80Z3ICCX9K570V0elxBjeJfxFkj3zIDyAiEAtWKPFP/ShGqhKXuN0AFlwWYf2pe0NQ+SKVQYC8dlzTQ="}]},"_npmUser":{"name":"ambyjkl","email":"ambareeshbalaji@gmail.com"},"directories":{},"maintainers":[{"name":"ambyjkl","email":"ambareeshbalaji@gmail.com"},{"name":"scottyfillups","email":"scotty@hyperbeam.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/iframe_0.0.5-beta.0_1647050379425_0.6777653117997329"},"_hasShrinkwrap":false,"deprecated":"please use https://www.npmjs.com/package/@hyperbeam/web instead"},"0.0.5-beta.1":{"name":"@hyperbeam/iframe","version":"0.0.5-beta.1","description":"iframe client library for the Hyperbeam multiplayer browser API","keywords":["hyperbeam","hyperbeam api","hyperbeam cobrowser","hyperbeam cobrowser api","hyperbeam cobrowsing","hyperbeam cobrowsing api","hyperbeam iframe","hyperbeam iframe api","hyperbeam browser","hyperbeam browser api","multiplayer browser","multiplayer browser api","shared browser","shared browser api","cobrowsing","cobrowsing api","cobrowser","cobrowser api"],"homepage":"https://hyperbeam.dev/","bugs":{"url":"https://hyperbeam.support/Get-in-touch-ad6c0bdc9d074923950a0df76ac516b0","email":"amby@hyperbeam.com"},"author":{"name":"Ambareesh Balaji","email":"amby@hyperbeam.com"},"contributors":[{"name":"Philip Scott","email":"scotty@hyperbeam.com"},{"name":"Declan Goncalves","email":"declan@hyperbeam.com"}],"module":"dist/index.js","types":"dist/index.d.ts","dependencies":{"@types/chrome":"^0.0.178"},"readme":"# @hyperbeam/iframe\n\niframe client library for the Hyperbeam multiplayer browser API.\n\nUnfamiliar with the Hyperbeam API? Read the full documentation <a href=\"https://hyperbeam.support/API-Design-eb9874bd1ef54c22ba7197324ce22231\" target=\"_blank\">here</a>.\n\n## Table of Contents\n\n- [Features](#features)\n- [Installation](#installation)\n- [Example](#example)\n- [API](#api)\n  - [Loading multiplayer browser](#loading-multiplayer-browser)\n  - [Setting video volume](#setting-video-volume)\n  - [Getting user ID](#getting-user-id)\n  - [Setting admin token](#setting-admin-token)\n  - [Setting permissions](#setting-permissions)\n  - [Control tabs programmatically](#control-tabs-programmatically)\n  - [Listen to tab events](#listen-to-tab-events)\n\n## Features\n\n- Connect to a multiplayer browser\n- Control browser navigation programmatically\n- Query browser state and listen to events\n- Manage user control permissions\n- Set local multiplayer browser volume\n\n## Installation\n\nUsing npm:\n\n```bash\n$ npm install @hyperbeam/iframe --save\n```\n\nUsing unpkg:\n\n```html\n<script type=\"module\">\n  import Hyperbeam from \"https://unpkg.com/@hyperbeam/iframe@0.0.4/dist/index.js\"\n  // ...\n</script>\n```\n\n## Example\n\nYou can save this code snippet as `example.html` and run it in your browser. Make sure you set the embed URL variable to the response data from the [REST API](https://hyperbeam.support/Hyperbeam-API-eb9874bd1ef54c22ba7197324ce22231#d326c958e95244b89cf7ffdbcb07e9bd).\n\n```html\n<div style=\"font-family: Arial\">\n  <button id=\"reload\">Reload</button>\n  <button id=\"back\">Go Back</button>\n  <button id=\"forward\">Go Forward</button>\n  <button id=\"youtube\">Open Youtube.com</button>\n  Volume: <input type=\"range\" min=\"0\" max=\"100\" value=\"100\" id=\"range\">\n  <p>User ID: <span id=\"userId\"></span></p>\n  <p>Current website: <span id=\"currentSite\"></p>\n</div>\n<iframe id=\"iframe\" style=\"height:720px;width:1280px\"></iframe>\n<script type=\"module\">\n  import Hyperbeam from \"https://unpkg.com/@hyperbeam/iframe@0.0.4/dist/index.js\"\n  // TODO: Set the embedURL variable\n  const embedURL = \"<your-embed-url>\"\n  const hb = await Hyperbeam(iframe, embedURL)\n  userId.innerText = hb.userId\n  reload.addEventListener(\"click\", () => {\n    hb.tabs.reload()\n  })\n  back.addEventListener(\"click\", () => {\n    hb.tabs.goBack()\n  })\n  forward.addEventListener(\"click\", () => {\n    hb.tabs.goForward()\n  })\n  youtube.addEventListener(\"click\", () => {\n    hb.tabs.update({ url: \"https://youtube.com\" })\n  })\n  range.addEventListener(\"change\", (e) => {\n    hb.volume = e.target.value / 100\n  })\n  hb.tabs.onUpdated.addListener((tabId, changeInfo) => {\n    if (changeInfo.title) {\n      currentSite.innerText = changeInfo.title\n    }\n  })\n</script>\n```\n\n## API Reference\n\n### Loading multiplayer browser\n\n**Hyperbeam(iframe: IFrame, embedURL: string, opts?: HyperbeamOptions): Promise\\<HyperbeamClient\\>**\n\nCreates a new Hyperbeam IFrame client.\n\n```js\n// The embedURL is retrieved from the REST API\n// Documentation for the REST API can be found here:\n// hyperbeam.support/API-Design-eb9874bd1ef54c22ba7197324ce22231\nconst embedURL = \"https://abc.hyperbeam.com/foo?token=bar\"\nconst iframe = document.getElementById(\"iframe-id\")\n\nconst hb = await Hyperbeam(iframe, embedURL, {\n  // Number of milliseconds until the request to the multiplayer browser times out.\n  // If the request times out, the returned promise will be rejected.\n  timeout: 5000, // default = 2000\n\n  // An admin token returned from the REST API that will grant this user\n  // access to managing user permissions and programmatic navigation.\n  admin_token: \"admin_token_from_rest_api_response\",\n\n  // Starting volume of the multiplayer browser\n  volume: 0.2    // default = 1.0\n})\n```\n\n### Setting video volume\n\n**hb.volume = 0.5**\n\nSets the volume for the multiplayer browser *locally*. Volume changes only apply to the local user. This setting is *not* persisted on refreshing the page.\n\n```js\nconst hb = await Hyperbeam(iframe, embedURL)\n// Valid values range from 0.0 to 1.0\nhb.volume = 0.5 // default = 1.0\n```\n\n### Getting user ID\n\n**hb.userId: string**\n\nGets the client's user ID. A \"user\" is defined as a single connection to the multiplayer browser. If a person has multiple tabs connected to the multiplayer browser, each tab with an active connection will be assigned a different user ID.\n\n```js\nconst hb = await Hyperbeam(iframe, embedURL)\nconsole.log(hb.userId) // A unique string identifying the user\n```\n\n### Setting admin token\n\n**hb.admin_token = \"admin_token\"**\n\nSets the client's admin token. The client must have an admin token set to manage user permissions and control the tabs programmatically.\n\n```js\n// You can provide the admin token during initialization\nconst hb = await Hyperbeam(iframe, embedURL, {\n  admin_token: \"admin_token_from_rest_api_response\"\n})\n\n// In some situations, you may want to promote the user to\n// an admin after initialization. For example, promoting a \"user\" to a \"moderator\".\nconst hb = await Hyperbeam(iframe, embedURL)\nhb.admin_token = \"admin_token_from_rest_api_response\"\n```\n\n### Setting permissions\n\n**hb.setPermission(userId: string, permissionData: PremissionData): Promise\\<void\\>**\n\nSets the permission of a user by their ID. The client must have an admin token set to manage user permissions.\n\n```js\n// You can provide the admin token during initialization\nconst hb = await Hyperbeam(iframe, embedURL, {\n  admin_token: \"admin_token_from_rest_api_response\"\n})\n\nconst targetUserId = \"a_user_id\"\n\n// All keys can be omitted: if the key is omitted, then the existing value will be unchanged\nconst permissions = {\n  // Higher value = higher priority\n  // Users with a higher priority will preempt the control of lower priority users.\n  priority: 2,           // default = 0\n\n  // Number of milliseconds until a user is considered \"idle\". Once a user is considered\n  // idle, they no longer preempt lower priority users until they interact with the\n  // multiplayer browser again.\n  idle_timeout: 3000,    // default = 0\n\n  // If control_disabled = true, all control input (mouse movements, keyboard presses)\n  // will be ignored. Note that disabling control does not restrict access to any\n  // APIs that require admin tokens.\n  control_disabled: true // default = control_disable_default (see REST API)\n}\n\nhb.setPermissions(targetUserId, permissions)\n```\n\n### Control tabs programmatically\n\nHyperbeam's tab API mirrors Chrome extension tab API, found <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method\" target=\"_blank\">here</a>.\n\nRather than calling `chrome.tabs.create({ active: true })`, you will would call `hb.tabs.create({ active: true })`.\n\nWe support the following methods:\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-create\" target=\"_blank\">tabs.create</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-detectLanguage\" target=\"_blank\">tabs.detectLanguage</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-discard\" target=\"_blank\">tabs.discard</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-duplicate\" target=\"_blank\">tabs.duplicate</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-get\" target=\"_blank\">tabs.get</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-getZoom\" target=\"_blank\">tabs.getZoom</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-getZoomSettings\" target=\"_blank\">tabs.getZoomSettings</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-goBack\" target=\"_blank\">tabs.goBack</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-goForward\" target=\"_blank\">tabs.goForward</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-group\" target=\"_blank\">tabs.group</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-highlight\" target=\"_blank\">tabs.highlight</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-move\" target=\"_blank\">tabs.move</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-query\" target=\"_blank\">tabs.query</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-reload\" target=\"_blank\">tabs.reload</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-remove\" target=\"_blank\">tabs.remove</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-setZoom\" target=\"_blank\">tabs.setZoom</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-setZoomSettings\" target=\"_blank\">tabs.setZoomSettings</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-ungroup\" target=\"_blank\">tabs.ungroup</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-update\" target=\"_blank\">tabs.update</a>\n\n```js\nconst hb = await Hyperbeam(iframe, embedURL)\n\n// Create a tab\nconst tab = await hb.tabs.create({ active: true })\n\n// Duplicate a tab\nconst tab2 = await hb.tabs.duplicate(tab.id)\n\n// Set the URL of the active tab\nconst updatedTab = await hb.tabs.update({url: \"https://hyperbeam.dev/\"})\n```\n\n### Listen to tab events\n\nHyperbeam's tab event listener API mirrors Chrome extension tab API, found <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event\" target=\"_blank\">here</a>.\n\nRather than calling `chrome.tabs.onCreated.addListener((tab) => {})`, you will would call `hb.tabs.onCreated.addListener((tab) => {})`.\n\nWe support the following events:\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onActivated\" target=\"_blank\">tabs.onActivated</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onCreated\" target=\"_blank\">tabs.onCreated</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onHighlighted\" target=\"_blank\">tabs.onHighlighted</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onMoved\" target=\"_blank\">tabs.onMoved</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onRemoved\" target=\"_blank\">tabs.onRemoved</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onReplaced\" target=\"_blank\">tabs.onReplaced</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onUpdated\" target=\"_blank\">tabs.onUpdated</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onZoomChange\" target=\"_blank\">tabs.onZoomChange</a>\n\n```js\nconst hb = await Hyperbeam(iframe, embedURL)\n\nfunction onTabCreated(tab) {\n  console.log(tab.id)\n}\n\n// Listen for when a new tab is created\nhb.tabs.onCreated.addListener(onTabCreated)\n\n// Create a new tab\nawait hb.tabs.create({ active: true })\n\n// Remove the event listener\nhb.tabs.onCreated.removeListener(onTabCreated)\n```\n","readmeFilename":"README.md","gitHead":"a42c6dfddae14081b1da204c2d4fd90cba6b23f0","_id":"@hyperbeam/iframe@0.0.5-beta.1","_nodeVersion":"16.13.2","_npmVersion":"8.5.3","dist":{"integrity":"sha512-TThHOj32XC5bX5scLoSmEXM/nP7XEaP3QNm33euIhp8H/bRteb9aswxkRpsasLruR7sIh00JqHLZpDf4UqMu7g==","shasum":"ee4443fbb8500fb5decda4f23541db9732087eed","tarball":"https://registry.npmjs.org/@hyperbeam/iframe/-/iframe-0.0.5-beta.1.tgz","fileCount":4,"unpackedSize":27363,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiLLCEACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr70w/9H5H4zZboKwNOVG4F0RjgcpCZi7VwMskyUTAUTuDRxC3EVSpz\r\nvH57iypJfP+jZnfDWtYMR6KnzuOCawIGPhCrJSvUp1E0ag7ugaZNUuzL7Q3m\r\nu+OYxuhyzQI6pIxTdZuV9tkJNqGgniLiBCwmmh2aDuXk0h/cNgobVeD+308m\r\nTL+qusmrYcBqkoz22f516lSDg+neAzMf+zYE4/lRGfcaTPd38cO/f1mr+zK6\r\nUOjzUj6QPbSSAf0fdZpGHuSJjQ6aZpXJReFxg10Woff1KDLrkaLELInv2xCZ\r\n3zBjK9rWpDt/q7i2zJ4jXsdmSHj09YIZq2NMnUd67ZBEp5Pe6sQ7cEBDukBa\r\njZQeTYrAMtNcI2SjaaHJJOO9tctH/BZQsgtTfaQTr8qL8ZXO3Mm4Sgqamu15\r\nDNMrvA031ZvO96pIDG2LeWBuHPFNJEX+YdiLiL9iSiWlXhB/wrLkPf1n9d/K\r\nTog7Dksq5LU5PSVuwCqRNHYJj/Kb+v6hPI0M6j8slRL1AduTsExHIoyQHG20\r\n8VMoolnSyrTlSdCsPGa0G0j646aNuTpOAqGVHOsauDMuOD26o8TnsBriGIdk\r\n0dMMrAIeV38ceiY1S5eXMEK5sK9eVkEVXaV92jCT8jZqx9n2BeL3bBEOUwIA\r\no059PAyH1fiJ9wQvOW+tK5nDlrbQ6FJ6Z40=\r\n=+t/b\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDofu3dq1PROuVCE9rGqHuNNL/Eim5tthm+h2L6Rr1zCAIgSpRUm7u1GH8NOr21ZpiVFGbDt0QWfRrtXGDWdCJTPWo="}]},"_npmUser":{"name":"ambyjkl","email":"ambareeshbalaji@gmail.com"},"directories":{},"maintainers":[{"name":"ambyjkl","email":"ambareeshbalaji@gmail.com"},{"name":"scottyfillups","email":"scotty@hyperbeam.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/iframe_0.0.5-beta.1_1647095940727_0.005679268650998548"},"_hasShrinkwrap":false,"deprecated":"please use https://www.npmjs.com/package/@hyperbeam/web instead"},"0.0.5-beta.2":{"name":"@hyperbeam/iframe","version":"0.0.5-beta.2","description":"iframe client library for the Hyperbeam multiplayer browser API","keywords":["hyperbeam","hyperbeam api","hyperbeam cobrowser","hyperbeam cobrowser api","hyperbeam cobrowsing","hyperbeam cobrowsing api","hyperbeam iframe","hyperbeam iframe api","hyperbeam browser","hyperbeam browser api","multiplayer browser","multiplayer browser api","shared browser","shared browser api","cobrowsing","cobrowsing api","cobrowser","cobrowser api"],"homepage":"https://hyperbeam.dev/","bugs":{"url":"https://hyperbeam.support/Get-in-touch-ad6c0bdc9d074923950a0df76ac516b0","email":"amby@hyperbeam.com"},"author":{"name":"Ambareesh Balaji","email":"amby@hyperbeam.com"},"contributors":[{"name":"Philip Scott","email":"scotty@hyperbeam.com"},{"name":"Declan Goncalves","email":"declan@hyperbeam.com"}],"module":"dist/index.js","types":"dist/index.d.ts","dependencies":{"@types/chrome":"^0.0.178"},"readme":"# @hyperbeam/iframe\n\niframe client library for the Hyperbeam multiplayer browser API.\n\nUnfamiliar with the Hyperbeam API? Read the full documentation <a href=\"https://hyperbeam.support/API-Design-eb9874bd1ef54c22ba7197324ce22231\" target=\"_blank\">here</a>.\n\n## Table of Contents\n\n- [Features](#features)\n- [Installation](#installation)\n- [Example](#example)\n- [API](#api)\n  - [Loading multiplayer browser](#loading-multiplayer-browser)\n  - [Setting video volume](#setting-video-volume)\n  - [Getting user ID](#getting-user-id)\n  - [Setting admin token](#setting-admin-token)\n  - [Setting permissions](#setting-permissions)\n  - [Control tabs programmatically](#control-tabs-programmatically)\n  - [Listen to tab events](#listen-to-tab-events)\n\n## Features\n\n- Connect to a multiplayer browser\n- Control browser navigation programmatically\n- Query browser state and listen to events\n- Manage user control permissions\n- Set local multiplayer browser volume\n\n## Installation\n\nUsing npm:\n\n```bash\n$ npm install @hyperbeam/iframe --save\n```\n\nUsing unpkg:\n\n```html\n<script type=\"module\">\n  import Hyperbeam from \"https://unpkg.com/@hyperbeam/iframe@0.0.4/dist/index.js\"\n  // ...\n</script>\n```\n\n## Example\n\nYou can save this code snippet as `example.html` and run it in your browser. Make sure you set the embed URL variable to the response data from the [REST API](https://hyperbeam.support/Hyperbeam-API-eb9874bd1ef54c22ba7197324ce22231#d326c958e95244b89cf7ffdbcb07e9bd).\n\n```html\n<div style=\"font-family: Arial\">\n  <button id=\"reload\">Reload</button>\n  <button id=\"back\">Go Back</button>\n  <button id=\"forward\">Go Forward</button>\n  <button id=\"youtube\">Open Youtube.com</button>\n  Volume: <input type=\"range\" min=\"0\" max=\"100\" value=\"100\" id=\"range\">\n  <p>User ID: <span id=\"userId\"></span></p>\n  <p>Current website: <span id=\"currentSite\"></p>\n</div>\n<iframe id=\"iframe\" style=\"height:720px;width:1280px\"></iframe>\n<script type=\"module\">\n  import Hyperbeam from \"https://unpkg.com/@hyperbeam/iframe@0.0.4/dist/index.js\"\n  // TODO: Set the embedURL variable\n  const embedURL = \"<your-embed-url>\"\n  const hb = await Hyperbeam(iframe, embedURL)\n  userId.innerText = hb.userId\n  reload.addEventListener(\"click\", () => {\n    hb.tabs.reload()\n  })\n  back.addEventListener(\"click\", () => {\n    hb.tabs.goBack()\n  })\n  forward.addEventListener(\"click\", () => {\n    hb.tabs.goForward()\n  })\n  youtube.addEventListener(\"click\", () => {\n    hb.tabs.update({ url: \"https://youtube.com\" })\n  })\n  range.addEventListener(\"change\", (e) => {\n    hb.volume = e.target.value / 100\n  })\n  hb.tabs.onUpdated.addListener((tabId, changeInfo) => {\n    if (changeInfo.title) {\n      currentSite.innerText = changeInfo.title\n    }\n  })\n</script>\n```\n\n## API Reference\n\n### Loading multiplayer browser\n\n**Hyperbeam(iframe: IFrame, embedURL: string, opts?: HyperbeamOptions): Promise\\<HyperbeamClient\\>**\n\nCreates a new Hyperbeam IFrame client.\n\n```js\n// The embedURL is retrieved from the REST API\n// Documentation for the REST API can be found here:\n// hyperbeam.support/API-Design-eb9874bd1ef54c22ba7197324ce22231\nconst embedURL = \"https://abc.hyperbeam.com/foo?token=bar\"\nconst iframe = document.getElementById(\"iframe-id\")\n\nconst hb = await Hyperbeam(iframe, embedURL, {\n  // Number of milliseconds until the request to the multiplayer browser times out.\n  // If the request times out, the returned promise will be rejected.\n  timeout: 5000, // default = 2000\n\n  // An admin token returned from the REST API that will grant this user\n  // access to managing user permissions and programmatic navigation.\n  admin_token: \"admin_token_from_rest_api_response\",\n\n  // Starting volume of the multiplayer browser\n  volume: 0.2    // default = 1.0\n})\n```\n\n### Setting video volume\n\n**hb.volume = 0.5**\n\nSets the volume for the multiplayer browser *locally*. Volume changes only apply to the local user. This setting is *not* persisted on refreshing the page.\n\n```js\nconst hb = await Hyperbeam(iframe, embedURL)\n// Valid values range from 0.0 to 1.0\nhb.volume = 0.5 // default = 1.0\n```\n\n### Getting user ID\n\n**hb.userId: string**\n\nGets the client's user ID. A \"user\" is defined as a single connection to the multiplayer browser. If a person has multiple tabs connected to the multiplayer browser, each tab with an active connection will be assigned a different user ID.\n\n```js\nconst hb = await Hyperbeam(iframe, embedURL)\nconsole.log(hb.userId) // A unique string identifying the user\n```\n\n### Setting admin token\n\n**hb.admin_token = \"admin_token\"**\n\nSets the client's admin token. The client must have an admin token set to manage user permissions and control the tabs programmatically.\n\n```js\n// You can provide the admin token during initialization\nconst hb = await Hyperbeam(iframe, embedURL, {\n  admin_token: \"admin_token_from_rest_api_response\"\n})\n\n// In some situations, you may want to promote the user to\n// an admin after initialization. For example, promoting a \"user\" to a \"moderator\".\nconst hb = await Hyperbeam(iframe, embedURL)\nhb.admin_token = \"admin_token_from_rest_api_response\"\n```\n\n### Setting permissions\n\n**hb.setPermission(userId: string, permissionData: PremissionData): Promise\\<void\\>**\n\nSets the permission of a user by their ID. The client must have an admin token set to manage user permissions.\n\n```js\n// You can provide the admin token during initialization\nconst hb = await Hyperbeam(iframe, embedURL, {\n  admin_token: \"admin_token_from_rest_api_response\"\n})\n\nconst targetUserId = \"a_user_id\"\n\n// All keys can be omitted: if the key is omitted, then the existing value will be unchanged\nconst permissions = {\n  // Higher value = higher priority\n  // Users with a higher priority will preempt the control of lower priority users.\n  priority: 2,           // default = 0\n\n  // Number of milliseconds until a user is considered \"idle\". Once a user is considered\n  // idle, they no longer preempt lower priority users until they interact with the\n  // multiplayer browser again.\n  idle_timeout: 3000,    // default = 0\n\n  // If control_disabled = true, all control input (mouse movements, keyboard presses)\n  // will be ignored. Note that disabling control does not restrict access to any\n  // APIs that require admin tokens.\n  control_disabled: true // default = control_disable_default (see REST API)\n}\n\nhb.setPermissions(targetUserId, permissions)\n```\n\n### Control tabs programmatically\n\nHyperbeam's tab API mirrors Chrome extension tab API, found <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method\" target=\"_blank\">here</a>.\n\nRather than calling `chrome.tabs.create({ active: true })`, you will would call `hb.tabs.create({ active: true })`.\n\nWe support the following methods:\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-create\" target=\"_blank\">tabs.create</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-detectLanguage\" target=\"_blank\">tabs.detectLanguage</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-discard\" target=\"_blank\">tabs.discard</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-duplicate\" target=\"_blank\">tabs.duplicate</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-get\" target=\"_blank\">tabs.get</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-getZoom\" target=\"_blank\">tabs.getZoom</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-getZoomSettings\" target=\"_blank\">tabs.getZoomSettings</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-goBack\" target=\"_blank\">tabs.goBack</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-goForward\" target=\"_blank\">tabs.goForward</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-group\" target=\"_blank\">tabs.group</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-highlight\" target=\"_blank\">tabs.highlight</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-move\" target=\"_blank\">tabs.move</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-query\" target=\"_blank\">tabs.query</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-reload\" target=\"_blank\">tabs.reload</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-remove\" target=\"_blank\">tabs.remove</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-setZoom\" target=\"_blank\">tabs.setZoom</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-setZoomSettings\" target=\"_blank\">tabs.setZoomSettings</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-ungroup\" target=\"_blank\">tabs.ungroup</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-update\" target=\"_blank\">tabs.update</a>\n\n```js\nconst hb = await Hyperbeam(iframe, embedURL)\n\n// Create a tab\nconst tab = await hb.tabs.create({ active: true })\n\n// Duplicate a tab\nconst tab2 = await hb.tabs.duplicate(tab.id)\n\n// Set the URL of the active tab\nconst updatedTab = await hb.tabs.update({url: \"https://hyperbeam.dev/\"})\n```\n\n### Listen to tab events\n\nHyperbeam's tab event listener API mirrors Chrome extension tab API, found <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event\" target=\"_blank\">here</a>.\n\nRather than calling `chrome.tabs.onCreated.addListener((tab) => {})`, you will would call `hb.tabs.onCreated.addListener((tab) => {})`.\n\nWe support the following events:\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onActivated\" target=\"_blank\">tabs.onActivated</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onCreated\" target=\"_blank\">tabs.onCreated</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onHighlighted\" target=\"_blank\">tabs.onHighlighted</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onMoved\" target=\"_blank\">tabs.onMoved</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onRemoved\" target=\"_blank\">tabs.onRemoved</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onReplaced\" target=\"_blank\">tabs.onReplaced</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onUpdated\" target=\"_blank\">tabs.onUpdated</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onZoomChange\" target=\"_blank\">tabs.onZoomChange</a>\n\n```js\nconst hb = await Hyperbeam(iframe, embedURL)\n\nfunction onTabCreated(tab) {\n  console.log(tab.id)\n}\n\n// Listen for when a new tab is created\nhb.tabs.onCreated.addListener(onTabCreated)\n\n// Create a new tab\nawait hb.tabs.create({ active: true })\n\n// Remove the event listener\nhb.tabs.onCreated.removeListener(onTabCreated)\n```\n","readmeFilename":"README.md","gitHead":"a42c6dfddae14081b1da204c2d4fd90cba6b23f0","_id":"@hyperbeam/iframe@0.0.5-beta.2","_nodeVersion":"16.13.2","_npmVersion":"8.5.3","dist":{"integrity":"sha512-no+LSJw9CKurS68gdDvpm0yIT+GBmGsUQSAOZPKJfM8fiJdfNCt/HfHCaWDuPzCaEiD3ZOUG3WFw6mZpe0ptCA==","shasum":"75c040b4e777bed2d65c6ec0be3a3349c3dbeb01","tarball":"https://registry.npmjs.org/@hyperbeam/iframe/-/iframe-0.0.5-beta.2.tgz","fileCount":4,"unpackedSize":27363,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiLLDSACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqwGA//Zsgj2TEUwQaq3b+hvndbwsopLZBASABzJfy7mSZJLnTI/5Jg\r\nXHpTKKKqwtHuwNbXry+qFRxOJaQt/irEjPx1bFOpA56BEC7khQRZmhl5oUJT\r\nf5uNV5qD90rA9kzNi9EGv5HWcS1/kUeWm1e8lO0ktTvav3aEtGLCFvWNJPQ3\r\nem0unULlNiXYLOXRt8uJQSRsmKxIlOqf6wkH1Vf3IQ9QfWU8aum3v4n7lnuW\r\njXkLUInlYJ5ErCokRWm+7ic4OZ5U++cLyyn8nV+zZLHIOrJw0eL8kNbPG59r\r\nNd5mCk6KbXF4BK9nk6sP7IuRsqXmAbRXvyT9x/aE9KUCiZcIejDdhgDZTElB\r\nlo2Z5JKLc8Rbr36zIlzxSqy8pxD+By75OrQXvyG7l5iiXV4c1Rt4e0wSGFVV\r\nJx7lhEOBYzWZ3TUTK6LEviNxE6HEqbdSPpDiFE7WAANOIJrESbI+PZgFxCOc\r\nECALpKyHTrOe/56mBA6lVcatjZHwbqvJkFZqlGdB7ctG+S+XVW44OaO+HamA\r\nsKxNmnylLhayntvShywYUzaGV2Y6DGtHBTB+563Rf+l68P7jBGCmzodm4jF6\r\njg7/eV3e5DbSFwd9AK7twlUtgKCfZ4CNii3fFZ3g8yqWqoxEiM26rkYV/Q3J\r\nGuTdkJOzAkEakpsBPOrTFxdNXfpBnxnUfYY=\r\n=x+Bc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGCHjtdZAimJJ5cHH29UhLicF3qkn/4ih5Yv1ocVEPRNAiEAr659a6k1SA6M24Xjv6ogLOeXI7XqIYQGMAcL0N1C3rc="}]},"_npmUser":{"name":"ambyjkl","email":"ambareeshbalaji@gmail.com"},"directories":{},"maintainers":[{"name":"ambyjkl","email":"ambareeshbalaji@gmail.com"},{"name":"scottyfillups","email":"scotty@hyperbeam.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/iframe_0.0.5-beta.2_1647096017819_0.9788508979207238"},"_hasShrinkwrap":false,"deprecated":"please use https://www.npmjs.com/package/@hyperbeam/web instead"},"0.0.5-beta.3":{"name":"@hyperbeam/iframe","version":"0.0.5-beta.3","description":"iframe client library for the Hyperbeam multiplayer browser API","keywords":["hyperbeam","hyperbeam api","hyperbeam cobrowser","hyperbeam cobrowser api","hyperbeam cobrowsing","hyperbeam cobrowsing api","hyperbeam iframe","hyperbeam iframe api","hyperbeam browser","hyperbeam browser api","multiplayer browser","multiplayer browser api","shared browser","shared browser api","cobrowsing","cobrowsing api","cobrowser","cobrowser api"],"homepage":"https://hyperbeam.dev/","bugs":{"url":"https://hyperbeam.support/Get-in-touch-ad6c0bdc9d074923950a0df76ac516b0","email":"amby@hyperbeam.com"},"author":{"name":"Ambareesh Balaji","email":"amby@hyperbeam.com"},"contributors":[{"name":"Philip Scott","email":"scotty@hyperbeam.com"},{"name":"Declan Goncalves","email":"declan@hyperbeam.com"}],"module":"dist/index.js","types":"dist/index.d.ts","dependencies":{"@types/chrome":"^0.0.178"},"readme":"# @hyperbeam/iframe\n\niframe client library for the Hyperbeam multiplayer browser API.\n\nUnfamiliar with the Hyperbeam API? Read the full documentation <a href=\"https://hyperbeam.support/API-Design-eb9874bd1ef54c22ba7197324ce22231\" target=\"_blank\">here</a>.\n\n## Table of Contents\n\n- [Features](#features)\n- [Installation](#installation)\n- [Example](#example)\n- [API](#api)\n  - [Loading multiplayer browser](#loading-multiplayer-browser)\n  - [Setting video volume](#setting-video-volume)\n  - [Getting user ID](#getting-user-id)\n  - [Setting admin token](#setting-admin-token)\n  - [Setting permissions](#setting-permissions)\n  - [Control tabs programmatically](#control-tabs-programmatically)\n  - [Listen to tab events](#listen-to-tab-events)\n\n## Features\n\n- Connect to a multiplayer browser\n- Control browser navigation programmatically\n- Query browser state and listen to events\n- Manage user control permissions\n- Set local multiplayer browser volume\n\n## Installation\n\nUsing npm:\n\n```bash\n$ npm install @hyperbeam/iframe --save\n```\n\nUsing unpkg:\n\n```html\n<script type=\"module\">\n  import Hyperbeam from \"https://unpkg.com/@hyperbeam/iframe@0.0.4/dist/index.js\"\n  // ...\n</script>\n```\n\n## Example\n\nYou can save this code snippet as `example.html` and run it in your browser. Make sure you set the embed URL variable to the response data from the [REST API](https://hyperbeam.support/Hyperbeam-API-eb9874bd1ef54c22ba7197324ce22231#d326c958e95244b89cf7ffdbcb07e9bd).\n\n```html\n<div style=\"font-family: Arial\">\n  <button id=\"reload\">Reload</button>\n  <button id=\"back\">Go Back</button>\n  <button id=\"forward\">Go Forward</button>\n  <button id=\"youtube\">Open Youtube.com</button>\n  Volume: <input type=\"range\" min=\"0\" max=\"100\" value=\"100\" id=\"range\">\n  <p>User ID: <span id=\"userId\"></span></p>\n  <p>Current website: <span id=\"currentSite\"></p>\n</div>\n<iframe id=\"iframe\" style=\"height:720px;width:1280px\"></iframe>\n<script type=\"module\">\n  import Hyperbeam from \"https://unpkg.com/@hyperbeam/iframe@0.0.4/dist/index.js\"\n  // TODO: Set the embedURL variable\n  const embedURL = \"<your-embed-url>\"\n  const hb = await Hyperbeam(iframe, embedURL)\n  userId.innerText = hb.userId\n  reload.addEventListener(\"click\", () => {\n    hb.tabs.reload()\n  })\n  back.addEventListener(\"click\", () => {\n    hb.tabs.goBack()\n  })\n  forward.addEventListener(\"click\", () => {\n    hb.tabs.goForward()\n  })\n  youtube.addEventListener(\"click\", () => {\n    hb.tabs.update({ url: \"https://youtube.com\" })\n  })\n  range.addEventListener(\"change\", (e) => {\n    hb.volume = e.target.value / 100\n  })\n  hb.tabs.onUpdated.addListener((tabId, changeInfo) => {\n    if (changeInfo.title) {\n      currentSite.innerText = changeInfo.title\n    }\n  })\n</script>\n```\n\n## API Reference\n\n### Loading multiplayer browser\n\n**Hyperbeam(iframe: IFrame, embedURL: string, opts?: HyperbeamOptions): Promise\\<HyperbeamClient\\>**\n\nCreates a new Hyperbeam IFrame client.\n\n```js\n// The embedURL is retrieved from the REST API\n// Documentation for the REST API can be found here:\n// hyperbeam.support/API-Design-eb9874bd1ef54c22ba7197324ce22231\nconst embedURL = \"https://abc.hyperbeam.com/foo?token=bar\"\nconst iframe = document.getElementById(\"iframe-id\")\n\nconst hb = await Hyperbeam(iframe, embedURL, {\n  // Number of milliseconds until the request to the multiplayer browser times out.\n  // If the request times out, the returned promise will be rejected.\n  timeout: 5000, // default = 2000\n\n  // An admin token returned from the REST API that will grant this user\n  // access to managing user permissions and programmatic navigation.\n  admin_token: \"admin_token_from_rest_api_response\",\n\n  // Starting volume of the multiplayer browser\n  volume: 0.2    // default = 1.0\n})\n```\n\n### Setting video volume\n\n**hb.volume = 0.5**\n\nSets the volume for the multiplayer browser *locally*. Volume changes only apply to the local user. This setting is *not* persisted on refreshing the page.\n\n```js\nconst hb = await Hyperbeam(iframe, embedURL)\n// Valid values range from 0.0 to 1.0\nhb.volume = 0.5 // default = 1.0\n```\n\n### Getting user ID\n\n**hb.userId: string**\n\nGets the client's user ID. A \"user\" is defined as a single connection to the multiplayer browser. If a person has multiple tabs connected to the multiplayer browser, each tab with an active connection will be assigned a different user ID.\n\n```js\nconst hb = await Hyperbeam(iframe, embedURL)\nconsole.log(hb.userId) // A unique string identifying the user\n```\n\n### Setting admin token\n\n**hb.admin_token = \"admin_token\"**\n\nSets the client's admin token. The client must have an admin token set to manage user permissions and control the tabs programmatically.\n\n```js\n// You can provide the admin token during initialization\nconst hb = await Hyperbeam(iframe, embedURL, {\n  admin_token: \"admin_token_from_rest_api_response\"\n})\n\n// In some situations, you may want to promote the user to\n// an admin after initialization. For example, promoting a \"user\" to a \"moderator\".\nconst hb = await Hyperbeam(iframe, embedURL)\nhb.admin_token = \"admin_token_from_rest_api_response\"\n```\n\n### Setting permissions\n\n**hb.setPermission(userId: string, permissionData: PremissionData): Promise\\<void\\>**\n\nSets the permission of a user by their ID. The client must have an admin token set to manage user permissions.\n\n```js\n// You can provide the admin token during initialization\nconst hb = await Hyperbeam(iframe, embedURL, {\n  admin_token: \"admin_token_from_rest_api_response\"\n})\n\nconst targetUserId = \"a_user_id\"\n\n// All keys can be omitted: if the key is omitted, then the existing value will be unchanged\nconst permissions = {\n  // Higher value = higher priority\n  // Users with a higher priority will preempt the control of lower priority users.\n  priority: 2,           // default = 0\n\n  // Number of milliseconds until a user is considered \"idle\". Once a user is considered\n  // idle, they no longer preempt lower priority users until they interact with the\n  // multiplayer browser again.\n  idle_timeout: 3000,    // default = 0\n\n  // If control_disabled = true, all control input (mouse movements, keyboard presses)\n  // will be ignored. Note that disabling control does not restrict access to any\n  // APIs that require admin tokens.\n  control_disabled: true // default = control_disable_default (see REST API)\n}\n\nhb.setPermissions(targetUserId, permissions)\n```\n\n### Control tabs programmatically\n\nHyperbeam's tab API mirrors Chrome extension tab API, found <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method\" target=\"_blank\">here</a>.\n\nRather than calling `chrome.tabs.create({ active: true })`, you will would call `hb.tabs.create({ active: true })`.\n\nWe support the following methods:\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-create\" target=\"_blank\">tabs.create</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-detectLanguage\" target=\"_blank\">tabs.detectLanguage</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-discard\" target=\"_blank\">tabs.discard</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-duplicate\" target=\"_blank\">tabs.duplicate</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-get\" target=\"_blank\">tabs.get</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-getZoom\" target=\"_blank\">tabs.getZoom</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-getZoomSettings\" target=\"_blank\">tabs.getZoomSettings</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-goBack\" target=\"_blank\">tabs.goBack</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-goForward\" target=\"_blank\">tabs.goForward</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-group\" target=\"_blank\">tabs.group</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-highlight\" target=\"_blank\">tabs.highlight</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-move\" target=\"_blank\">tabs.move</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-query\" target=\"_blank\">tabs.query</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-reload\" target=\"_blank\">tabs.reload</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-remove\" target=\"_blank\">tabs.remove</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-setZoom\" target=\"_blank\">tabs.setZoom</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-setZoomSettings\" target=\"_blank\">tabs.setZoomSettings</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-ungroup\" target=\"_blank\">tabs.ungroup</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-update\" target=\"_blank\">tabs.update</a>\n\n```js\nconst hb = await Hyperbeam(iframe, embedURL)\n\n// Create a tab\nconst tab = await hb.tabs.create({ active: true })\n\n// Duplicate a tab\nconst tab2 = await hb.tabs.duplicate(tab.id)\n\n// Set the URL of the active tab\nconst updatedTab = await hb.tabs.update({url: \"https://hyperbeam.dev/\"})\n```\n\n### Listen to tab events\n\nHyperbeam's tab event listener API mirrors Chrome extension tab API, found <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event\" target=\"_blank\">here</a>.\n\nRather than calling `chrome.tabs.onCreated.addListener((tab) => {})`, you will would call `hb.tabs.onCreated.addListener((tab) => {})`.\n\nWe support the following events:\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onActivated\" target=\"_blank\">tabs.onActivated</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onCreated\" target=\"_blank\">tabs.onCreated</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onHighlighted\" target=\"_blank\">tabs.onHighlighted</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onMoved\" target=\"_blank\">tabs.onMoved</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onRemoved\" target=\"_blank\">tabs.onRemoved</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onReplaced\" target=\"_blank\">tabs.onReplaced</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onUpdated\" target=\"_blank\">tabs.onUpdated</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onZoomChange\" target=\"_blank\">tabs.onZoomChange</a>\n\n```js\nconst hb = await Hyperbeam(iframe, embedURL)\n\nfunction onTabCreated(tab) {\n  console.log(tab.id)\n}\n\n// Listen for when a new tab is created\nhb.tabs.onCreated.addListener(onTabCreated)\n\n// Create a new tab\nawait hb.tabs.create({ active: true })\n\n// Remove the event listener\nhb.tabs.onCreated.removeListener(onTabCreated)\n```\n","readmeFilename":"README.md","gitHead":"a42c6dfddae14081b1da204c2d4fd90cba6b23f0","_id":"@hyperbeam/iframe@0.0.5-beta.3","_nodeVersion":"16.13.2","_npmVersion":"8.5.3","dist":{"integrity":"sha512-oV+raEB4uwYiDlNf4mmsgcVn5ODdIB+5eazeMqXH/Ht3z40vWvd3Lq6EfzCtsue6eUnqK1SrbfN+RHLFPVDMlw==","shasum":"30a12a82156d88498c2c8c666b0acb5b153fb736","tarball":"https://registry.npmjs.org/@hyperbeam/iframe/-/iframe-0.0.5-beta.3.tgz","fileCount":4,"unpackedSize":27503,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiLLEQACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqnmQ/9HZVXhCb5HMz8pLSYI1OYepfiUK2x7/LurJ3c6bkgy0UyJ4wt\r\nE5ee5NbxnRssXn/18N57JnYo8+afGPC/eatMDPZ2SEUpeNp+ACrAz1m9mhsH\r\nqR/rnlbP9DNFKzTcw/JCUg0YheY3z2/IGgT2tCpqpdTnCx6saxrgmV/oy8QI\r\nA7RNajbnBxs+B28VXX6Sm7t3Mtn9uTcLuY4x2wshilQmw7wXZJUjgMRjhhLH\r\nh2+6PRS3wo9bfxaN56TOsluZFGWvjUxOJd95gRPL+JhpYaHi0k2MdWyWs3e+\r\nGztD5ZVkiKqG03X6oQKi2uxBeBNEfMHzE2pn9FXZhriNIdv43rmRou8Yo+nf\r\nVIb74a760E7ryHesdLYYCNcGUhXQYqCoDWCI+6ETQ8xvpxvF4/aRaN29gh8O\r\nfgOiaN2p1QZZTVp636RGISeFLSIIJBo4NFJB/L5tSVIOzfp1ZjCPdwP2iwnZ\r\nm0IylkSctSfZmdBZzsCN6nsOZO9hTm92wIm1EZryk3qGqnC0U6aGGdBaokDB\r\n/Icjv0wtb6BIi1xmLo3Sxe3ILYhxnt2OHmZPWJGcUO/IaWCR4RHOF9fFxzQE\r\nZ4niyT4JCc1R2XNox3pVtMSGON5JLOinVSOdVSmIKujSOVvvla618wLLKHmq\r\nwwZ+/vH4x+/+jp/v7SyMSmkZoBPPLJ6jr0I=\r\n=iK54\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAUSBr8s9TiUmKaNatrQFjHJkcapI0nR9cfIkfAyhPspAiA+AvWASlHQSqp4nEdk/53VZ5iNkMTL6AR7LTuNu31IIA=="}]},"_npmUser":{"name":"ambyjkl","email":"ambareeshbalaji@gmail.com"},"directories":{},"maintainers":[{"name":"ambyjkl","email":"ambareeshbalaji@gmail.com"},{"name":"scottyfillups","email":"scotty@hyperbeam.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/iframe_0.0.5-beta.3_1647096080732_0.7595561431825262"},"_hasShrinkwrap":false,"deprecated":"please use https://www.npmjs.com/package/@hyperbeam/web instead"},"0.0.5-beta.4":{"name":"@hyperbeam/iframe","version":"0.0.5-beta.4","description":"iframe client library for the Hyperbeam multiplayer browser API","keywords":["hyperbeam","hyperbeam api","hyperbeam cobrowser","hyperbeam cobrowser api","hyperbeam cobrowsing","hyperbeam cobrowsing api","hyperbeam iframe","hyperbeam iframe api","hyperbeam browser","hyperbeam browser api","multiplayer browser","multiplayer browser api","shared browser","shared browser api","cobrowsing","cobrowsing api","cobrowser","cobrowser api"],"homepage":"https://hyperbeam.dev/","bugs":{"url":"https://hyperbeam.support/Get-in-touch-ad6c0bdc9d074923950a0df76ac516b0","email":"amby@hyperbeam.com"},"author":{"name":"Ambareesh Balaji","email":"amby@hyperbeam.com"},"contributors":[{"name":"Philip Scott","email":"scotty@hyperbeam.com"},{"name":"Declan Goncalves","email":"declan@hyperbeam.com"}],"module":"dist/index.js","types":"dist/index.d.ts","dependencies":{"@types/chrome":"^0.0.178"},"readme":"# @hyperbeam/iframe\n\niframe client library for the Hyperbeam multiplayer browser API.\n\nUnfamiliar with the Hyperbeam API? Read the full documentation <a href=\"https://hyperbeam.support/API-Design-eb9874bd1ef54c22ba7197324ce22231\" target=\"_blank\">here</a>.\n\n## Table of Contents\n\n- [Features](#features)\n- [Installation](#installation)\n- [Example](#example)\n- [API](#api)\n  - [Loading multiplayer browser](#loading-multiplayer-browser)\n  - [Setting video volume](#setting-video-volume)\n  - [Getting user ID](#getting-user-id)\n  - [Setting admin token](#setting-admin-token)\n  - [Setting permissions](#setting-permissions)\n  - [Control tabs programmatically](#control-tabs-programmatically)\n  - [Listen to tab events](#listen-to-tab-events)\n\n## Features\n\n- Connect to a multiplayer browser\n- Control browser navigation programmatically\n- Query browser state and listen to events\n- Manage user control permissions\n- Set local multiplayer browser volume\n\n## Installation\n\nUsing npm:\n\n```bash\n$ npm install @hyperbeam/iframe --save\n```\n\nUsing unpkg:\n\n```html\n<script type=\"module\">\n  import Hyperbeam from \"https://unpkg.com/@hyperbeam/iframe@0.0.4/dist/index.js\"\n  // ...\n</script>\n```\n\n## Example\n\nYou can save this code snippet as `example.html` and run it in your browser. Make sure you set the embed URL variable to the response data from the [REST API](https://hyperbeam.support/Hyperbeam-API-eb9874bd1ef54c22ba7197324ce22231#d326c958e95244b89cf7ffdbcb07e9bd).\n\n```html\n<div style=\"font-family: Arial\">\n  <button id=\"reload\">Reload</button>\n  <button id=\"back\">Go Back</button>\n  <button id=\"forward\">Go Forward</button>\n  <button id=\"youtube\">Open Youtube.com</button>\n  Volume: <input type=\"range\" min=\"0\" max=\"100\" value=\"100\" id=\"range\">\n  <p>User ID: <span id=\"userId\"></span></p>\n  <p>Current website: <span id=\"currentSite\"></p>\n</div>\n<iframe id=\"iframe\" style=\"height:720px;width:1280px\"></iframe>\n<script type=\"module\">\n  import Hyperbeam from \"https://unpkg.com/@hyperbeam/iframe@0.0.4/dist/index.js\"\n  // TODO: Set the embedURL variable\n  const embedURL = \"<your-embed-url>\"\n  const hb = await Hyperbeam(iframe, embedURL)\n  userId.innerText = hb.userId\n  reload.addEventListener(\"click\", () => {\n    hb.tabs.reload()\n  })\n  back.addEventListener(\"click\", () => {\n    hb.tabs.goBack()\n  })\n  forward.addEventListener(\"click\", () => {\n    hb.tabs.goForward()\n  })\n  youtube.addEventListener(\"click\", () => {\n    hb.tabs.update({ url: \"https://youtube.com\" })\n  })\n  range.addEventListener(\"change\", (e) => {\n    hb.volume = e.target.value / 100\n  })\n  hb.tabs.onUpdated.addListener((tabId, changeInfo) => {\n    if (changeInfo.title) {\n      currentSite.innerText = changeInfo.title\n    }\n  })\n</script>\n```\n\n## API Reference\n\n### Loading multiplayer browser\n\n**Hyperbeam(iframe: IFrame, embedURL: string, opts?: HyperbeamOptions): Promise\\<HyperbeamClient\\>**\n\nCreates a new Hyperbeam IFrame client.\n\n```js\n// The embedURL is retrieved from the REST API\n// Documentation for the REST API can be found here:\n// hyperbeam.support/API-Design-eb9874bd1ef54c22ba7197324ce22231\nconst embedURL = \"https://abc.hyperbeam.com/foo?token=bar\"\nconst iframe = document.getElementById(\"iframe-id\")\n\nconst hb = await Hyperbeam(iframe, embedURL, {\n  // Number of milliseconds until the request to the multiplayer browser times out.\n  // If the request times out, the returned promise will be rejected.\n  timeout: 5000, // default = 2000\n\n  // An admin token returned from the REST API that will grant this user\n  // access to managing user permissions and programmatic navigation.\n  admin_token: \"admin_token_from_rest_api_response\",\n\n  // Starting volume of the multiplayer browser\n  volume: 0.2    // default = 1.0\n})\n```\n\n### Setting video volume\n\n**hb.volume = 0.5**\n\nSets the volume for the multiplayer browser *locally*. Volume changes only apply to the local user. This setting is *not* persisted on refreshing the page.\n\n```js\nconst hb = await Hyperbeam(iframe, embedURL)\n// Valid values range from 0.0 to 1.0\nhb.volume = 0.5 // default = 1.0\n```\n\n### Getting user ID\n\n**hb.userId: string**\n\nGets the client's user ID. A \"user\" is defined as a single connection to the multiplayer browser. If a person has multiple tabs connected to the multiplayer browser, each tab with an active connection will be assigned a different user ID.\n\n```js\nconst hb = await Hyperbeam(iframe, embedURL)\nconsole.log(hb.userId) // A unique string identifying the user\n```\n\n### Setting admin token\n\n**hb.admin_token = \"admin_token\"**\n\nSets the client's admin token. The client must have an admin token set to manage user permissions and control the tabs programmatically.\n\n```js\n// You can provide the admin token during initialization\nconst hb = await Hyperbeam(iframe, embedURL, {\n  admin_token: \"admin_token_from_rest_api_response\"\n})\n\n// In some situations, you may want to promote the user to\n// an admin after initialization. For example, promoting a \"user\" to a \"moderator\".\nconst hb = await Hyperbeam(iframe, embedURL)\nhb.admin_token = \"admin_token_from_rest_api_response\"\n```\n\n### Setting permissions\n\n**hb.setPermission(userId: string, permissionData: PremissionData): Promise\\<void\\>**\n\nSets the permission of a user by their ID. The client must have an admin token set to manage user permissions.\n\n```js\n// You can provide the admin token during initialization\nconst hb = await Hyperbeam(iframe, embedURL, {\n  admin_token: \"admin_token_from_rest_api_response\"\n})\n\nconst targetUserId = \"a_user_id\"\n\n// All keys can be omitted: if the key is omitted, then the existing value will be unchanged\nconst permissions = {\n  // Higher value = higher priority\n  // Users with a higher priority will preempt the control of lower priority users.\n  priority: 2,           // default = 0\n\n  // Number of milliseconds until a user is considered \"idle\". Once a user is considered\n  // idle, they no longer preempt lower priority users until they interact with the\n  // multiplayer browser again.\n  idle_timeout: 3000,    // default = 0\n\n  // If control_disabled = true, all control input (mouse movements, keyboard presses)\n  // will be ignored. Note that disabling control does not restrict access to any\n  // APIs that require admin tokens.\n  control_disabled: true // default = control_disable_default (see REST API)\n}\n\nhb.setPermissions(targetUserId, permissions)\n```\n\n### Control tabs programmatically\n\nHyperbeam's tab API mirrors Chrome extension tab API, found <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method\" target=\"_blank\">here</a>.\n\nRather than calling `chrome.tabs.create({ active: true })`, you will would call `hb.tabs.create({ active: true })`.\n\nWe support the following methods:\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-create\" target=\"_blank\">tabs.create</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-detectLanguage\" target=\"_blank\">tabs.detectLanguage</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-discard\" target=\"_blank\">tabs.discard</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-duplicate\" target=\"_blank\">tabs.duplicate</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-get\" target=\"_blank\">tabs.get</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-getZoom\" target=\"_blank\">tabs.getZoom</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-getZoomSettings\" target=\"_blank\">tabs.getZoomSettings</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-goBack\" target=\"_blank\">tabs.goBack</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-goForward\" target=\"_blank\">tabs.goForward</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-group\" target=\"_blank\">tabs.group</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-highlight\" target=\"_blank\">tabs.highlight</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-move\" target=\"_blank\">tabs.move</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-query\" target=\"_blank\">tabs.query</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-reload\" target=\"_blank\">tabs.reload</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-remove\" target=\"_blank\">tabs.remove</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-setZoom\" target=\"_blank\">tabs.setZoom</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-setZoomSettings\" target=\"_blank\">tabs.setZoomSettings</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-ungroup\" target=\"_blank\">tabs.ungroup</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-update\" target=\"_blank\">tabs.update</a>\n\n```js\nconst hb = await Hyperbeam(iframe, embedURL)\n\n// Create a tab\nconst tab = await hb.tabs.create({ active: true })\n\n// Duplicate a tab\nconst tab2 = await hb.tabs.duplicate(tab.id)\n\n// Set the URL of the active tab\nconst updatedTab = await hb.tabs.update({url: \"https://hyperbeam.dev/\"})\n```\n\n### Listen to tab events\n\nHyperbeam's tab event listener API mirrors Chrome extension tab API, found <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event\" target=\"_blank\">here</a>.\n\nRather than calling `chrome.tabs.onCreated.addListener((tab) => {})`, you will would call `hb.tabs.onCreated.addListener((tab) => {})`.\n\nWe support the following events:\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onActivated\" target=\"_blank\">tabs.onActivated</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onCreated\" target=\"_blank\">tabs.onCreated</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onHighlighted\" target=\"_blank\">tabs.onHighlighted</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onMoved\" target=\"_blank\">tabs.onMoved</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onRemoved\" target=\"_blank\">tabs.onRemoved</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onReplaced\" target=\"_blank\">tabs.onReplaced</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onUpdated\" target=\"_blank\">tabs.onUpdated</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onZoomChange\" target=\"_blank\">tabs.onZoomChange</a>\n\n```js\nconst hb = await Hyperbeam(iframe, embedURL)\n\nfunction onTabCreated(tab) {\n  console.log(tab.id)\n}\n\n// Listen for when a new tab is created\nhb.tabs.onCreated.addListener(onTabCreated)\n\n// Create a new tab\nawait hb.tabs.create({ active: true })\n\n// Remove the event listener\nhb.tabs.onCreated.removeListener(onTabCreated)\n```\n","readmeFilename":"README.md","gitHead":"b54ed3c304491df3a7a9b2c01da35bf87db65953","_id":"@hyperbeam/iframe@0.0.5-beta.4","_nodeVersion":"16.13.2","_npmVersion":"8.5.4","dist":{"integrity":"sha512-6dkuXF9JZaIEYd6/Qv4rutuvZWuGnKGnwPQR0nqCCVFBstBPvvNGRvK+5jhqZAqluNrQHesSzy6E+7ZIiLZbXg==","shasum":"b089538dec9021af1eb7e07a7e858fa954227b2d","tarball":"https://registry.npmjs.org/@hyperbeam/iframe/-/iframe-0.0.5-beta.4.tgz","fileCount":4,"unpackedSize":27496,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiL3ZNACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmproQ//QOsIJmvzUcBFky6F5U+Zr5wUj0aWeQUSfx5m2y1dWw+u2GBE\r\neYyEDIkbs+bmuVwdc4CfWp6uNneRocJIos0UhPNCUiz9Ej0d8CPKPogWIIY+\r\ncok8k1870u1bpqMyu3UMM96BTR+Pfk+Cmi/maJn4jlnbxksn56ZhsruMl9BV\r\nDKp56YUrcKlBCKCx9mhoo9E5E4mUWdPpagrXE+Ik/EVdIgy3/M4gdFQzQeos\r\n+h+AE6GRo0LEMt+mcF6fU0c0DZ3iwmokiwpnxGarVFIuiNnRWTVl+Olby+qG\r\nyU75UbUFK06fkDepSL1DV5KwbbXMD1eQvBNBTczYdgRNXAwZEP1AEMozANHY\r\nmVV0AbWNJbxSYTV/hKxkzrKoT+tassDGQVfEhYYktYS9cjrYUIk87CdzwuMW\r\ndxkNo0WEOMG7UFsiWA3T36FfGJ+pHbiw1s1tj39sALwAVryIbjI/9OMKJIEg\r\ncwRBTxnEu0AxBVazHWneBIlDO027IOUTDx0NSzNuhMK6Ru6bX4mO6hQC7QN9\r\nEUhvmDBWn7JvgTGckq2TGU24phhYrINJe2xwV2Zmnnc1oLHIX9l9zn/NTDcG\r\nJ/w5bPBYQpZ3o2xj3va01JiVuEfrxvIVtY3hfW+KECeBN19M5vN1AJc0PmBc\r\n8NN1DKPu8AH4T/UTmyQbRDRmOqnOWWXpH3U=\r\n=CEgh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFLMgUfLfCep8KDlhpQutRYNgZS+NSG9YdXd3OCIFVYzAiA3fM6B2q2Neg06HpobNlqpRcdiZZsfNuvgdnjre+V2Jw=="}]},"_npmUser":{"name":"ambyjkl","email":"ambareeshbalaji@gmail.com"},"directories":{},"maintainers":[{"name":"ambyjkl","email":"ambareeshbalaji@gmail.com"},{"name":"scottyfillups","email":"scotty@hyperbeam.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/iframe_0.0.5-beta.4_1647277645618_0.4577478824120842"},"_hasShrinkwrap":false,"deprecated":"please use https://www.npmjs.com/package/@hyperbeam/web instead"},"0.0.5-beta.5":{"name":"@hyperbeam/iframe","version":"0.0.5-beta.5","description":"iframe client library for the Hyperbeam multiplayer browser API","keywords":["hyperbeam","hyperbeam api","hyperbeam cobrowser","hyperbeam cobrowser api","hyperbeam cobrowsing","hyperbeam cobrowsing api","hyperbeam iframe","hyperbeam iframe api","hyperbeam browser","hyperbeam browser api","multiplayer browser","multiplayer browser api","shared browser","shared browser api","cobrowsing","cobrowsing api","cobrowser","cobrowser api"],"homepage":"https://hyperbeam.dev/","bugs":{"url":"https://hyperbeam.support/Get-in-touch-ad6c0bdc9d074923950a0df76ac516b0","email":"amby@hyperbeam.com"},"author":{"name":"Ambareesh Balaji","email":"amby@hyperbeam.com"},"contributors":[{"name":"Philip Scott","email":"scotty@hyperbeam.com"},{"name":"Declan Goncalves","email":"declan@hyperbeam.com"}],"module":"dist/index.js","types":"dist/index.d.ts","dependencies":{"@types/chrome":"^0.0.178"},"readme":"# @hyperbeam/iframe\n\niframe client library for the Hyperbeam multiplayer browser API.\n\nUnfamiliar with the Hyperbeam API? Read the full documentation <a href=\"https://hyperbeam.support/API-Design-eb9874bd1ef54c22ba7197324ce22231\" target=\"_blank\">here</a>.\n\n## Table of Contents\n\n- [Features](#features)\n- [Installation](#installation)\n- [Example](#example)\n- [API](#api)\n  - [Loading multiplayer browser](#loading-multiplayer-browser)\n  - [Setting video volume](#setting-video-volume)\n  - [Getting user ID](#getting-user-id)\n  - [Setting admin token](#setting-admin-token)\n  - [Setting permissions](#setting-permissions)\n  - [Control tabs programmatically](#control-tabs-programmatically)\n  - [Listen to tab events](#listen-to-tab-events)\n\n## Features\n\n- Connect to a multiplayer browser\n- Control browser navigation programmatically\n- Query browser state and listen to events\n- Manage user control permissions\n- Set local multiplayer browser volume\n\n## Installation\n\nUsing npm:\n\n```bash\n$ npm install @hyperbeam/iframe --save\n```\n\nUsing unpkg:\n\n```html\n<script type=\"module\">\n  import Hyperbeam from \"https://unpkg.com/@hyperbeam/iframe@0.0.4/dist/index.js\"\n  // ...\n</script>\n```\n\n## Example\n\nYou can save this code snippet as `example.html` and run it in your browser. Make sure you set the embed URL variable to the response data from the [REST API](https://hyperbeam.support/Hyperbeam-API-eb9874bd1ef54c22ba7197324ce22231#d326c958e95244b89cf7ffdbcb07e9bd).\n\n```html\n<div style=\"font-family: Arial\">\n  <button id=\"reload\">Reload</button>\n  <button id=\"back\">Go Back</button>\n  <button id=\"forward\">Go Forward</button>\n  <button id=\"youtube\">Open Youtube.com</button>\n  Volume: <input type=\"range\" min=\"0\" max=\"100\" value=\"100\" id=\"range\">\n  <p>User ID: <span id=\"userId\"></span></p>\n  <p>Current website: <span id=\"currentSite\"></p>\n</div>\n<iframe id=\"iframe\" style=\"height:720px;width:1280px\"></iframe>\n<script type=\"module\">\n  import Hyperbeam from \"https://unpkg.com/@hyperbeam/iframe@0.0.4/dist/index.js\"\n  // TODO: Set the embedURL variable\n  const embedURL = \"<your-embed-url>\"\n  const hb = await Hyperbeam(iframe, embedURL)\n  userId.innerText = hb.userId\n  reload.addEventListener(\"click\", () => {\n    hb.tabs.reload()\n  })\n  back.addEventListener(\"click\", () => {\n    hb.tabs.goBack()\n  })\n  forward.addEventListener(\"click\", () => {\n    hb.tabs.goForward()\n  })\n  youtube.addEventListener(\"click\", () => {\n    hb.tabs.update({ url: \"https://youtube.com\" })\n  })\n  range.addEventListener(\"change\", (e) => {\n    hb.volume = e.target.value / 100\n  })\n  hb.tabs.onUpdated.addListener((tabId, changeInfo) => {\n    if (changeInfo.title) {\n      currentSite.innerText = changeInfo.title\n    }\n  })\n</script>\n```\n\n## API Reference\n\n### Loading multiplayer browser\n\n**Hyperbeam(iframe: IFrame, embedURL: string, opts?: HyperbeamOptions): Promise\\<HyperbeamClient\\>**\n\nCreates a new Hyperbeam IFrame client.\n\n```js\n// The embedURL is retrieved from the REST API\n// Documentation for the REST API can be found here:\n// hyperbeam.support/API-Design-eb9874bd1ef54c22ba7197324ce22231\nconst embedURL = \"https://abc.hyperbeam.com/foo?token=bar\"\nconst iframe = document.getElementById(\"iframe-id\")\n\nconst hb = await Hyperbeam(iframe, embedURL, {\n  // Number of milliseconds until the request to the multiplayer browser times out.\n  // If the request times out, the returned promise will be rejected.\n  timeout: 5000, // default = 2000\n\n  // An admin token returned from the REST API that will grant this user\n  // access to managing user permissions and programmatic navigation.\n  admin_token: \"admin_token_from_rest_api_response\",\n\n  // Starting volume of the multiplayer browser\n  volume: 0.2    // default = 1.0\n})\n```\n\n### Setting video volume\n\n**hb.volume = 0.5**\n\nSets the volume for the multiplayer browser *locally*. Volume changes only apply to the local user. This setting is *not* persisted on refreshing the page.\n\n```js\nconst hb = await Hyperbeam(iframe, embedURL)\n// Valid values range from 0.0 to 1.0\nhb.volume = 0.5 // default = 1.0\n```\n\n### Getting user ID\n\n**hb.userId: string**\n\nGets the client's user ID. A \"user\" is defined as a single connection to the multiplayer browser. If a person has multiple tabs connected to the multiplayer browser, each tab with an active connection will be assigned a different user ID.\n\n```js\nconst hb = await Hyperbeam(iframe, embedURL)\nconsole.log(hb.userId) // A unique string identifying the user\n```\n\n### Setting admin token\n\n**hb.admin_token = \"admin_token\"**\n\nSets the client's admin token. The client must have an admin token set to manage user permissions and control the tabs programmatically.\n\n```js\n// You can provide the admin token during initialization\nconst hb = await Hyperbeam(iframe, embedURL, {\n  admin_token: \"admin_token_from_rest_api_response\"\n})\n\n// In some situations, you may want to promote the user to\n// an admin after initialization. For example, promoting a \"user\" to a \"moderator\".\nconst hb = await Hyperbeam(iframe, embedURL)\nhb.admin_token = \"admin_token_from_rest_api_response\"\n```\n\n### Setting permissions\n\n**hb.setPermission(userId: string, permissionData: PremissionData): Promise\\<void\\>**\n\nSets the permission of a user by their ID. The client must have an admin token set to manage user permissions.\n\n```js\n// You can provide the admin token during initialization\nconst hb = await Hyperbeam(iframe, embedURL, {\n  admin_token: \"admin_token_from_rest_api_response\"\n})\n\nconst targetUserId = \"a_user_id\"\n\n// All keys can be omitted: if the key is omitted, then the existing value will be unchanged\nconst permissions = {\n  // Higher value = higher priority\n  // Users with a higher priority will preempt the control of lower priority users.\n  priority: 2,           // default = 0\n\n  // Number of milliseconds until a user is considered \"idle\". Once a user is considered\n  // idle, they no longer preempt lower priority users until they interact with the\n  // multiplayer browser again.\n  idle_timeout: 3000,    // default = 0\n\n  // If control_disabled = true, all control input (mouse movements, keyboard presses)\n  // will be ignored. Note that disabling control does not restrict access to any\n  // APIs that require admin tokens.\n  control_disabled: true // default = control_disable_default (see REST API)\n}\n\nhb.setPermissions(targetUserId, permissions)\n```\n\n### Control tabs programmatically\n\nHyperbeam's tab API mirrors Chrome extension tab API, found <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method\" target=\"_blank\">here</a>.\n\nRather than calling `chrome.tabs.create({ active: true })`, you will would call `hb.tabs.create({ active: true })`.\n\nWe support the following methods:\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-create\" target=\"_blank\">tabs.create</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-detectLanguage\" target=\"_blank\">tabs.detectLanguage</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-discard\" target=\"_blank\">tabs.discard</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-duplicate\" target=\"_blank\">tabs.duplicate</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-get\" target=\"_blank\">tabs.get</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-getZoom\" target=\"_blank\">tabs.getZoom</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-getZoomSettings\" target=\"_blank\">tabs.getZoomSettings</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-goBack\" target=\"_blank\">tabs.goBack</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-goForward\" target=\"_blank\">tabs.goForward</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-group\" target=\"_blank\">tabs.group</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-highlight\" target=\"_blank\">tabs.highlight</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-move\" target=\"_blank\">tabs.move</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-query\" target=\"_blank\">tabs.query</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-reload\" target=\"_blank\">tabs.reload</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-remove\" target=\"_blank\">tabs.remove</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-setZoom\" target=\"_blank\">tabs.setZoom</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-setZoomSettings\" target=\"_blank\">tabs.setZoomSettings</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-ungroup\" target=\"_blank\">tabs.ungroup</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-update\" target=\"_blank\">tabs.update</a>\n\n```js\nconst hb = await Hyperbeam(iframe, embedURL)\n\n// Create a tab\nconst tab = await hb.tabs.create({ active: true })\n\n// Duplicate a tab\nconst tab2 = await hb.tabs.duplicate(tab.id)\n\n// Set the URL of the active tab\nconst updatedTab = await hb.tabs.update({url: \"https://hyperbeam.dev/\"})\n```\n\n### Listen to tab events\n\nHyperbeam's tab event listener API mirrors Chrome extension tab API, found <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event\" target=\"_blank\">here</a>.\n\nRather than calling `chrome.tabs.onCreated.addListener((tab) => {})`, you will would call `hb.tabs.onCreated.addListener((tab) => {})`.\n\nWe support the following events:\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onActivated\" target=\"_blank\">tabs.onActivated</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onCreated\" target=\"_blank\">tabs.onCreated</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onHighlighted\" target=\"_blank\">tabs.onHighlighted</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onMoved\" target=\"_blank\">tabs.onMoved</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onRemoved\" target=\"_blank\">tabs.onRemoved</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onReplaced\" target=\"_blank\">tabs.onReplaced</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onUpdated\" target=\"_blank\">tabs.onUpdated</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onZoomChange\" target=\"_blank\">tabs.onZoomChange</a>\n\n```js\nconst hb = await Hyperbeam(iframe, embedURL)\n\nfunction onTabCreated(tab) {\n  console.log(tab.id)\n}\n\n// Listen for when a new tab is created\nhb.tabs.onCreated.addListener(onTabCreated)\n\n// Create a new tab\nawait hb.tabs.create({ active: true })\n\n// Remove the event listener\nhb.tabs.onCreated.removeListener(onTabCreated)\n```\n","readmeFilename":"README.md","gitHead":"536938fd9f502a9294f8cae9b79281b0313723d7","_id":"@hyperbeam/iframe@0.0.5-beta.5","_nodeVersion":"16.13.2","_npmVersion":"8.5.4","dist":{"integrity":"sha512-A4wGj5meu/r0KvAQ8QQNIDHMi9L7/BBGKCYjL2bsdtP5dPbtyGQSrSfoUY0kxRhhY6UCRz2ws2+Q0imKvafTUQ==","shasum":"62b5b844486715ba7c70193b10566c953d3b0bef","tarball":"https://registry.npmjs.org/@hyperbeam/iframe/-/iframe-0.0.5-beta.5.tgz","fileCount":4,"unpackedSize":27515,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiL35nACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqWjg//alEjzEydaEV7BzGwW0zJE9FTfyxZZsgeKoJDdiE8aA132faL\r\nkDN25Tc0qqyQhpxH5DFwD+OfYeMuReEEIs7oiSCBghIyZQmZ6Af4O92ZXul5\r\nyYPqJYuXa4OHJVAOSFg64vCBW12QxMtAF0GqLMN6sYcI4Kod+rJLi9qHT106\r\nBksL+m5OgF06F2PP+0QHX0AQSmv4KPtaKJfyp3sL/daoN0rx7aQXfk1bgogp\r\nlZ5opLViCTGb1IT4fW646c/CJqGgyNL8IIGciHz5MhhsFpUVT12yoLa3VEgC\r\n+VrkYH8MtZgpWDGGJ2AATfjqZcVc9WzDCXeN8nKY2/I0q54+2tMijW1mO01O\r\nZFCNJ4xtZj0E2sEcwLbCt5sBSnX6IjwUKTuq4WcFtt8eNWelsyBjY1uB+u8o\r\npsKEB9K3qovQ0GgmE4/X1UUBtJBlT1Ka7mMCN3n2mKE0HgUHuPCmIEIVGZCG\r\nl7AFhc079autXZe8lOfn4HZYzcvzHBx3FGjOPzhaHaw4hEREmUdB1nlXEaDZ\r\nBO1AO1uY/GZv8dSfjno3A7A6q1dk6t31h5jMqNwJ1PrfLgtgOTVsHVHsW0AV\r\nojyQ0RpVuYBBHSCFAyvvCWNlmN17mWEf/KO2UqTs19dovvH+hu8uvAcmxHYr\r\nh6cVZ3Iaz0q3UNCXikXGgFWdZcNktusudbs=\r\n=uNWX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHmQQn6XZBkWK7BorFwG8o6uuAsjtpNqiLMaexP2ohmKAiEA4od8wxaMe0WwYmmMq3zhyX/26j+j3wqocsuz8E5WoMY="}]},"_npmUser":{"name":"ambyjkl","email":"ambareeshbalaji@gmail.com"},"directories":{},"maintainers":[{"name":"ambyjkl","email":"ambareeshbalaji@gmail.com"},{"name":"scottyfillups","email":"scotty@hyperbeam.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/iframe_0.0.5-beta.5_1647279719141_0.5334638207028986"},"_hasShrinkwrap":false,"deprecated":"please use https://www.npmjs.com/package/@hyperbeam/web instead"},"0.0.5-beta.6":{"name":"@hyperbeam/iframe","version":"0.0.5-beta.6","description":"iframe client library for the Hyperbeam multiplayer browser API","keywords":["hyperbeam","hyperbeam api","hyperbeam cobrowser","hyperbeam cobrowser api","hyperbeam cobrowsing","hyperbeam cobrowsing api","hyperbeam iframe","hyperbeam iframe api","hyperbeam browser","hyperbeam browser api","multiplayer browser","multiplayer browser api","shared browser","shared browser api","cobrowsing","cobrowsing api","cobrowser","cobrowser api"],"homepage":"https://hyperbeam.dev/","bugs":{"url":"https://hyperbeam.support/Get-in-touch-ad6c0bdc9d074923950a0df76ac516b0","email":"amby@hyperbeam.com"},"author":{"name":"Ambareesh Balaji","email":"amby@hyperbeam.com"},"contributors":[{"name":"Philip Scott","email":"scotty@hyperbeam.com"},{"name":"Declan Goncalves","email":"declan@hyperbeam.com"}],"module":"dist/index.js","types":"dist/index.d.ts","dependencies":{"@types/chrome":"^0.0.178"},"readme":"# @hyperbeam/iframe\n\niframe client library for the Hyperbeam multiplayer browser API.\n\nUnfamiliar with the Hyperbeam API? Read the full documentation <a href=\"https://hyperbeam.support/API-Design-eb9874bd1ef54c22ba7197324ce22231\" target=\"_blank\">here</a>.\n\n## Table of Contents\n\n- [Features](#features)\n- [Installation](#installation)\n- [Example](#example)\n- [API](#api)\n  - [Loading multiplayer browser](#loading-multiplayer-browser)\n  - [Setting video volume](#setting-video-volume)\n  - [Getting user ID](#getting-user-id)\n  - [Setting admin token](#setting-admin-token)\n  - [Setting permissions](#setting-permissions)\n  - [Control tabs programmatically](#control-tabs-programmatically)\n  - [Listen to tab events](#listen-to-tab-events)\n\n## Features\n\n- Connect to a multiplayer browser\n- Control browser navigation programmatically\n- Query browser state and listen to events\n- Manage user control permissions\n- Set local multiplayer browser volume\n\n## Installation\n\nUsing npm:\n\n```bash\n$ npm install @hyperbeam/iframe --save\n```\n\nUsing unpkg:\n\n```html\n<script type=\"module\">\n  import Hyperbeam from \"https://unpkg.com/@hyperbeam/iframe@0.0.4/dist/index.js\"\n  // ...\n</script>\n```\n\n## Example\n\nYou can save this code snippet as `example.html` and run it in your browser. Make sure you set the embed URL variable to the response data from the [REST API](https://hyperbeam.support/Hyperbeam-API-eb9874bd1ef54c22ba7197324ce22231#d326c958e95244b89cf7ffdbcb07e9bd).\n\n```html\n<div style=\"font-family: Arial\">\n  <button id=\"reload\">Reload</button>\n  <button id=\"back\">Go Back</button>\n  <button id=\"forward\">Go Forward</button>\n  <button id=\"youtube\">Open Youtube.com</button>\n  Volume: <input type=\"range\" min=\"0\" max=\"100\" value=\"100\" id=\"range\">\n  <p>User ID: <span id=\"userId\"></span></p>\n  <p>Current website: <span id=\"currentSite\"></p>\n</div>\n<iframe id=\"iframe\" style=\"height:720px;width:1280px\"></iframe>\n<script type=\"module\">\n  import Hyperbeam from \"https://unpkg.com/@hyperbeam/iframe@0.0.4/dist/index.js\"\n  // TODO: Set the embedURL variable\n  const embedURL = \"<your-embed-url>\"\n  const hb = await Hyperbeam(iframe, embedURL)\n  userId.innerText = hb.userId\n  reload.addEventListener(\"click\", () => {\n    hb.tabs.reload()\n  })\n  back.addEventListener(\"click\", () => {\n    hb.tabs.goBack()\n  })\n  forward.addEventListener(\"click\", () => {\n    hb.tabs.goForward()\n  })\n  youtube.addEventListener(\"click\", () => {\n    hb.tabs.update({ url: \"https://youtube.com\" })\n  })\n  range.addEventListener(\"change\", (e) => {\n    hb.volume = e.target.value / 100\n  })\n  hb.tabs.onUpdated.addListener((tabId, changeInfo) => {\n    if (changeInfo.title) {\n      currentSite.innerText = changeInfo.title\n    }\n  })\n</script>\n```\n\n## API Reference\n\n### Loading multiplayer browser\n\n**Hyperbeam(iframe: IFrame, embedURL: string, opts?: HyperbeamOptions): Promise\\<HyperbeamClient\\>**\n\nCreates a new Hyperbeam IFrame client.\n\n```js\n// The embedURL is retrieved from the REST API\n// Documentation for the REST API can be found here:\n// hyperbeam.support/API-Design-eb9874bd1ef54c22ba7197324ce22231\nconst embedURL = \"https://abc.hyperbeam.com/foo?token=bar\"\nconst iframe = document.getElementById(\"iframe-id\")\n\nconst hb = await Hyperbeam(iframe, embedURL, {\n  // Number of milliseconds until the request to the multiplayer browser times out.\n  // If the request times out, the returned promise will be rejected.\n  timeout: 5000, // default = 2000\n\n  // An admin token returned from the REST API that will grant this user\n  // access to managing user permissions and programmatic navigation.\n  admin_token: \"admin_token_from_rest_api_response\",\n\n  // Starting volume of the multiplayer browser\n  volume: 0.2    // default = 1.0\n})\n```\n\n### Setting video volume\n\n**hb.volume = 0.5**\n\nSets the volume for the multiplayer browser *locally*. Volume changes only apply to the local user. This setting is *not* persisted on refreshing the page.\n\n```js\nconst hb = await Hyperbeam(iframe, embedURL)\n// Valid values range from 0.0 to 1.0\nhb.volume = 0.5 // default = 1.0\n```\n\n### Getting user ID\n\n**hb.userId: string**\n\nGets the client's user ID. A \"user\" is defined as a single connection to the multiplayer browser. If a person has multiple tabs connected to the multiplayer browser, each tab with an active connection will be assigned a different user ID.\n\n```js\nconst hb = await Hyperbeam(iframe, embedURL)\nconsole.log(hb.userId) // A unique string identifying the user\n```\n\n### Setting admin token\n\n**hb.admin_token = \"admin_token\"**\n\nSets the client's admin token. The client must have an admin token set to manage user permissions and control the tabs programmatically.\n\n```js\n// You can provide the admin token during initialization\nconst hb = await Hyperbeam(iframe, embedURL, {\n  admin_token: \"admin_token_from_rest_api_response\"\n})\n\n// In some situations, you may want to promote the user to\n// an admin after initialization. For example, promoting a \"user\" to a \"moderator\".\nconst hb = await Hyperbeam(iframe, embedURL)\nhb.admin_token = \"admin_token_from_rest_api_response\"\n```\n\n### Setting permissions\n\n**hb.setPermission(userId: string, permissionData: PremissionData): Promise\\<void\\>**\n\nSets the permission of a user by their ID. The client must have an admin token set to manage user permissions.\n\n```js\n// You can provide the admin token during initialization\nconst hb = await Hyperbeam(iframe, embedURL, {\n  admin_token: \"admin_token_from_rest_api_response\"\n})\n\nconst targetUserId = \"a_user_id\"\n\n// All keys can be omitted: if the key is omitted, then the existing value will be unchanged\nconst permissions = {\n  // Higher value = higher priority\n  // Users with a higher priority will preempt the control of lower priority users.\n  priority: 2,           // default = 0\n\n  // Number of milliseconds until a user is considered \"idle\". Once a user is considered\n  // idle, they no longer preempt lower priority users until they interact with the\n  // multiplayer browser again.\n  idle_timeout: 3000,    // default = 0\n\n  // If control_disabled = true, all control input (mouse movements, keyboard presses)\n  // will be ignored. Note that disabling control does not restrict access to any\n  // APIs that require admin tokens.\n  control_disabled: true // default = control_disable_default (see REST API)\n}\n\nhb.setPermissions(targetUserId, permissions)\n```\n\n### Control tabs programmatically\n\nHyperbeam's tab API mirrors Chrome extension tab API, found <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method\" target=\"_blank\">here</a>.\n\nRather than calling `chrome.tabs.create({ active: true })`, you will would call `hb.tabs.create({ active: true })`.\n\nWe support the following methods:\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-create\" target=\"_blank\">tabs.create</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-detectLanguage\" target=\"_blank\">tabs.detectLanguage</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-discard\" target=\"_blank\">tabs.discard</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-duplicate\" target=\"_blank\">tabs.duplicate</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-get\" target=\"_blank\">tabs.get</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-getZoom\" target=\"_blank\">tabs.getZoom</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-getZoomSettings\" target=\"_blank\">tabs.getZoomSettings</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-goBack\" target=\"_blank\">tabs.goBack</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-goForward\" target=\"_blank\">tabs.goForward</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-group\" target=\"_blank\">tabs.group</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-highlight\" target=\"_blank\">tabs.highlight</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-move\" target=\"_blank\">tabs.move</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-query\" target=\"_blank\">tabs.query</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-reload\" target=\"_blank\">tabs.reload</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-remove\" target=\"_blank\">tabs.remove</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-setZoom\" target=\"_blank\">tabs.setZoom</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-setZoomSettings\" target=\"_blank\">tabs.setZoomSettings</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-ungroup\" target=\"_blank\">tabs.ungroup</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-update\" target=\"_blank\">tabs.update</a>\n\n```js\nconst hb = await Hyperbeam(iframe, embedURL)\n\n// Create a tab\nconst tab = await hb.tabs.create({ active: true })\n\n// Duplicate a tab\nconst tab2 = await hb.tabs.duplicate(tab.id)\n\n// Set the URL of the active tab\nconst updatedTab = await hb.tabs.update({url: \"https://hyperbeam.dev/\"})\n```\n\n### Listen to tab events\n\nHyperbeam's tab event listener API mirrors Chrome extension tab API, found <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event\" target=\"_blank\">here</a>.\n\nRather than calling `chrome.tabs.onCreated.addListener((tab) => {})`, you will would call `hb.tabs.onCreated.addListener((tab) => {})`.\n\nWe support the following events:\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onActivated\" target=\"_blank\">tabs.onActivated</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onCreated\" target=\"_blank\">tabs.onCreated</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onHighlighted\" target=\"_blank\">tabs.onHighlighted</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onMoved\" target=\"_blank\">tabs.onMoved</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onRemoved\" target=\"_blank\">tabs.onRemoved</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onReplaced\" target=\"_blank\">tabs.onReplaced</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onUpdated\" target=\"_blank\">tabs.onUpdated</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onZoomChange\" target=\"_blank\">tabs.onZoomChange</a>\n\n```js\nconst hb = await Hyperbeam(iframe, embedURL)\n\nfunction onTabCreated(tab) {\n  console.log(tab.id)\n}\n\n// Listen for when a new tab is created\nhb.tabs.onCreated.addListener(onTabCreated)\n\n// Create a new tab\nawait hb.tabs.create({ active: true })\n\n// Remove the event listener\nhb.tabs.onCreated.removeListener(onTabCreated)\n```\n","readmeFilename":"README.md","gitHead":"6cf7e1936fc4812f9287b032a7fa7d2afd777ad8","_id":"@hyperbeam/iframe@0.0.5-beta.6","_nodeVersion":"16.13.2","_npmVersion":"8.5.4","dist":{"integrity":"sha512-fH3mB5JAF108E2OgmXiD4l7dvx+mzxWrHKOH1AuXqXZJ0in1jqKNYn0EGZeELXXNAkTFvJ1ch7vfLERbnHnUog==","shasum":"75b88d3f2c3cbff8a7d929c61cae3a06eb489cd6","tarball":"https://registry.npmjs.org/@hyperbeam/iframe/-/iframe-0.0.5-beta.6.tgz","fileCount":13,"unpackedSize":38150,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiMUFGACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpaDQ/7BsBKT5cNHccUyjXBO4gtEd2M0ropZXqIUdLyOdsgDXDnhTY4\r\nD3kQcdVPkOp/iYkFDLJUTljVCiyovUCxgsj8nJfuxiQpnPSLWcFZufgN4j1e\r\n7A2idm5Pa/nXNctFkKpapSnkm/eJApHjq5AWDG7PD67ETJkd9DVQ8c0JwPqX\r\nO0GxtBAtyEb1MciYJmCfjfB3J7xjQfqqCBMdN0pWH9B8HeYDU2dm9ofp5iTd\r\nkIP3BtAhKWJ3G+XHgkP3Jp8mVcPWeqY8LJXq91jvYrlZrR5pIOj72dYYMjyH\r\nPhHtQWCYewiY08v8hbB4XlE0ChKIGuAwy9tthTauH3OXTPm+nUdyNAllJwOp\r\nhyn60CkY64Zp9ur12C0QBt1vPKeQppW9OC4uvZc593iSCnde0GZ6xCfsIVmc\r\ntET0joEC7y+/+1uNcmKEHLjJM2HtgIy8W5aFMCboo6ZlhpDVvQSH4fu5+zB2\r\n9YJaVtqmfp2dsYM78l0E5gf4BQgSJAip+SgxvFFpQbfjVoVInKdI/M561Ce5\r\nCgrRk4BMHaVEtRNrvjKKttL8b/LegGH0VDejqPzj4tQKX6UfcdkdagCn3g1g\r\ntrm4K2PcrhRBbjDt1DwqhSw8uho5vOuk5AHQMH9proDQ7IFPhfXLOL4PbRTE\r\nHEbyVMf00TFP+UI2TUzgzWCi1s8CSo809Co=\r\n=rM9j\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICa6KTGyTb2ezq6hPOp6mzDBWcp5dHQMeo9LijoUcEoZAiEA+15ygB2c43I6C0Hx5k9/QNCeLICbjBT0vmQ+aWDCvUY="}]},"_npmUser":{"name":"ambyjkl","email":"ambareeshbalaji@gmail.com"},"directories":{},"maintainers":[{"name":"ambyjkl","email":"ambareeshbalaji@gmail.com"},{"name":"scottyfillups","email":"scotty@hyperbeam.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/iframe_0.0.5-beta.6_1647395142497_0.44334756674217934"},"_hasShrinkwrap":false,"deprecated":"please use https://www.npmjs.com/package/@hyperbeam/web instead"},"0.0.5-beta.7":{"name":"@hyperbeam/iframe","version":"0.0.5-beta.7","description":"iframe client library for the Hyperbeam multiplayer browser API","keywords":["hyperbeam","hyperbeam api","hyperbeam cobrowser","hyperbeam cobrowser api","hyperbeam cobrowsing","hyperbeam cobrowsing api","hyperbeam iframe","hyperbeam iframe api","hyperbeam browser","hyperbeam browser api","multiplayer browser","multiplayer browser api","shared browser","shared browser api","cobrowsing","cobrowsing api","cobrowser","cobrowser api"],"homepage":"https://hyperbeam.dev/","bugs":{"url":"https://hyperbeam.support/Get-in-touch-ad6c0bdc9d074923950a0df76ac516b0","email":"amby@hyperbeam.com"},"author":{"name":"Ambareesh Balaji","email":"amby@hyperbeam.com"},"contributors":[{"name":"Philip Scott","email":"scotty@hyperbeam.com"},{"name":"Declan Goncalves","email":"declan@hyperbeam.com"}],"module":"dist/index.js","types":"dist/index.d.ts","dependencies":{"@types/chrome":"^0.0.178"},"readme":"# @hyperbeam/iframe\n\niframe client library for the Hyperbeam multiplayer browser API.\n\nUnfamiliar with the Hyperbeam API? Read the full documentation <a href=\"https://hyperbeam.support/API-Design-eb9874bd1ef54c22ba7197324ce22231\" target=\"_blank\">here</a>.\n\n## Table of Contents\n\n- [Features](#features)\n- [Installation](#installation)\n- [Example](#example)\n- [API](#api)\n  - [Loading multiplayer browser](#loading-multiplayer-browser)\n  - [Setting video volume](#setting-video-volume)\n  - [Getting user ID](#getting-user-id)\n  - [Setting admin token](#setting-admin-token)\n  - [Setting permissions](#setting-permissions)\n  - [Control tabs programmatically](#control-tabs-programmatically)\n  - [Listen to tab events](#listen-to-tab-events)\n\n## Features\n\n- Connect to a multiplayer browser\n- Control browser navigation programmatically\n- Query browser state and listen to events\n- Manage user control permissions\n- Set local multiplayer browser volume\n\n## Installation\n\nUsing npm:\n\n```bash\n$ npm install @hyperbeam/iframe --save\n```\n\nUsing unpkg:\n\n```html\n<script type=\"module\">\n  import Hyperbeam from \"https://unpkg.com/@hyperbeam/iframe@0.0.4/dist/index.js\"\n  // ...\n</script>\n```\n\n## Example\n\nYou can save this code snippet as `example.html` and run it in your browser. Make sure you set the embed URL variable to the response data from the [REST API](https://hyperbeam.support/Hyperbeam-API-eb9874bd1ef54c22ba7197324ce22231#d326c958e95244b89cf7ffdbcb07e9bd).\n\n```html\n<div style=\"font-family: Arial\">\n  <button id=\"reload\">Reload</button>\n  <button id=\"back\">Go Back</button>\n  <button id=\"forward\">Go Forward</button>\n  <button id=\"youtube\">Open Youtube.com</button>\n  Volume: <input type=\"range\" min=\"0\" max=\"100\" value=\"100\" id=\"range\">\n  <p>User ID: <span id=\"userId\"></span></p>\n  <p>Current website: <span id=\"currentSite\"></p>\n</div>\n<iframe id=\"iframe\" style=\"height:720px;width:1280px\"></iframe>\n<script type=\"module\">\n  import Hyperbeam from \"https://unpkg.com/@hyperbeam/iframe@0.0.4/dist/index.js\"\n  // TODO: Set the embedURL variable\n  const embedURL = \"<your-embed-url>\"\n  const hb = await Hyperbeam(iframe, embedURL)\n  userId.innerText = hb.userId\n  reload.addEventListener(\"click\", () => {\n    hb.tabs.reload()\n  })\n  back.addEventListener(\"click\", () => {\n    hb.tabs.goBack()\n  })\n  forward.addEventListener(\"click\", () => {\n    hb.tabs.goForward()\n  })\n  youtube.addEventListener(\"click\", () => {\n    hb.tabs.update({ url: \"https://youtube.com\" })\n  })\n  range.addEventListener(\"change\", (e) => {\n    hb.volume = e.target.value / 100\n  })\n  hb.tabs.onUpdated.addListener((tabId, changeInfo) => {\n    if (changeInfo.title) {\n      currentSite.innerText = changeInfo.title\n    }\n  })\n</script>\n```\n\n## API Reference\n\n### Loading multiplayer browser\n\n**Hyperbeam(iframe: IFrame, embedURL: string, opts?: HyperbeamOptions): Promise\\<HyperbeamClient\\>**\n\nCreates a new Hyperbeam IFrame client.\n\n```js\n// The embedURL is retrieved from the REST API\n// Documentation for the REST API can be found here:\n// hyperbeam.support/API-Design-eb9874bd1ef54c22ba7197324ce22231\nconst embedURL = \"https://abc.hyperbeam.com/foo?token=bar\"\nconst iframe = document.getElementById(\"iframe-id\")\n\nconst hb = await Hyperbeam(iframe, embedURL, {\n  // Number of milliseconds until the request to the multiplayer browser times out.\n  // If the request times out, the returned promise will be rejected.\n  timeout: 5000, // default = 2000\n\n  // An admin token returned from the REST API that will grant this user\n  // access to managing user permissions and programmatic navigation.\n  admin_token: \"admin_token_from_rest_api_response\",\n\n  // Starting volume of the multiplayer browser\n  volume: 0.2    // default = 1.0\n})\n```\n\n### Setting video volume\n\n**hb.volume = 0.5**\n\nSets the volume for the multiplayer browser *locally*. Volume changes only apply to the local user. This setting is *not* persisted on refreshing the page.\n\n```js\nconst hb = await Hyperbeam(iframe, embedURL)\n// Valid values range from 0.0 to 1.0\nhb.volume = 0.5 // default = 1.0\n```\n\n### Getting user ID\n\n**hb.userId: string**\n\nGets the client's user ID. A \"user\" is defined as a single connection to the multiplayer browser. If a person has multiple tabs connected to the multiplayer browser, each tab with an active connection will be assigned a different user ID.\n\n```js\nconst hb = await Hyperbeam(iframe, embedURL)\nconsole.log(hb.userId) // A unique string identifying the user\n```\n\n### Setting admin token\n\n**hb.admin_token = \"admin_token\"**\n\nSets the client's admin token. The client must have an admin token set to manage user permissions and control the tabs programmatically.\n\n```js\n// You can provide the admin token during initialization\nconst hb = await Hyperbeam(iframe, embedURL, {\n  admin_token: \"admin_token_from_rest_api_response\"\n})\n\n// In some situations, you may want to promote the user to\n// an admin after initialization. For example, promoting a \"user\" to a \"moderator\".\nconst hb = await Hyperbeam(iframe, embedURL)\nhb.admin_token = \"admin_token_from_rest_api_response\"\n```\n\n### Setting permissions\n\n**hb.setPermission(userId: string, permissionData: PremissionData): Promise\\<void\\>**\n\nSets the permission of a user by their ID. The client must have an admin token set to manage user permissions.\n\n```js\n// You can provide the admin token during initialization\nconst hb = await Hyperbeam(iframe, embedURL, {\n  admin_token: \"admin_token_from_rest_api_response\"\n})\n\nconst targetUserId = \"a_user_id\"\n\n// All keys can be omitted: if the key is omitted, then the existing value will be unchanged\nconst permissions = {\n  // Higher value = higher priority\n  // Users with a higher priority will preempt the control of lower priority users.\n  priority: 2,           // default = 0\n\n  // Number of milliseconds until a user is considered \"idle\". Once a user is considered\n  // idle, they no longer preempt lower priority users until they interact with the\n  // multiplayer browser again.\n  idle_timeout: 3000,    // default = 0\n\n  // If control_disabled = true, all control input (mouse movements, keyboard presses)\n  // will be ignored. Note that disabling control does not restrict access to any\n  // APIs that require admin tokens.\n  control_disabled: true // default = control_disable_default (see REST API)\n}\n\nhb.setPermissions(targetUserId, permissions)\n```\n\n### Control tabs programmatically\n\nHyperbeam's tab API mirrors Chrome extension tab API, found <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method\" target=\"_blank\">here</a>.\n\nRather than calling `chrome.tabs.create({ active: true })`, you will would call `hb.tabs.create({ active: true })`.\n\nWe support the following methods:\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-create\" target=\"_blank\">tabs.create</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-detectLanguage\" target=\"_blank\">tabs.detectLanguage</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-discard\" target=\"_blank\">tabs.discard</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-duplicate\" target=\"_blank\">tabs.duplicate</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-get\" target=\"_blank\">tabs.get</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-getZoom\" target=\"_blank\">tabs.getZoom</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-getZoomSettings\" target=\"_blank\">tabs.getZoomSettings</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-goBack\" target=\"_blank\">tabs.goBack</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-goForward\" target=\"_blank\">tabs.goForward</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-group\" target=\"_blank\">tabs.group</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-highlight\" target=\"_blank\">tabs.highlight</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-move\" target=\"_blank\">tabs.move</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-query\" target=\"_blank\">tabs.query</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-reload\" target=\"_blank\">tabs.reload</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-remove\" target=\"_blank\">tabs.remove</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-setZoom\" target=\"_blank\">tabs.setZoom</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-setZoomSettings\" target=\"_blank\">tabs.setZoomSettings</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-ungroup\" target=\"_blank\">tabs.ungroup</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-update\" target=\"_blank\">tabs.update</a>\n\n```js\nconst hb = await Hyperbeam(iframe, embedURL)\n\n// Create a tab\nconst tab = await hb.tabs.create({ active: true })\n\n// Duplicate a tab\nconst tab2 = await hb.tabs.duplicate(tab.id)\n\n// Set the URL of the active tab\nconst updatedTab = await hb.tabs.update({url: \"https://hyperbeam.dev/\"})\n```\n\n### Listen to tab events\n\nHyperbeam's tab event listener API mirrors Chrome extension tab API, found <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event\" target=\"_blank\">here</a>.\n\nRather than calling `chrome.tabs.onCreated.addListener((tab) => {})`, you will would call `hb.tabs.onCreated.addListener((tab) => {})`.\n\nWe support the following events:\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onActivated\" target=\"_blank\">tabs.onActivated</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onCreated\" target=\"_blank\">tabs.onCreated</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onHighlighted\" target=\"_blank\">tabs.onHighlighted</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onMoved\" target=\"_blank\">tabs.onMoved</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onRemoved\" target=\"_blank\">tabs.onRemoved</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onReplaced\" target=\"_blank\">tabs.onReplaced</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onUpdated\" target=\"_blank\">tabs.onUpdated</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onZoomChange\" target=\"_blank\">tabs.onZoomChange</a>\n\n```js\nconst hb = await Hyperbeam(iframe, embedURL)\n\nfunction onTabCreated(tab) {\n  console.log(tab.id)\n}\n\n// Listen for when a new tab is created\nhb.tabs.onCreated.addListener(onTabCreated)\n\n// Create a new tab\nawait hb.tabs.create({ active: true })\n\n// Remove the event listener\nhb.tabs.onCreated.removeListener(onTabCreated)\n```\n","readmeFilename":"README.md","gitHead":"0d120e30646638884c2ba9567b88dace70301e04","_id":"@hyperbeam/iframe@0.0.5-beta.7","_nodeVersion":"16.13.2","_npmVersion":"8.5.4","dist":{"integrity":"sha512-PzH3pbZ2NjkWLmX8ZjR9KKrozyROZrzfMKyYVfc1cZkf2ROM7/gMLjjJLXdBivJmdJ8BavecYkBaSITjWy4q0Q==","shasum":"1ed996f9690e9c1fbbf1d6c9c0263e5a93938ef2","tarball":"https://registry.npmjs.org/@hyperbeam/iframe/-/iframe-0.0.5-beta.7.tgz","fileCount":4,"unpackedSize":27948,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiM92hACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrQBg//b+6yUfM1+4dyEYZ6n99gOnzEnTclmSQwfYJNBD8ZyP7QdnPG\r\nP74OAC2KvbEtbhdDyi/KbL3WPW780+YcLv7zRSJG145lrYPKuOAosdosLnFV\r\ns4geWkc1qsoQCIcPvSxZ2StWNjUQ4tXcxGHUbXEOGBv//+R/BO2FswygdIGt\r\n6JrTdoqCqENrVrFTOuV4JqdbOVJqWTekn/PxU1fYsPciwIcbRvSa0D3fV9WM\r\nINBbq7Zf/gx29DNK8yYb7bnRICh054s2ILizkkBEoLYAA7I6/Qq+m9Zu/wts\r\nqKVv9SVXSQRSZqDlsKK6fVT6go/zrwDc72109UJz1Wc+7SuC6RA2lutuYlhg\r\nCSNlnZjOYFCvrJSO4W8cGdaS4mPKSfmie7AEdDR0Oi61Hr1uY6MHD7Oow7b9\r\n9SvuTyuEZjd7qhgcB6i/GUOiCOCxFx75hQuEzIMXtNWy5B4BSve9mDDOBMZP\r\neanqtCT9BPa0Q3b7fJ6LbfloUaPccace2dzXw+KiP5atXCNlSn2Kb4+6KHI+\r\na0wokPLy1jznpv36JvyZzejwYXBazdm+LLkmuvKXG2ypmayP/5Ve7SIAjO3H\r\nXFJbma6s/ir00SxpEfDix8f6pOIBOMwZKcNue8zVogYChtxZHGQRLvq82+jj\r\nrScJx4+CRlf6BfbKhHkogRTgHqyWF1fXt3g=\r\n=1cbd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB2wGseaSuXGxgxqic12liZjPiygIYpYuvH+93Imc4oQAiEAtiydLHPgymbaIePuOtCHKuGDiNer+fwBb4uq176YbtE="}]},"_npmUser":{"name":"ambyjkl","email":"ambareeshbalaji@gmail.com"},"directories":{},"maintainers":[{"name":"ambyjkl","email":"ambareeshbalaji@gmail.com"},{"name":"scottyfillups","email":"scotty@hyperbeam.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/iframe_0.0.5-beta.7_1647566241380_0.6733611012593761"},"_hasShrinkwrap":false,"deprecated":"please use https://www.npmjs.com/package/@hyperbeam/web instead"},"0.0.5":{"name":"@hyperbeam/iframe","version":"0.0.5","description":"iframe client library for the Hyperbeam multiplayer browser API","keywords":["hyperbeam","hyperbeam api","hyperbeam cobrowser","hyperbeam cobrowser api","hyperbeam cobrowsing","hyperbeam cobrowsing api","hyperbeam iframe","hyperbeam iframe api","hyperbeam browser","hyperbeam browser api","multiplayer browser","multiplayer browser api","shared browser","shared browser api","cobrowsing","cobrowsing api","cobrowser","cobrowser api"],"homepage":"https://hyperbeam.dev/","bugs":{"url":"https://hyperbeam.support/Get-in-touch-ad6c0bdc9d074923950a0df76ac516b0","email":"amby@hyperbeam.com"},"author":{"name":"Ambareesh Balaji","email":"amby@hyperbeam.com"},"contributors":[{"name":"Philip Scott","email":"scotty@hyperbeam.com"},{"name":"Declan Goncalves","email":"declan@hyperbeam.com"}],"module":"dist/index.js","types":"dist/index.d.ts","dependencies":{"@types/chrome":"^0.0.178"},"gitHead":"23028aee854754c467f50cab3bf70d9f5eee40f3","_id":"@hyperbeam/iframe@0.0.5","_nodeVersion":"16.14.2","_npmVersion":"8.5.5","dist":{"integrity":"sha512-U0mh5vatFZ+wR8e1l+N1lB4KihbYdr/XlRWcWjiQxQYbccgMuQSPqFgaI/bQptgMpZik2eKLqHPMA0y/0JCM2w==","shasum":"c2b98b17de1cfa4f74a9b597c14520d397ce07e4","tarball":"https://registry.npmjs.org/@hyperbeam/iframe/-/iframe-0.0.5.tgz","fileCount":4,"unpackedSize":27582,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDDdb0xly9Xtkj4sVYfHYDIj3PEtTGJOUF+rFgr5+9QRAIhAKgXOakhX5KbSNHiZ1iTqMsiaLnTUHzzGoAb3GAmvF4a"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRiK2ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrhfw/+NqXWM9l98o0Ze6mQYKmM5/mCowjy56BZckqgqsi9mJYwYlmQ\r\n0UchkLHP6mHFR93QD/ALkB7iSMAzE+cwhTIsMfViLunfxDsS80sx/XA4Peb2\r\nPkueH1oB++V0cFzE3AGBbZP73x54jBLqrJvuD7QWQqugGLiOlCzLO51cUDLJ\r\n8LYWJvyiIVaY3ILguaETAyuVt5uQ6Oo9qYpL4ozItRwOZud2FRGGEDitvvab\r\ndDW2twbBAbfkXR8lsUq57JvzW+mg9Z/BZ7oVBcfQ8qKnNVgV7D6L92PlCtMV\r\nswpxsgCOrsXSutIOtxbMMMsxfY48miLWidg2yrvvURqTZIqm2trBC2D2QS79\r\ntBr5ZqjHxVp0qjD5t4jK8Wa366IGtPoQ08y+ielqLpwy5owVvF0idjJSy8U9\r\ngJnkT5srNd6l9krTfuYzd2Bh+0dZ+QOlhtUB+wq5QbLHp7NCUC/oCm7xR8RX\r\n8tN0vLoYAFGk0Uj9KkpYK2t857IXy05ZBUEt5PMLhFLAXFPy8ib1GN1zelR6\r\n6gPcDE+HwzVW9d4cei9fY8bNmT6DL6rx2tLZyyBY6xt1f7EKz8LElJMRu1Es\r\n0YzqZmthj+tGBnnc6upY4FYkk3X8urR9ajLC9Vp8wqKVXdFylsW9gAxz59ZR\r\nz/4yheTfZDXb6o2g5eikHw7zwNFkVjW5x6U=\r\n=BjjN\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ambyjkl","email":"ambareeshbalaji@gmail.com"},"directories":{},"maintainers":[{"name":"ambyjkl","email":"ambareeshbalaji@gmail.com"},{"name":"scottyfillups","email":"scotty@hyperbeam.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/iframe_0.0.5_1648763574322_0.4012555736870842"},"_hasShrinkwrap":false,"deprecated":"please use https://www.npmjs.com/package/@hyperbeam/web instead"},"0.0.6-alpha.2":{"name":"@hyperbeam/iframe","version":"0.0.6-alpha.2","description":"iframe client library for the Hyperbeam multiplayer browser API","keywords":["hyperbeam","hyperbeam api","hyperbeam cobrowser","hyperbeam cobrowser api","hyperbeam cobrowsing","hyperbeam cobrowsing api","hyperbeam iframe","hyperbeam iframe api","hyperbeam browser","hyperbeam browser api","multiplayer browser","multiplayer browser api","shared browser","shared browser api","cobrowsing","cobrowsing api","cobrowser","cobrowser api"],"homepage":"https://hyperbeam.dev/","bugs":{"url":"https://hyperbeam.support/Get-in-touch-ad6c0bdc9d074923950a0df76ac516b0","email":"amby@hyperbeam.com"},"author":{"name":"Ambareesh Balaji","email":"amby@hyperbeam.com"},"contributors":[{"name":"Philip Scott","email":"scotty@hyperbeam.com"},{"name":"Declan Goncalves","email":"declan@hyperbeam.com"}],"module":"dist/index.js","types":"dist/index.d.ts","dependencies":{"@types/chrome":"^0.0.178"},"readme":"# @hyperbeam/iframe\n\niframe client library for the Hyperbeam multiplayer browser API.\n\nUnfamiliar with the Hyperbeam API? Read the full documentation <a href=\"https://hyperbeam.support/API-Design-eb9874bd1ef54c22ba7197324ce22231\" target=\"_blank\">here</a>.\n\n## Table of Contents\n\n- [Features](#features)\n- [Installation](#installation)\n- [Example](#example)\n- [API](#api)\n  - [Loading multiplayer browser](#loading-multiplayer-browser)\n  - [Setting video volume](#setting-video-volume)\n  - [Getting user ID](#getting-user-id)\n  - [Setting admin token](#setting-admin-token)\n  - [Setting permissions](#setting-permissions)\n  - [Control tabs programmatically](#control-tabs-programmatically)\n  - [Listen to tab events](#listen-to-tab-events)\n\n## Features\n\n- Connect to a multiplayer browser\n- Control browser navigation programmatically\n- Query browser state and listen to events\n- Manage user control permissions\n- Set local multiplayer browser volume\n\n## Installation\n\nUsing npm:\n\n```bash\n$ npm install @hyperbeam/iframe --save\n```\n\nUsing unpkg:\n\n```html\n<script type=\"module\">\n  import Hyperbeam from \"https://unpkg.com/@hyperbeam/iframe@0.0.4/dist/index.js\"\n  // ...\n</script>\n```\n\n## Example\n\nYou can save this code snippet as `example.html` and run it in your browser. Make sure you set the embed URL variable to the response data from the [REST API](https://hyperbeam.support/Hyperbeam-API-eb9874bd1ef54c22ba7197324ce22231#d326c958e95244b89cf7ffdbcb07e9bd).\n\n```html\n<div style=\"font-family: Arial\">\n  <button id=\"reload\">Reload</button>\n  <button id=\"back\">Go Back</button>\n  <button id=\"forward\">Go Forward</button>\n  <button id=\"youtube\">Open Youtube.com</button>\n  Volume: <input type=\"range\" min=\"0\" max=\"100\" value=\"100\" id=\"range\">\n  <p>User ID: <span id=\"userId\"></span></p>\n  <p>Current website: <span id=\"currentSite\"></p>\n</div>\n<iframe id=\"iframe\" style=\"height:720px;width:1280px\"></iframe>\n<script type=\"module\">\n  import Hyperbeam from \"https://unpkg.com/@hyperbeam/iframe@0.0.4/dist/index.js\"\n  // TODO: Set the embedURL variable\n  const embedURL = \"<your-embed-url>\"\n  const hb = await Hyperbeam(iframe, embedURL)\n  userId.innerText = hb.userId\n  reload.addEventListener(\"click\", () => {\n    hb.tabs.reload()\n  })\n  back.addEventListener(\"click\", () => {\n    hb.tabs.goBack()\n  })\n  forward.addEventListener(\"click\", () => {\n    hb.tabs.goForward()\n  })\n  youtube.addEventListener(\"click\", () => {\n    hb.tabs.update({ url: \"https://youtube.com\" })\n  })\n  range.addEventListener(\"change\", (e) => {\n    hb.volume = e.target.value / 100\n  })\n  hb.tabs.onUpdated.addListener((tabId, changeInfo) => {\n    if (changeInfo.title) {\n      currentSite.innerText = changeInfo.title\n    }\n  })\n</script>\n```\n\n## API Reference\n\n### Loading multiplayer browser\n\n**Hyperbeam(iframe: IFrame, embedURL: string, opts?: HyperbeamOptions): Promise\\<HyperbeamClient\\>**\n\nCreates a new Hyperbeam IFrame client.\n\n```js\n// The embedURL is retrieved from the REST API\n// Documentation for the REST API can be found here:\n// hyperbeam.support/API-Design-eb9874bd1ef54c22ba7197324ce22231\nconst embedURL = \"https://abc.hyperbeam.com/foo?token=bar\"\nconst iframe = document.getElementById(\"iframe-id\")\n\nconst hb = await Hyperbeam(iframe, embedURL, {\n  // Number of milliseconds until the request to the multiplayer browser times out.\n  // If the request times out, the returned promise will be rejected.\n  timeout: 5000, // default = 2000\n\n  // An admin token returned from the REST API that will grant this user\n  // access to managing user permissions and programmatic navigation.\n  admin_token: \"admin_token_from_rest_api_response\",\n\n  // Starting volume of the multiplayer browser\n  volume: 0.2    // default = 1.0\n})\n```\n\n### Setting video volume\n\n**hb.volume = 0.5**\n\nSets the volume for the multiplayer browser *locally*. Volume changes only apply to the local user. This setting is *not* persisted on refreshing the page.\n\n```js\nconst hb = await Hyperbeam(iframe, embedURL)\n// Valid values range from 0.0 to 1.0\nhb.volume = 0.5 // default = 1.0\n```\n\n### Getting user ID\n\n**hb.userId: string**\n\nGets the client's user ID. A \"user\" is defined as a single connection to the multiplayer browser. If a person has multiple tabs connected to the multiplayer browser, each tab with an active connection will be assigned a different user ID.\n\n```js\nconst hb = await Hyperbeam(iframe, embedURL)\nconsole.log(hb.userId) // A unique string identifying the user\n```\n\n### Setting admin token\n\n**hb.admin_token = \"admin_token\"**\n\nSets the client's admin token. The client must have an admin token set to manage user permissions and control the tabs programmatically.\n\n```js\n// You can provide the admin token during initialization\nconst hb = await Hyperbeam(iframe, embedURL, {\n  admin_token: \"admin_token_from_rest_api_response\"\n})\n\n// In some situations, you may want to promote the user to\n// an admin after initialization. For example, promoting a \"user\" to a \"moderator\".\nconst hb = await Hyperbeam(iframe, embedURL)\nhb.admin_token = \"admin_token_from_rest_api_response\"\n```\n\n### Setting permissions\n\n**hb.setPermission(userId: string, permissionData: PremissionData): Promise\\<void\\>**\n\nSets the permission of a user by their ID. The client must have an admin token set to manage user permissions.\n\n```js\n// You can provide the admin token during initialization\nconst hb = await Hyperbeam(iframe, embedURL, {\n  admin_token: \"admin_token_from_rest_api_response\"\n})\n\nconst targetUserId = \"a_user_id\"\n\n// All keys can be omitted: if the key is omitted, then the existing value will be unchanged\nconst permissions = {\n  // Higher value = higher priority\n  // Users with a higher priority will preempt the control of lower priority users.\n  priority: 2,           // default = 0\n\n  // Number of milliseconds until a user is considered \"idle\". Once a user is considered\n  // idle, they no longer preempt lower priority users until they interact with the\n  // multiplayer browser again.\n  idle_timeout: 3000,    // default = 0\n\n  // If control_disabled = true, all control input (mouse movements, keyboard presses)\n  // will be ignored. Note that disabling control does not restrict access to any\n  // APIs that require admin tokens.\n  control_disabled: true // default = control_disable_default (see REST API)\n}\n\nhb.setPermissions(targetUserId, permissions)\n```\n\n### Control tabs programmatically\n\nHyperbeam's tab API mirrors Chrome extension tab API, found <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method\" target=\"_blank\">here</a>.\n\nRather than calling `chrome.tabs.create({ active: true })`, you will would call `hb.tabs.create({ active: true })`.\n\nWe support the following methods:\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-create\" target=\"_blank\">tabs.create</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-detectLanguage\" target=\"_blank\">tabs.detectLanguage</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-discard\" target=\"_blank\">tabs.discard</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-duplicate\" target=\"_blank\">tabs.duplicate</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-get\" target=\"_blank\">tabs.get</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-getZoom\" target=\"_blank\">tabs.getZoom</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-getZoomSettings\" target=\"_blank\">tabs.getZoomSettings</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-goBack\" target=\"_blank\">tabs.goBack</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-goForward\" target=\"_blank\">tabs.goForward</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-group\" target=\"_blank\">tabs.group</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-highlight\" target=\"_blank\">tabs.highlight</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-move\" target=\"_blank\">tabs.move</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-query\" target=\"_blank\">tabs.query</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-reload\" target=\"_blank\">tabs.reload</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-remove\" target=\"_blank\">tabs.remove</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-setZoom\" target=\"_blank\">tabs.setZoom</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-setZoomSettings\" target=\"_blank\">tabs.setZoomSettings</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-ungroup\" target=\"_blank\">tabs.ungroup</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-update\" target=\"_blank\">tabs.update</a>\n\n```js\nconst hb = await Hyperbeam(iframe, embedURL)\n\n// Create a tab\nconst tab = await hb.tabs.create({ active: true })\n\n// Duplicate a tab\nconst tab2 = await hb.tabs.duplicate(tab.id)\n\n// Set the URL of the active tab\nconst updatedTab = await hb.tabs.update({url: \"https://hyperbeam.dev/\"})\n```\n\n### Listen to tab events\n\nHyperbeam's tab event listener API mirrors Chrome extension tab API, found <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event\" target=\"_blank\">here</a>.\n\nRather than calling `chrome.tabs.onCreated.addListener((tab) => {})`, you will would call `hb.tabs.onCreated.addListener((tab) => {})`.\n\nWe support the following events:\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onActivated\" target=\"_blank\">tabs.onActivated</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onCreated\" target=\"_blank\">tabs.onCreated</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onHighlighted\" target=\"_blank\">tabs.onHighlighted</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onMoved\" target=\"_blank\">tabs.onMoved</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onRemoved\" target=\"_blank\">tabs.onRemoved</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onReplaced\" target=\"_blank\">tabs.onReplaced</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onUpdated\" target=\"_blank\">tabs.onUpdated</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onZoomChange\" target=\"_blank\">tabs.onZoomChange</a>\n\n```js\nconst hb = await Hyperbeam(iframe, embedURL)\n\nfunction onTabCreated(tab) {\n  console.log(tab.id)\n}\n\n// Listen for when a new tab is created\nhb.tabs.onCreated.addListener(onTabCreated)\n\n// Create a new tab\nawait hb.tabs.create({ active: true })\n\n// Remove the event listener\nhb.tabs.onCreated.removeListener(onTabCreated)\n```\n","readmeFilename":"README.md","gitHead":"3e45cbbe8ff479de5e0593305bd1aaf71dd58815","_id":"@hyperbeam/iframe@0.0.6-alpha.2","_nodeVersion":"16.14.2","_npmVersion":"8.5.5","dist":{"integrity":"sha512-TK+ZCdlx7dpDp1guQKKLKsJyHFNQmxCW1gktfKorlL7d9uZZUN/1L7b+HKIuyyouA6ZKlD29HRBXY/2nAClsAA==","shasum":"a03185c524aa7198af7ab15eccd0f9f8142ade36","tarball":"https://registry.npmjs.org/@hyperbeam/iframe/-/iframe-0.0.6-alpha.2.tgz","fileCount":4,"unpackedSize":28317,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDZSB5HDxHyWShxQQ52eDOjfY/EyH6W2y1J3mCOAnG2zwIhAOE0fcHKAKqzduHCkL/69uRfTOlOADrhsmtC9ZfEZ1eV"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiTZfYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp+VQ//d3LQXIA8glQQLgmlWru+paznzVzN7qV5GFjjNtTvz7Zhrv5/\r\nY00lDo/7rZoLAZRUz2UsDAyEfQS5QtS3YMYkRRo7Iz7c/s+MusqqMTrmTS+R\r\nWgoK1r/ZEXeyg/OxclNNX3xU0jShx3V82NQ8a4Hm3/NMxPelw1EYiURw7CVK\r\nn5YgkWc4l5K+CdDBLT/eha+241KG5P9bm8RrMijGWLTEkQfiQjPjkKdzEDJy\r\nfEu/uh5Q8dL4eHKrHSZ2vFr1M4ZWC6iVSfK8DT0cv9T10gGijyD3UIlWR4MK\r\nKNZL+8T6/TR/yyLoJgTSRV8wLGAOM2B1LOu3qTgc5uJdgT0unvhkrxCLd6DZ\r\nFEcJ+aQepmM2Td2HatQY2zpgTILeJnOtc1ihtzFADCRR6jke1Fi/eB2GmHsN\r\nE2JFDyCEyb2ueDzHzYVZ8IsQmW//dvvhe4/cvZXUqhilcZsHkIKlA163UqHr\r\noF4k0f2/Neg4patgfyH3W7gxtMKmiKmwjDOb9jiukA86+JtnsIzKv7lcrUKQ\r\n/ZOkq8cI1OXjO3/Nmpb28qk1seF3SHCWO6d/IM+b+5LXfv6F6KT6MihoGqq6\r\nyLuik5BCmP4AyL6vXibpMjA/NBQ1t3QSRT2dx8wQd2KwOG3h1d3GRP928kyK\r\nmsSP2njwggpour8h8e/FMsZxMWyaJLTHOZo=\r\n=xzbE\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ambyjkl","email":"ambareeshbalaji@gmail.com"},"directories":{},"maintainers":[{"name":"ambyjkl","email":"ambareeshbalaji@gmail.com"},{"name":"scottyfillups","email":"scotty@hyperbeam.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/iframe_0.0.6-alpha.2_1649252311887_0.46906072037603797"},"_hasShrinkwrap":false,"deprecated":"please use https://www.npmjs.com/package/@hyperbeam/web instead"},"0.0.6-alpha.3":{"name":"@hyperbeam/iframe","version":"0.0.6-alpha.3","description":"iframe client library for the Hyperbeam multiplayer browser API","keywords":["hyperbeam","hyperbeam api","hyperbeam cobrowser","hyperbeam cobrowser api","hyperbeam cobrowsing","hyperbeam cobrowsing api","hyperbeam iframe","hyperbeam iframe api","hyperbeam browser","hyperbeam browser api","multiplayer browser","multiplayer browser api","shared browser","shared browser api","cobrowsing","cobrowsing api","cobrowser","cobrowser api"],"homepage":"https://hyperbeam.dev/","bugs":{"url":"https://hyperbeam.support/Get-in-touch-ad6c0bdc9d074923950a0df76ac516b0","email":"amby@hyperbeam.com"},"author":{"name":"Ambareesh Balaji","email":"amby@hyperbeam.com"},"contributors":[{"name":"Philip Scott","email":"scotty@hyperbeam.com"},{"name":"Declan Goncalves","email":"declan@hyperbeam.com"}],"module":"dist/index.js","types":"dist/index.d.ts","dependencies":{"@types/chrome":"^0.0.178"},"readme":"# @hyperbeam/iframe\n\niframe client library for the Hyperbeam multiplayer browser API.\n\nUnfamiliar with the Hyperbeam API? Read the full documentation <a href=\"https://hyperbeam.support/API-Design-eb9874bd1ef54c22ba7197324ce22231\" target=\"_blank\">here</a>.\n\n## Table of Contents\n\n- [Features](#features)\n- [Installation](#installation)\n- [Example](#example)\n- [API](#api)\n  - [Loading multiplayer browser](#loading-multiplayer-browser)\n  - [Setting video volume](#setting-video-volume)\n  - [Getting user ID](#getting-user-id)\n  - [Setting admin token](#setting-admin-token)\n  - [Setting permissions](#setting-permissions)\n  - [Control tabs programmatically](#control-tabs-programmatically)\n  - [Listen to tab events](#listen-to-tab-events)\n\n## Features\n\n- Connect to a multiplayer browser\n- Control browser navigation programmatically\n- Query browser state and listen to events\n- Manage user control permissions\n- Set local multiplayer browser volume\n\n## Installation\n\nUsing npm:\n\n```bash\n$ npm install @hyperbeam/iframe --save\n```\n\nUsing unpkg:\n\n```html\n<script type=\"module\">\n  import Hyperbeam from \"https://unpkg.com/@hyperbeam/iframe@0.0.4/dist/index.js\"\n  // ...\n</script>\n```\n\n## Example\n\nYou can save this code snippet as `example.html` and run it in your browser. Make sure you set the embed URL variable to the response data from the [REST API](https://hyperbeam.support/Hyperbeam-API-eb9874bd1ef54c22ba7197324ce22231#d326c958e95244b89cf7ffdbcb07e9bd).\n\n```html\n<div style=\"font-family: Arial\">\n  <button id=\"reload\">Reload</button>\n  <button id=\"back\">Go Back</button>\n  <button id=\"forward\">Go Forward</button>\n  <button id=\"youtube\">Open Youtube.com</button>\n  Volume: <input type=\"range\" min=\"0\" max=\"100\" value=\"100\" id=\"range\">\n  <p>User ID: <span id=\"userId\"></span></p>\n  <p>Current website: <span id=\"currentSite\"></p>\n</div>\n<iframe id=\"iframe\" style=\"height:720px;width:1280px\"></iframe>\n<script type=\"module\">\n  import Hyperbeam from \"https://unpkg.com/@hyperbeam/iframe@0.0.4/dist/index.js\"\n  // TODO: Set the embedURL variable\n  const embedURL = \"<your-embed-url>\"\n  const hb = await Hyperbeam(iframe, embedURL)\n  userId.innerText = hb.userId\n  reload.addEventListener(\"click\", () => {\n    hb.tabs.reload()\n  })\n  back.addEventListener(\"click\", () => {\n    hb.tabs.goBack()\n  })\n  forward.addEventListener(\"click\", () => {\n    hb.tabs.goForward()\n  })\n  youtube.addEventListener(\"click\", () => {\n    hb.tabs.update({ url: \"https://youtube.com\" })\n  })\n  range.addEventListener(\"change\", (e) => {\n    hb.volume = e.target.value / 100\n  })\n  hb.tabs.onUpdated.addListener((tabId, changeInfo) => {\n    if (changeInfo.title) {\n      currentSite.innerText = changeInfo.title\n    }\n  })\n</script>\n```\n\n## API Reference\n\n### Loading multiplayer browser\n\n**Hyperbeam(iframe: IFrame, embedURL: string, opts?: HyperbeamOptions): Promise\\<HyperbeamClient\\>**\n\nCreates a new Hyperbeam IFrame client.\n\n```js\n// The embedURL is retrieved from the REST API\n// Documentation for the REST API can be found here:\n// hyperbeam.support/API-Design-eb9874bd1ef54c22ba7197324ce22231\nconst embedURL = \"https://abc.hyperbeam.com/foo?token=bar\"\nconst iframe = document.getElementById(\"iframe-id\")\n\nconst hb = await Hyperbeam(iframe, embedURL, {\n  // Number of milliseconds until the request to the multiplayer browser times out.\n  // If the request times out, the returned promise will be rejected.\n  timeout: 5000, // default = 2000\n\n  // An admin token returned from the REST API that will grant this user\n  // access to managing user permissions and programmatic navigation.\n  admin_token: \"admin_token_from_rest_api_response\",\n\n  // Starting volume of the multiplayer browser\n  volume: 0.2    // default = 1.0\n})\n```\n\n### Setting video volume\n\n**hb.volume = 0.5**\n\nSets the volume for the multiplayer browser *locally*. Volume changes only apply to the local user. This setting is *not* persisted on refreshing the page.\n\n```js\nconst hb = await Hyperbeam(iframe, embedURL)\n// Valid values range from 0.0 to 1.0\nhb.volume = 0.5 // default = 1.0\n```\n\n### Getting user ID\n\n**hb.userId: string**\n\nGets the client's user ID. A \"user\" is defined as a single connection to the multiplayer browser. If a person has multiple tabs connected to the multiplayer browser, each tab with an active connection will be assigned a different user ID.\n\n```js\nconst hb = await Hyperbeam(iframe, embedURL)\nconsole.log(hb.userId) // A unique string identifying the user\n```\n\n### Setting admin token\n\n**hb.admin_token = \"admin_token\"**\n\nSets the client's admin token. The client must have an admin token set to manage user permissions and control the tabs programmatically.\n\n```js\n// You can provide the admin token during initialization\nconst hb = await Hyperbeam(iframe, embedURL, {\n  admin_token: \"admin_token_from_rest_api_response\"\n})\n\n// In some situations, you may want to promote the user to\n// an admin after initialization. For example, promoting a \"user\" to a \"moderator\".\nconst hb = await Hyperbeam(iframe, embedURL)\nhb.admin_token = \"admin_token_from_rest_api_response\"\n```\n\n### Setting permissions\n\n**hb.setPermission(userId: string, permissionData: PremissionData): Promise\\<void\\>**\n\nSets the permission of a user by their ID. The client must have an admin token set to manage user permissions.\n\n```js\n// You can provide the admin token during initialization\nconst hb = await Hyperbeam(iframe, embedURL, {\n  admin_token: \"admin_token_from_rest_api_response\"\n})\n\nconst targetUserId = \"a_user_id\"\n\n// All keys can be omitted: if the key is omitted, then the existing value will be unchanged\nconst permissions = {\n  // Higher value = higher priority\n  // Users with a higher priority will preempt the control of lower priority users.\n  priority: 2,           // default = 0\n\n  // Number of milliseconds until a user is considered \"idle\". Once a user is considered\n  // idle, they no longer preempt lower priority users until they interact with the\n  // multiplayer browser again.\n  idle_timeout: 3000,    // default = 0\n\n  // If control_disabled = true, all control input (mouse movements, keyboard presses)\n  // will be ignored. Note that disabling control does not restrict access to any\n  // APIs that require admin tokens.\n  control_disabled: true // default = control_disable_default (see REST API)\n}\n\nhb.setPermissions(targetUserId, permissions)\n```\n\n### Control tabs programmatically\n\nHyperbeam's tab API mirrors Chrome extension tab API, found <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method\" target=\"_blank\">here</a>.\n\nRather than calling `chrome.tabs.create({ active: true })`, you will would call `hb.tabs.create({ active: true })`.\n\nWe support the following methods:\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-create\" target=\"_blank\">tabs.create</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-detectLanguage\" target=\"_blank\">tabs.detectLanguage</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-discard\" target=\"_blank\">tabs.discard</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-duplicate\" target=\"_blank\">tabs.duplicate</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-get\" target=\"_blank\">tabs.get</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-getZoom\" target=\"_blank\">tabs.getZoom</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-getZoomSettings\" target=\"_blank\">tabs.getZoomSettings</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-goBack\" target=\"_blank\">tabs.goBack</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-goForward\" target=\"_blank\">tabs.goForward</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-group\" target=\"_blank\">tabs.group</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-highlight\" target=\"_blank\">tabs.highlight</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-move\" target=\"_blank\">tabs.move</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-query\" target=\"_blank\">tabs.query</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-reload\" target=\"_blank\">tabs.reload</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-remove\" target=\"_blank\">tabs.remove</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-setZoom\" target=\"_blank\">tabs.setZoom</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-setZoomSettings\" target=\"_blank\">tabs.setZoomSettings</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-ungroup\" target=\"_blank\">tabs.ungroup</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-update\" target=\"_blank\">tabs.update</a>\n\n```js\nconst hb = await Hyperbeam(iframe, embedURL)\n\n// Create a tab\nconst tab = await hb.tabs.create({ active: true })\n\n// Duplicate a tab\nconst tab2 = await hb.tabs.duplicate(tab.id)\n\n// Set the URL of the active tab\nconst updatedTab = await hb.tabs.update({url: \"https://hyperbeam.dev/\"})\n```\n\n### Listen to tab events\n\nHyperbeam's tab event listener API mirrors Chrome extension tab API, found <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event\" target=\"_blank\">here</a>.\n\nRather than calling `chrome.tabs.onCreated.addListener((tab) => {})`, you will would call `hb.tabs.onCreated.addListener((tab) => {})`.\n\nWe support the following events:\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onActivated\" target=\"_blank\">tabs.onActivated</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onCreated\" target=\"_blank\">tabs.onCreated</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onHighlighted\" target=\"_blank\">tabs.onHighlighted</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onMoved\" target=\"_blank\">tabs.onMoved</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onRemoved\" target=\"_blank\">tabs.onRemoved</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onReplaced\" target=\"_blank\">tabs.onReplaced</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onUpdated\" target=\"_blank\">tabs.onUpdated</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onZoomChange\" target=\"_blank\">tabs.onZoomChange</a>\n\n```js\nconst hb = await Hyperbeam(iframe, embedURL)\n\nfunction onTabCreated(tab) {\n  console.log(tab.id)\n}\n\n// Listen for when a new tab is created\nhb.tabs.onCreated.addListener(onTabCreated)\n\n// Create a new tab\nawait hb.tabs.create({ active: true })\n\n// Remove the event listener\nhb.tabs.onCreated.removeListener(onTabCreated)\n```\n","readmeFilename":"README.md","gitHead":"3e45cbbe8ff479de5e0593305bd1aaf71dd58815","_id":"@hyperbeam/iframe@0.0.6-alpha.3","_nodeVersion":"16.14.2","_npmVersion":"8.5.5","dist":{"integrity":"sha512-iRGmHP6fnGj4joHoBcvqv35MJ4ZtWb6wcrrNadg4PFnpXE3KlpsByQ+xe4WSPDZMwMIk7rjci1l8rpjJWZg1sQ==","shasum":"0c8f8b9f04994665a04168e3a9d5c940a276a702","tarball":"https://registry.npmjs.org/@hyperbeam/iframe/-/iframe-0.0.6-alpha.3.tgz","fileCount":4,"unpackedSize":28324,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC0eVjCusYE7McaYf7HNhr533+wXCoA8ywgitpXZ9ykJAiEAmlfJKv9HY9BFotTjldE15zBG6LEnFP8vK7BSE870Xfw="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiTZ14ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmro7Q/8CotwvFh7SC2Yhh95HQ/YPRebAO8txZ35pEkdKI1gZYj0jMTd\r\nl05P//VkNvQu5qJScNqGlmtF8WfYO56wJ43ZiLC7BhrEGzB5A+QeWX3WEYOK\r\nex2sqHqi6oRBZ9QtlIkQh0hqiWl6oPORTFz6VigdWjDZ0hLLtaKrArRxQfJt\r\nJMTlQEJsyBxvjwR878I3f4H/pN/0oLP8xsl5vUxTByS6ZS0Do+JCnQKOhHUL\r\n3bqSnNGrWF0E/fXxYGFuxT2YOTj+uAfnZ0vdWHbfdFLthJQCGlrX0DDX6xmm\r\nhGpgVEIRGYMQvqMYteaTZmeRwRf0iX62UH5os08wVVa4s7NEgn/Jtczgu/i7\r\nb8npH6gg21NnxULBDA0DpjCzsNeGHgd2Nafx4qgHVjH8qKmKInCiXftu9tZr\r\nRFCsq63up4F8Yb/tsHHyc1r0T65j+oA8S8KMA/oN5E+wrSXT+G19OhCic79t\r\nHMzH9J4ufSCklofBr+MOzBphvJfHyDH2XDa1I9dKMUJFvXI70n8LnqofCtxE\r\nGlqsxpEgVbcA2jmBl1eBBZGUArcsajDgBt72I2WB/LiMyxq4+RBuSqxWfPTk\r\n4E187ypWI3MPzh/UotkScr4471zpzxtj2kV/fWQbUhEevFCg32VJleHDXf/N\r\nvnkWgXhqd/JyXahs2G3gVfQ2U8NmkYHbKP0=\r\n=H03y\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ambyjkl","email":"ambareeshbalaji@gmail.com"},"directories":{},"maintainers":[{"name":"ambyjkl","email":"ambareeshbalaji@gmail.com"},{"name":"scottyfillups","email":"scotty@hyperbeam.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/iframe_0.0.6-alpha.3_1649253751966_0.11960255519937846"},"_hasShrinkwrap":false,"deprecated":"please use https://www.npmjs.com/package/@hyperbeam/web instead"},"0.0.6":{"name":"@hyperbeam/iframe","version":"0.0.6","description":"iframe client library for the Hyperbeam multiplayer browser API","keywords":["hyperbeam","hyperbeam api","hyperbeam cobrowser","hyperbeam cobrowser api","hyperbeam cobrowsing","hyperbeam cobrowsing api","hyperbeam iframe","hyperbeam iframe api","hyperbeam browser","hyperbeam browser api","multiplayer browser","multiplayer browser api","shared browser","shared browser api","cobrowsing","cobrowsing api","cobrowser","cobrowser api"],"homepage":"https://hyperbeam.dev/","bugs":{"url":"https://hyperbeam.support/Get-in-touch-ad6c0bdc9d074923950a0df76ac516b0","email":"amby@hyperbeam.com"},"author":{"name":"Ambareesh Balaji","email":"amby@hyperbeam.com"},"contributors":[{"name":"Philip Scott","email":"scotty@hyperbeam.com"},{"name":"Declan Goncalves","email":"declan@hyperbeam.com"}],"module":"dist/index.js","types":"dist/index.d.ts","dependencies":{"@types/chrome":"^0.0.178"},"gitHead":"19cb56f8bebfcef53ffc33aea44c91a90225a913","_id":"@hyperbeam/iframe@0.0.6","_nodeVersion":"16.14.2","_npmVersion":"8.5.5","dist":{"integrity":"sha512-wOCfjfwQDiHoBYYq5SscLvMX3COGDv11U9FW0A3ldqrjxLcxppyEe6S6/Y8nqTykeL7Xc46j/b/c6n3WXF+plw==","shasum":"535032c0a773145a1d135aba951cf3011b132426","tarball":"https://registry.npmjs.org/@hyperbeam/iframe/-/iframe-0.0.6.tgz","fileCount":4,"unpackedSize":27684,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD0UhavrZQoFkrZWivq7yvUd1qM2sPYTnioaYXCJFTFiAIgGH2Nms9zHGBUVm8HXaKjgAinqXOWlX9s++tn95ZSnrE="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiXxyjACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoYFg/5AaYj4Ja+UEYvdoCRAM4tSejf2SsqRoxCBiz5VoSNbmSC4nT9\r\ntQtZat7h//9JucTk4yVxcaxJf6+3Eg99CFJSYQ/x9ys7QCNzYvtcJ2rvkGHe\r\nc4uRco7tBPAlny6D/rLOPK/CaYIMD0mQxayJ3k/y7v2/+DLsK63aqX7a6PCg\r\nUetz9GABPlUvAoOTb0x5Qqt4h5GCERU76SIWjelTuDOY3OHIoFtSA5ambA8g\r\nDfDpqilqktdYppwk4pJDsk+VPuzhmqNZNKvDT0VH8JtGIvjuJwvxiL1qa6hC\r\nI03B9dnaRLaDhYEx8hPKAiYRNrlrU8+ThzDYDsL48QjFJFIcoaaYO5EbdE6R\r\nUFycBAq4q4cwcw0X5SfjYk0pCaKzIPm3ndGqh03Wa5dLCrD4gGWD+iEqvQsa\r\nbU4ZUR34+CY7RgttDfRGjL/DG5Ip0QtBY43OHDxbrQisrvr9OFLScksVAvSR\r\nm2A161aesizfmQ+8WIA1mZjaDDy7qT+9QfOvGKxohbRyNR+iX7lM0WKA2tAC\r\nMvb/9cM/04CZhIlEss1vQa3L/F2Y/WTt8jzMhPGJL/A0zLO+ZvLi6kAY34je\r\nM3OWQEKCj8dvMZw1oz9PV9riuebFL6fil6ChtMZlF5X/Px5LYxTHHSBzjrM4\r\nQ1lDLhOaasultXEm7ZKjI9YibEZzgOl1FGE=\r\n=SH3K\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ambyjkl","email":"ambareeshbalaji@gmail.com"},"directories":{},"maintainers":[{"name":"ambyjkl","email":"ambareeshbalaji@gmail.com"},{"name":"scottyfillups","email":"scotty@hyperbeam.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/iframe_0.0.6_1650400419828_0.937618062119735"},"_hasShrinkwrap":false,"deprecated":"please use https://www.npmjs.com/package/@hyperbeam/web instead"},"0.0.7-alpha.1":{"name":"@hyperbeam/iframe","version":"0.0.7-alpha.1","description":"iframe client library for the Hyperbeam multiplayer browser API","keywords":["hyperbeam","hyperbeam api","hyperbeam cobrowser","hyperbeam cobrowser api","hyperbeam cobrowsing","hyperbeam cobrowsing api","hyperbeam iframe","hyperbeam iframe api","hyperbeam browser","hyperbeam browser api","multiplayer browser","multiplayer browser api","shared browser","shared browser api","cobrowsing","cobrowsing api","cobrowser","cobrowser api"],"homepage":"https://hyperbeam.dev/","bugs":{"url":"https://hyperbeam.support/Get-in-touch-ad6c0bdc9d074923950a0df76ac516b0","email":"amby@hyperbeam.com"},"author":{"name":"Ambareesh Balaji","email":"amby@hyperbeam.com"},"contributors":[{"name":"Philip Scott","email":"scotty@hyperbeam.com"},{"name":"Declan Goncalves","email":"declan@hyperbeam.com"}],"module":"dist/index.js","types":"dist/index.d.ts","dependencies":{"@types/chrome":"^0.0.178"},"readme":"# @hyperbeam/iframe\n\niframe client library for the Hyperbeam multiplayer browser API.\n\nUnfamiliar with the Hyperbeam API? Read the full documentation <a href=\"https://hyperbeam.support/API-Design-eb9874bd1ef54c22ba7197324ce22231\" target=\"_blank\">here</a>.\n\n## Table of Contents\n\n- [Features](#features)\n- [Installation](#installation)\n- [Example](#example)\n- [API](#api)\n  - [Loading multiplayer browser](#loading-multiplayer-browser)\n  - [Setting video volume](#setting-video-volume)\n  - [Getting user ID](#getting-user-id)\n  - [Setting admin token](#setting-admin-token)\n  - [Setting permissions](#setting-permissions)\n  - [Control tabs programmatically](#control-tabs-programmatically)\n  - [Listen to tab events](#listen-to-tab-events)\n\n## Features\n\n- Connect to a multiplayer browser\n- Control browser navigation programmatically\n- Query browser state and listen to events\n- Manage user control permissions\n- Set local multiplayer browser volume\n\n## Installation\n\nUsing npm:\n\n```bash\n$ npm install @hyperbeam/iframe --save\n```\n\nUsing unpkg:\n\n```html\n<script type=\"module\">\n  import Hyperbeam from \"https://unpkg.com/@hyperbeam/iframe@0.0.4/dist/index.js\"\n  // ...\n</script>\n```\n\n## Example\n\nYou can save this code snippet as `example.html` and run it in your browser. Make sure you set the embed URL variable to the response data from the [REST API](https://hyperbeam.support/Hyperbeam-API-eb9874bd1ef54c22ba7197324ce22231#d326c958e95244b89cf7ffdbcb07e9bd).\n\n```html\n<div style=\"font-family: Arial\">\n  <button id=\"reload\">Reload</button>\n  <button id=\"back\">Go Back</button>\n  <button id=\"forward\">Go Forward</button>\n  <button id=\"youtube\">Open Youtube.com</button>\n  Volume: <input type=\"range\" min=\"0\" max=\"100\" value=\"100\" id=\"range\">\n  <p>User ID: <span id=\"userId\"></span></p>\n  <p>Current website: <span id=\"currentSite\"></p>\n</div>\n<iframe id=\"iframe\" style=\"height:720px;width:1280px\"></iframe>\n<script type=\"module\">\n  import Hyperbeam from \"https://unpkg.com/@hyperbeam/iframe@0.0.6/dist/index.js\"\n  // TODO: Set the embedURL variable\n  const embedURL = \"<your-embed-url>\"\n  const hb = await Hyperbeam(iframe, embedURL)\n  userId.innerText = hb.userId\n  reload.addEventListener(\"click\", () => {\n    hb.tabs.reload()\n  })\n  back.addEventListener(\"click\", () => {\n    hb.tabs.goBack()\n  })\n  forward.addEventListener(\"click\", () => {\n    hb.tabs.goForward()\n  })\n  youtube.addEventListener(\"click\", () => {\n    hb.tabs.update({ url: \"https://youtube.com\" })\n  })\n  range.addEventListener(\"change\", (e) => {\n    hb.volume = e.target.value / 100\n  })\n  hb.tabs.onUpdated.addListener((tabId, changeInfo) => {\n    if (changeInfo.title) {\n      currentSite.innerText = changeInfo.title\n    }\n  })\n</script>\n```\n\n## API Reference\n\n### Loading multiplayer browser\n\n**Hyperbeam(iframe: IFrame, embedURL: string, opts?: HyperbeamOptions): Promise\\<HyperbeamClient\\>**\n\nCreates a new Hyperbeam IFrame client.\n\n```js\n// The embedURL is retrieved from the REST API\n// Documentation for the REST API can be found here:\n// hyperbeam.support/API-Design-eb9874bd1ef54c22ba7197324ce22231\nconst embedURL = \"https://abc.hyperbeam.com/foo?token=bar\"\nconst iframe = document.getElementById(\"iframe-id\")\n\nconst hb = await Hyperbeam(iframe, embedURL, {\n  // Number of milliseconds until the request to the multiplayer browser times out.\n  // If the request times out, the returned promise will be rejected.\n  timeout: 5000, // default = 2000\n\n  // An admin token returned from the REST API that will grant this user\n  // access to managing user permissions and programmatic navigation.\n  admin_token: \"admin_token_from_rest_api_response\",\n\n  // Starting volume of the multiplayer browser\n  volume: 0.2    // default = 1.0\n})\n```\n\n### Setting video volume\n\n**hb.volume = 0.5**\n\nSets the volume for the multiplayer browser *locally*. Volume changes only apply to the local user. This setting is *not* persisted on refreshing the page.\n\n```js\nconst hb = await Hyperbeam(iframe, embedURL)\n// Valid values range from 0.0 to 1.0\nhb.volume = 0.5 // default = 1.0\n```\n\n### Getting user ID\n\n**hb.userId: string**\n\nGets the client's user ID. A \"user\" is defined as a single connection to the multiplayer browser. If a person has multiple tabs connected to the multiplayer browser, each tab with an active connection will be assigned a different user ID.\n\n```js\nconst hb = await Hyperbeam(iframe, embedURL)\nconsole.log(hb.userId) // A unique string identifying the user\n```\n\n### Setting admin token\n\n**hb.admin_token = \"admin_token\"**\n\nSets the client's admin token. The client must have an admin token set to manage user permissions and control the tabs programmatically.\n\n```js\n// You can provide the admin token during initialization\nconst hb = await Hyperbeam(iframe, embedURL, {\n  admin_token: \"admin_token_from_rest_api_response\"\n})\n\n// In some situations, you may want to promote the user to\n// an admin after initialization. For example, promoting a \"user\" to a \"moderator\".\nconst hb = await Hyperbeam(iframe, embedURL)\nhb.admin_token = \"admin_token_from_rest_api_response\"\n```\n\n### Setting permissions\n\n**hb.setPermission(userId: string, permissionData: PremissionData): Promise\\<void\\>**\n\nSets the permission of a user by their ID. The client must have an admin token set to manage user permissions.\n\n```js\n// You can provide the admin token during initialization\nconst hb = await Hyperbeam(iframe, embedURL, {\n  admin_token: \"admin_token_from_rest_api_response\"\n})\n\nconst targetUserId = \"a_user_id\"\n\n// All keys can be omitted: if the key is omitted, then the existing value will be unchanged\nconst permissions = {\n  // Higher value = higher priority\n  // Users with a higher priority will preempt the control of lower priority users.\n  priority: 2,           // default = 0\n\n  // Number of milliseconds until a user is considered \"idle\". Once a user is considered\n  // idle, they no longer preempt lower priority users until they interact with the\n  // multiplayer browser again.\n  idle_timeout: 3000,    // default = 0\n\n  // If control_disabled = true, all control input (mouse movements, keyboard presses)\n  // will be ignored. Note that disabling control does not restrict access to any\n  // APIs that require admin tokens.\n  control_disabled: true // default = control_disable_default (see REST API)\n}\n\nhb.setPermissions(targetUserId, permissions)\n```\n\n### Control tabs programmatically\n\nHyperbeam's tab API mirrors Chrome extension tab API, found <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method\" target=\"_blank\">here</a>.\n\nRather than calling `chrome.tabs.create({ active: true })`, you will would call `hb.tabs.create({ active: true })`.\n\nWe support the following methods:\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-create\" target=\"_blank\">tabs.create</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-detectLanguage\" target=\"_blank\">tabs.detectLanguage</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-discard\" target=\"_blank\">tabs.discard</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-duplicate\" target=\"_blank\">tabs.duplicate</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-get\" target=\"_blank\">tabs.get</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-getZoom\" target=\"_blank\">tabs.getZoom</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-getZoomSettings\" target=\"_blank\">tabs.getZoomSettings</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-goBack\" target=\"_blank\">tabs.goBack</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-goForward\" target=\"_blank\">tabs.goForward</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-group\" target=\"_blank\">tabs.group</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-highlight\" target=\"_blank\">tabs.highlight</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-move\" target=\"_blank\">tabs.move</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-query\" target=\"_blank\">tabs.query</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-reload\" target=\"_blank\">tabs.reload</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-remove\" target=\"_blank\">tabs.remove</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-setZoom\" target=\"_blank\">tabs.setZoom</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-setZoomSettings\" target=\"_blank\">tabs.setZoomSettings</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-ungroup\" target=\"_blank\">tabs.ungroup</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-update\" target=\"_blank\">tabs.update</a>\n\n```js\nconst hb = await Hyperbeam(iframe, embedURL)\n\n// Create a tab\nconst tab = await hb.tabs.create({ active: true })\n\n// Duplicate a tab\nconst tab2 = await hb.tabs.duplicate(tab.id)\n\n// Set the URL of the active tab\nconst updatedTab = await hb.tabs.update({url: \"https://hyperbeam.dev/\"})\n```\n\n### Listen to tab events\n\nHyperbeam's tab event listener API mirrors Chrome extension tab API, found <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event\" target=\"_blank\">here</a>.\n\nRather than calling `chrome.tabs.onCreated.addListener((tab) => {})`, you will would call `hb.tabs.onCreated.addListener((tab) => {})`.\n\nWe support the following events:\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onActivated\" target=\"_blank\">tabs.onActivated</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onCreated\" target=\"_blank\">tabs.onCreated</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onHighlighted\" target=\"_blank\">tabs.onHighlighted</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onMoved\" target=\"_blank\">tabs.onMoved</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onRemoved\" target=\"_blank\">tabs.onRemoved</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onReplaced\" target=\"_blank\">tabs.onReplaced</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onUpdated\" target=\"_blank\">tabs.onUpdated</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onZoomChange\" target=\"_blank\">tabs.onZoomChange</a>\n\n```js\nconst hb = await Hyperbeam(iframe, embedURL)\n\nfunction onTabCreated(tab) {\n  console.log(tab.id)\n}\n\n// Listen for when a new tab is created\nhb.tabs.onCreated.addListener(onTabCreated)\n\n// Create a new tab\nawait hb.tabs.create({ active: true })\n\n// Remove the event listener\nhb.tabs.onCreated.removeListener(onTabCreated)\n```\n","readmeFilename":"README.md","gitHead":"72a363fb033d2e7fbcaccacfccb1f5a9913d5533","_id":"@hyperbeam/iframe@0.0.7-alpha.1","_nodeVersion":"16.14.2","_npmVersion":"8.5.5","dist":{"integrity":"sha512-J6d756nbeiAUwQvHmciOwJSpCDGKjPd5ZLZ6zRnrokhQSr3gBKFC9CW+ujmyKY80h+urNxz58TaqQZkYzO74Qg==","shasum":"7075d35ac1bfab1c2f2177c55e412f9841a19185","tarball":"https://registry.npmjs.org/@hyperbeam/iframe/-/iframe-0.0.7-alpha.1.tgz","fileCount":4,"unpackedSize":28751,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCuKwg0/OvYq52cknnQTZuESeEKnmKm29rW1ruyJvJ8OwIhAMbscL5L/qAoDmLIq7/9LNilJ/51ELyl48RUWXbwyYx3"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiZMqeACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmryew//fiilNQB747GBnFYLLBMorBfgEXhA7EMDsIRwCZ06Kxd9ElRO\r\nMej6M1+8zdxcBJxdpcROZR/l3qB4rMaDmh8Ph+ugLI9JCyWrxicUO3oEKCgg\r\ns1B6dZqe77g1oPIx++EYGM6ZpTxMrr214s4CRARL27X2CXPB5toekKTeGCIY\r\nFvhJYAHmZ6KRI6Btt/n/bvpa27DQMShRhJPTLAyphjUEZfPA4yG9Ut3KCd9b\r\n++e4oocsgBzSw4bwSdCjsljKb8I7LxpDGUPpUxIWHso+HiWMZhiYQghxh1zL\r\nq+r0pYvUMvpS4NJdLSeffK93p+h2d7JoRV13cNbXXI59ggBF18LqB4hPgPHf\r\nPEKbvZYBHhjPw9RzuROnjyYlMrmgNArj0q6L43yyLSqkm5CgqQa1W34AcbuM\r\nyFRV8O8hKsEokrIjcFWknp++vrF4FD+buQg8ArU13+uldOnwoxAf8RxUTBql\r\ndeJqBSQI8BVoQMOEPHYdTcF3kdHOUkTt13DeXf8XH9S0i7M3KpaQIRok2dM4\r\n3X2z48ljaWog7xGvX7jMF7B05teOaJkmqZWs+rRBnFm60Wo2T8BYGezSPJbn\r\nnZm74hsCTUEeOzrGD/or7Uz2tjtWB1zs2bxrevKuOqL0DmFgX8PKxxYlCSHf\r\nSsLzSzHv4a8lTPAfDi/tOjW4LIdjuHhd8iM=\r\n=50PD\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ambyjkl","email":"ambareeshbalaji@gmail.com"},"directories":{},"maintainers":[{"name":"ambyjkl","email":"ambareeshbalaji@gmail.com"},{"name":"scottyfillups","email":"scotty@hyperbeam.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/iframe_0.0.7-alpha.1_1650772638726_0.3860001021199899"},"_hasShrinkwrap":false,"deprecated":"please use https://www.npmjs.com/package/@hyperbeam/web instead"},"0.0.7-alpha.2":{"name":"@hyperbeam/iframe","version":"0.0.7-alpha.2","description":"iframe client library for the Hyperbeam multiplayer browser API","keywords":["hyperbeam","hyperbeam api","hyperbeam cobrowser","hyperbeam cobrowser api","hyperbeam cobrowsing","hyperbeam cobrowsing api","hyperbeam iframe","hyperbeam iframe api","hyperbeam browser","hyperbeam browser api","multiplayer browser","multiplayer browser api","shared browser","shared browser api","cobrowsing","cobrowsing api","cobrowser","cobrowser api"],"homepage":"https://hyperbeam.dev/","bugs":{"url":"https://hyperbeam.support/Get-in-touch-ad6c0bdc9d074923950a0df76ac516b0","email":"amby@hyperbeam.com"},"author":{"name":"Ambareesh Balaji","email":"amby@hyperbeam.com"},"contributors":[{"name":"Philip Scott","email":"scotty@hyperbeam.com"},{"name":"Declan Goncalves","email":"declan@hyperbeam.com"}],"type":"module","module":"dist/index.js","types":"dist/index.d.ts","dependencies":{"@types/chrome":"^0.0.178"},"readme":"# @hyperbeam/iframe\n\niframe client library for the Hyperbeam multiplayer browser API.\n\nUnfamiliar with the Hyperbeam API? Read the full documentation <a href=\"https://hyperbeam.support/API-Design-eb9874bd1ef54c22ba7197324ce22231\" target=\"_blank\">here</a>.\n\n## Table of Contents\n\n- [Features](#features)\n- [Installation](#installation)\n- [Example](#example)\n- [API](#api)\n  - [Loading multiplayer browser](#loading-multiplayer-browser)\n  - [Setting video volume](#setting-video-volume)\n  - [Getting user ID](#getting-user-id)\n  - [Setting admin token](#setting-admin-token)\n  - [Setting permissions](#setting-permissions)\n  - [Control tabs programmatically](#control-tabs-programmatically)\n  - [Listen to tab events](#listen-to-tab-events)\n\n## Features\n\n- Connect to a multiplayer browser\n- Control browser navigation programmatically\n- Query browser state and listen to events\n- Manage user control permissions\n- Set local multiplayer browser volume\n\n## Installation\n\nUsing npm:\n\n```bash\n$ npm install @hyperbeam/iframe --save\n```\n\nUsing unpkg:\n\n```html\n<script type=\"module\">\n  import Hyperbeam from \"https://unpkg.com/@hyperbeam/iframe@0.0.4/dist/index.js\"\n  // ...\n</script>\n```\n\n## Example\n\nYou can save this code snippet as `example.html` and run it in your browser. Make sure you set the embed URL variable to the response data from the [REST API](https://hyperbeam.support/Hyperbeam-API-eb9874bd1ef54c22ba7197324ce22231#d326c958e95244b89cf7ffdbcb07e9bd).\n\n```html\n<div style=\"font-family: Arial\">\n  <button id=\"reload\">Reload</button>\n  <button id=\"back\">Go Back</button>\n  <button id=\"forward\">Go Forward</button>\n  <button id=\"youtube\">Open Youtube.com</button>\n  Volume: <input type=\"range\" min=\"0\" max=\"100\" value=\"100\" id=\"range\">\n  <p>User ID: <span id=\"userId\"></span></p>\n  <p>Current website: <span id=\"currentSite\"></p>\n</div>\n<iframe id=\"iframe\" style=\"height:720px;width:1280px\"></iframe>\n<script type=\"module\">\n  import Hyperbeam from \"https://unpkg.com/@hyperbeam/iframe@0.0.6/dist/index.js\"\n  // TODO: Set the embedURL variable\n  const embedURL = \"<your-embed-url>\"\n  const hb = await Hyperbeam(iframe, embedURL)\n  userId.innerText = hb.userId\n  reload.addEventListener(\"click\", () => {\n    hb.tabs.reload()\n  })\n  back.addEventListener(\"click\", () => {\n    hb.tabs.goBack()\n  })\n  forward.addEventListener(\"click\", () => {\n    hb.tabs.goForward()\n  })\n  youtube.addEventListener(\"click\", () => {\n    hb.tabs.update({ url: \"https://youtube.com\" })\n  })\n  range.addEventListener(\"change\", (e) => {\n    hb.volume = e.target.value / 100\n  })\n  hb.tabs.onUpdated.addListener((tabId, changeInfo) => {\n    if (changeInfo.title) {\n      currentSite.innerText = changeInfo.title\n    }\n  })\n</script>\n```\n\n## API Reference\n\n### Loading multiplayer browser\n\n**Hyperbeam(iframe: IFrame, embedURL: string, opts?: HyperbeamOptions): Promise\\<HyperbeamClient\\>**\n\nCreates a new Hyperbeam IFrame client.\n\n```js\n// The embedURL is retrieved from the REST API\n// Documentation for the REST API can be found here:\n// hyperbeam.support/API-Design-eb9874bd1ef54c22ba7197324ce22231\nconst embedURL = \"https://abc.hyperbeam.com/foo?token=bar\"\nconst iframe = document.getElementById(\"iframe-id\")\n\nconst hb = await Hyperbeam(iframe, embedURL, {\n  // Number of milliseconds until the request to the multiplayer browser times out.\n  // If the request times out, the returned promise will be rejected.\n  timeout: 5000, // default = 2000\n\n  // An admin token returned from the REST API that will grant this user\n  // access to managing user permissions and programmatic navigation.\n  admin_token: \"admin_token_from_rest_api_response\",\n\n  // Starting volume of the multiplayer browser\n  volume: 0.2    // default = 1.0\n})\n```\n\n### Setting video volume\n\n**hb.volume = 0.5**\n\nSets the volume for the multiplayer browser *locally*. Volume changes only apply to the local user. This setting is *not* persisted on refreshing the page.\n\n```js\nconst hb = await Hyperbeam(iframe, embedURL)\n// Valid values range from 0.0 to 1.0\nhb.volume = 0.5 // default = 1.0\n```\n\n### Getting user ID\n\n**hb.userId: string**\n\nGets the client's user ID. A \"user\" is defined as a single connection to the multiplayer browser. If a person has multiple tabs connected to the multiplayer browser, each tab with an active connection will be assigned a different user ID.\n\n```js\nconst hb = await Hyperbeam(iframe, embedURL)\nconsole.log(hb.userId) // A unique string identifying the user\n```\n\n### Setting admin token\n\n**hb.admin_token = \"admin_token\"**\n\nSets the client's admin token. The client must have an admin token set to manage user permissions and control the tabs programmatically.\n\n```js\n// You can provide the admin token during initialization\nconst hb = await Hyperbeam(iframe, embedURL, {\n  admin_token: \"admin_token_from_rest_api_response\"\n})\n\n// In some situations, you may want to promote the user to\n// an admin after initialization. For example, promoting a \"user\" to a \"moderator\".\nconst hb = await Hyperbeam(iframe, embedURL)\nhb.admin_token = \"admin_token_from_rest_api_response\"\n```\n\n### Setting permissions\n\n**hb.setPermission(userId: string, permissionData: PremissionData): Promise\\<void\\>**\n\nSets the permission of a user by their ID. The client must have an admin token set to manage user permissions.\n\n```js\n// You can provide the admin token during initialization\nconst hb = await Hyperbeam(iframe, embedURL, {\n  admin_token: \"admin_token_from_rest_api_response\"\n})\n\nconst targetUserId = \"a_user_id\"\n\n// All keys can be omitted: if the key is omitted, then the existing value will be unchanged\nconst permissions = {\n  // Higher value = higher priority\n  // Users with a higher priority will preempt the control of lower priority users.\n  priority: 2,           // default = 0\n\n  // Number of milliseconds until a user is considered \"idle\". Once a user is considered\n  // idle, they no longer preempt lower priority users until they interact with the\n  // multiplayer browser again.\n  idle_timeout: 3000,    // default = 0\n\n  // If control_disabled = true, all control input (mouse movements, keyboard presses)\n  // will be ignored. Note that disabling control does not restrict access to any\n  // APIs that require admin tokens.\n  control_disabled: true // default = control_disable_default (see REST API)\n}\n\nhb.setPermissions(targetUserId, permissions)\n```\n\n### Control tabs programmatically\n\nHyperbeam's tab API mirrors Chrome extension tab API, found <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method\" target=\"_blank\">here</a>.\n\nRather than calling `chrome.tabs.create({ active: true })`, you will would call `hb.tabs.create({ active: true })`.\n\nWe support the following methods:\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-create\" target=\"_blank\">tabs.create</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-detectLanguage\" target=\"_blank\">tabs.detectLanguage</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-discard\" target=\"_blank\">tabs.discard</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-duplicate\" target=\"_blank\">tabs.duplicate</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-get\" target=\"_blank\">tabs.get</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-getZoom\" target=\"_blank\">tabs.getZoom</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-getZoomSettings\" target=\"_blank\">tabs.getZoomSettings</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-goBack\" target=\"_blank\">tabs.goBack</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-goForward\" target=\"_blank\">tabs.goForward</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-group\" target=\"_blank\">tabs.group</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-highlight\" target=\"_blank\">tabs.highlight</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-move\" target=\"_blank\">tabs.move</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-query\" target=\"_blank\">tabs.query</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-reload\" target=\"_blank\">tabs.reload</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-remove\" target=\"_blank\">tabs.remove</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-setZoom\" target=\"_blank\">tabs.setZoom</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-setZoomSettings\" target=\"_blank\">tabs.setZoomSettings</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-ungroup\" target=\"_blank\">tabs.ungroup</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-update\" target=\"_blank\">tabs.update</a>\n\n```js\nconst hb = await Hyperbeam(iframe, embedURL)\n\n// Create a tab\nconst tab = await hb.tabs.create({ active: true })\n\n// Duplicate a tab\nconst tab2 = await hb.tabs.duplicate(tab.id)\n\n// Set the URL of the active tab\nconst updatedTab = await hb.tabs.update({url: \"https://hyperbeam.dev/\"})\n```\n\n### Listen to tab events\n\nHyperbeam's tab event listener API mirrors Chrome extension tab API, found <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event\" target=\"_blank\">here</a>.\n\nRather than calling `chrome.tabs.onCreated.addListener((tab) => {})`, you will would call `hb.tabs.onCreated.addListener((tab) => {})`.\n\nWe support the following events:\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onActivated\" target=\"_blank\">tabs.onActivated</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onCreated\" target=\"_blank\">tabs.onCreated</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onHighlighted\" target=\"_blank\">tabs.onHighlighted</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onMoved\" target=\"_blank\">tabs.onMoved</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onRemoved\" target=\"_blank\">tabs.onRemoved</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onReplaced\" target=\"_blank\">tabs.onReplaced</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onUpdated\" target=\"_blank\">tabs.onUpdated</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onZoomChange\" target=\"_blank\">tabs.onZoomChange</a>\n\n```js\nconst hb = await Hyperbeam(iframe, embedURL)\n\nfunction onTabCreated(tab) {\n  console.log(tab.id)\n}\n\n// Listen for when a new tab is created\nhb.tabs.onCreated.addListener(onTabCreated)\n\n// Create a new tab\nawait hb.tabs.create({ active: true })\n\n// Remove the event listener\nhb.tabs.onCreated.removeListener(onTabCreated)\n```\n","readmeFilename":"README.md","gitHead":"72a363fb033d2e7fbcaccacfccb1f5a9913d5533","_id":"@hyperbeam/iframe@0.0.7-alpha.2","_nodeVersion":"16.14.2","_npmVersion":"8.5.5","dist":{"integrity":"sha512-0rurWxE44GkMb7zFlzaPQIW2C+HYKeKcjFAKbVRT89+ZUsAsH0AVZy0de0D5CsGc1EzDoB73Lve6KTjZ/+Ojnw==","shasum":"9a78f045b613a7a4dc99c9c442ad2dbcc7f8a0e5","tarball":"https://registry.npmjs.org/@hyperbeam/iframe/-/iframe-0.0.7-alpha.2.tgz","fileCount":4,"unpackedSize":28975,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD3KZ8PDIQETVQkjrtM7KZI6XEy2Q/CGzrwEo4RjpycHAIhANzbyXKDaT3bE4HQTwlELsFvUW1BcDWNcBYbpxxTy5as"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiZaIiACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrdMw/9GNtQz4QIFdKoi89+rfxTi+c3cg4mSPLl3jWTttj9LHiP6Co2\r\n4ueMG13xixdWN4c3q4VkbD/dnAexpNaIZum5r2AoPCMpxFw/LsT4U0MEEUb0\r\nVERR1VrQ/QPB3boSom1P+DLL8tSfbLwhBkGlftcwmyRinSn40KPS0DOUIGY1\r\nz8p46MDMM5+vzXN93chNI0PGIzboUIxjUhFe2Tx+VE9Wd9ewm5NfW04XQRPg\r\nCkqzVBMlFScm0+FAizyepuKxeCstmooVAziUGzQQCxk6aS2dvUTB0PjYF16F\r\n/0yetH3m6jFjePE00ctcigysAcm0c/JRohpl7eMo3Ct/w9W6kritt4O/AzXu\r\nKwqCl7A6nVRJPzJQqkd+88JFvNXwWFqd+qaA3x3I3slLHK0WUVpb1S9p+ySx\r\n425rlzTi/u/B6qkSb7DNt0RdRFioyXurec2OHLxnjbIGIrsmpmkUO0ODxKyj\r\nn565qLlVaQLuov0HxbFVIG4EJ2QqltZZqhZL5TguHXwzkhe3uODNdYrErJw4\r\nSmm5r9cAJb3LyggcTcxdFDSRhglctnTXQJeOD1TLrXynqdU6obadCEsLxKgw\r\ncWTsXmfpXkb1QIvKfWkvAKv/rwr0VdOjUJ+BoEK5i47XWxKP/5W/Nj9fWiJa\r\n5RqoKG330i/RBx8PZUBvFT4k64SbbAZtXzE=\r\n=rdWv\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ambyjkl","email":"ambareeshbalaji@gmail.com"},"directories":{},"maintainers":[{"name":"ambyjkl","email":"ambareeshbalaji@gmail.com"},{"name":"scottyfillups","email":"scotty@hyperbeam.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/iframe_0.0.7-alpha.2_1650827810466_0.6610078962629218"},"_hasShrinkwrap":false,"deprecated":"please use https://www.npmjs.com/package/@hyperbeam/web instead"},"0.0.7-alpha.3":{"name":"@hyperbeam/iframe","version":"0.0.7-alpha.3","description":"iframe client library for the Hyperbeam multiplayer browser API","keywords":["hyperbeam","hyperbeam api","hyperbeam cobrowser","hyperbeam cobrowser api","hyperbeam cobrowsing","hyperbeam cobrowsing api","hyperbeam iframe","hyperbeam iframe api","hyperbeam browser","hyperbeam browser api","multiplayer browser","multiplayer browser api","shared browser","shared browser api","cobrowsing","cobrowsing api","cobrowser","cobrowser api"],"homepage":"https://hyperbeam.dev/","bugs":{"url":"https://hyperbeam.support/Get-in-touch-ad6c0bdc9d074923950a0df76ac516b0","email":"amby@hyperbeam.com"},"author":{"name":"Ambareesh Balaji","email":"amby@hyperbeam.com"},"contributors":[{"name":"Philip Scott","email":"scotty@hyperbeam.com"},{"name":"Declan Goncalves","email":"declan@hyperbeam.com"}],"type":"module","module":"dist/index.js","types":"dist/index.d.ts","dependencies":{"@types/chrome":"^0.0.178"},"readme":"# @hyperbeam/iframe\n\niframe client library for the Hyperbeam multiplayer browser API.\n\nUnfamiliar with the Hyperbeam API? Read the full documentation <a href=\"https://hyperbeam.support/API-Design-eb9874bd1ef54c22ba7197324ce22231\" target=\"_blank\">here</a>.\n\n## Table of Contents\n\n- [Features](#features)\n- [Installation](#installation)\n- [Example](#example)\n- [API](#api)\n  - [Loading multiplayer browser](#loading-multiplayer-browser)\n  - [Setting video volume](#setting-video-volume)\n  - [Getting user ID](#getting-user-id)\n  - [Setting admin token](#setting-admin-token)\n  - [Setting permissions](#setting-permissions)\n  - [Control tabs programmatically](#control-tabs-programmatically)\n  - [Listen to tab events](#listen-to-tab-events)\n\n## Features\n\n- Connect to a multiplayer browser\n- Control browser navigation programmatically\n- Query browser state and listen to events\n- Manage user control permissions\n- Set local multiplayer browser volume\n\n## Installation\n\nUsing npm:\n\n```bash\n$ npm install @hyperbeam/iframe --save\n```\n\nUsing unpkg:\n\n```html\n<script type=\"module\">\n  import Hyperbeam from \"https://unpkg.com/@hyperbeam/iframe@0.0.4/dist/index.js\"\n  // ...\n</script>\n```\n\n## Example\n\nYou can save this code snippet as `example.html` and run it in your browser. Make sure you set the embed URL variable to the response data from the [REST API](https://hyperbeam.support/Hyperbeam-API-eb9874bd1ef54c22ba7197324ce22231#d326c958e95244b89cf7ffdbcb07e9bd).\n\n```html\n<div style=\"font-family: Arial\">\n  <button id=\"reload\">Reload</button>\n  <button id=\"back\">Go Back</button>\n  <button id=\"forward\">Go Forward</button>\n  <button id=\"youtube\">Open Youtube.com</button>\n  Volume: <input type=\"range\" min=\"0\" max=\"100\" value=\"100\" id=\"range\">\n  <p>User ID: <span id=\"userId\"></span></p>\n  <p>Current website: <span id=\"currentSite\"></p>\n</div>\n<iframe id=\"iframe\" style=\"height:720px;width:1280px\"></iframe>\n<script type=\"module\">\n  import Hyperbeam from \"https://unpkg.com/@hyperbeam/iframe@0.0.6/dist/index.js\"\n  // TODO: Set the embedURL variable\n  const embedURL = \"<your-embed-url>\"\n  const hb = await Hyperbeam(iframe, embedURL)\n  userId.innerText = hb.userId\n  reload.addEventListener(\"click\", () => {\n    hb.tabs.reload()\n  })\n  back.addEventListener(\"click\", () => {\n    hb.tabs.goBack()\n  })\n  forward.addEventListener(\"click\", () => {\n    hb.tabs.goForward()\n  })\n  youtube.addEventListener(\"click\", () => {\n    hb.tabs.update({ url: \"https://youtube.com\" })\n  })\n  range.addEventListener(\"change\", (e) => {\n    hb.volume = e.target.value / 100\n  })\n  hb.tabs.onUpdated.addListener((tabId, changeInfo) => {\n    if (changeInfo.title) {\n      currentSite.innerText = changeInfo.title\n    }\n  })\n</script>\n```\n\n## API Reference\n\n### Loading multiplayer browser\n\n**Hyperbeam(iframe: IFrame, embedURL: string, opts?: HyperbeamOptions): Promise\\<HyperbeamClient\\>**\n\nCreates a new Hyperbeam IFrame client.\n\n```js\n// The embedURL is retrieved from the REST API\n// Documentation for the REST API can be found here:\n// hyperbeam.support/API-Design-eb9874bd1ef54c22ba7197324ce22231\nconst embedURL = \"https://abc.hyperbeam.com/foo?token=bar\"\nconst iframe = document.getElementById(\"iframe-id\")\n\nconst hb = await Hyperbeam(iframe, embedURL, {\n  // Number of milliseconds until the request to the multiplayer browser times out.\n  // If the request times out, the returned promise will be rejected.\n  timeout: 5000, // default = 2000\n\n  // An admin token returned from the REST API that will grant this user\n  // access to managing user permissions and programmatic navigation.\n  admin_token: \"admin_token_from_rest_api_response\",\n\n  // Starting volume of the multiplayer browser\n  volume: 0.2    // default = 1.0\n})\n```\n\n### Setting video volume\n\n**hb.volume = 0.5**\n\nSets the volume for the multiplayer browser *locally*. Volume changes only apply to the local user. This setting is *not* persisted on refreshing the page.\n\n```js\nconst hb = await Hyperbeam(iframe, embedURL)\n// Valid values range from 0.0 to 1.0\nhb.volume = 0.5 // default = 1.0\n```\n\n### Getting user ID\n\n**hb.userId: string**\n\nGets the client's user ID. A \"user\" is defined as a single connection to the multiplayer browser. If a person has multiple tabs connected to the multiplayer browser, each tab with an active connection will be assigned a different user ID.\n\n```js\nconst hb = await Hyperbeam(iframe, embedURL)\nconsole.log(hb.userId) // A unique string identifying the user\n```\n\n### Setting admin token\n\n**hb.admin_token = \"admin_token\"**\n\nSets the client's admin token. The client must have an admin token set to manage user permissions and control the tabs programmatically.\n\n```js\n// You can provide the admin token during initialization\nconst hb = await Hyperbeam(iframe, embedURL, {\n  admin_token: \"admin_token_from_rest_api_response\"\n})\n\n// In some situations, you may want to promote the user to\n// an admin after initialization. For example, promoting a \"user\" to a \"moderator\".\nconst hb = await Hyperbeam(iframe, embedURL)\nhb.admin_token = \"admin_token_from_rest_api_response\"\n```\n\n### Setting permissions\n\n**hb.setPermission(userId: string, permissionData: PremissionData): Promise\\<void\\>**\n\nSets the permission of a user by their ID. The client must have an admin token set to manage user permissions.\n\n```js\n// You can provide the admin token during initialization\nconst hb = await Hyperbeam(iframe, embedURL, {\n  admin_token: \"admin_token_from_rest_api_response\"\n})\n\nconst targetUserId = \"a_user_id\"\n\n// All keys can be omitted: if the key is omitted, then the existing value will be unchanged\nconst permissions = {\n  // Higher value = higher priority\n  // Users with a higher priority will preempt the control of lower priority users.\n  priority: 2,           // default = 0\n\n  // Number of milliseconds until a user is considered \"idle\". Once a user is considered\n  // idle, they no longer preempt lower priority users until they interact with the\n  // multiplayer browser again.\n  idle_timeout: 3000,    // default = 0\n\n  // If control_disabled = true, all control input (mouse movements, keyboard presses)\n  // will be ignored. Note that disabling control does not restrict access to any\n  // APIs that require admin tokens.\n  control_disabled: true // default = control_disable_default (see REST API)\n}\n\nhb.setPermissions(targetUserId, permissions)\n```\n\n### Control tabs programmatically\n\nHyperbeam's tab API mirrors Chrome extension tab API, found <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method\" target=\"_blank\">here</a>.\n\nRather than calling `chrome.tabs.create({ active: true })`, you will would call `hb.tabs.create({ active: true })`.\n\nWe support the following methods:\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-create\" target=\"_blank\">tabs.create</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-detectLanguage\" target=\"_blank\">tabs.detectLanguage</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-discard\" target=\"_blank\">tabs.discard</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-duplicate\" target=\"_blank\">tabs.duplicate</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-get\" target=\"_blank\">tabs.get</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-getZoom\" target=\"_blank\">tabs.getZoom</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-getZoomSettings\" target=\"_blank\">tabs.getZoomSettings</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-goBack\" target=\"_blank\">tabs.goBack</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-goForward\" target=\"_blank\">tabs.goForward</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-group\" target=\"_blank\">tabs.group</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-highlight\" target=\"_blank\">tabs.highlight</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-move\" target=\"_blank\">tabs.move</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-query\" target=\"_blank\">tabs.query</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-reload\" target=\"_blank\">tabs.reload</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-remove\" target=\"_blank\">tabs.remove</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-setZoom\" target=\"_blank\">tabs.setZoom</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-setZoomSettings\" target=\"_blank\">tabs.setZoomSettings</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-ungroup\" target=\"_blank\">tabs.ungroup</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-update\" target=\"_blank\">tabs.update</a>\n\n```js\nconst hb = await Hyperbeam(iframe, embedURL)\n\n// Create a tab\nconst tab = await hb.tabs.create({ active: true })\n\n// Duplicate a tab\nconst tab2 = await hb.tabs.duplicate(tab.id)\n\n// Set the URL of the active tab\nconst updatedTab = await hb.tabs.update({url: \"https://hyperbeam.dev/\"})\n```\n\n### Listen to tab events\n\nHyperbeam's tab event listener API mirrors Chrome extension tab API, found <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event\" target=\"_blank\">here</a>.\n\nRather than calling `chrome.tabs.onCreated.addListener((tab) => {})`, you will would call `hb.tabs.onCreated.addListener((tab) => {})`.\n\nWe support the following events:\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onActivated\" target=\"_blank\">tabs.onActivated</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onCreated\" target=\"_blank\">tabs.onCreated</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onHighlighted\" target=\"_blank\">tabs.onHighlighted</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onMoved\" target=\"_blank\">tabs.onMoved</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onRemoved\" target=\"_blank\">tabs.onRemoved</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onReplaced\" target=\"_blank\">tabs.onReplaced</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onUpdated\" target=\"_blank\">tabs.onUpdated</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onZoomChange\" target=\"_blank\">tabs.onZoomChange</a>\n\n```js\nconst hb = await Hyperbeam(iframe, embedURL)\n\nfunction onTabCreated(tab) {\n  console.log(tab.id)\n}\n\n// Listen for when a new tab is created\nhb.tabs.onCreated.addListener(onTabCreated)\n\n// Create a new tab\nawait hb.tabs.create({ active: true })\n\n// Remove the event listener\nhb.tabs.onCreated.removeListener(onTabCreated)\n```\n","readmeFilename":"README.md","gitHead":"72a363fb033d2e7fbcaccacfccb1f5a9913d5533","_id":"@hyperbeam/iframe@0.0.7-alpha.3","_nodeVersion":"16.14.2","_npmVersion":"8.5.5","dist":{"integrity":"sha512-i8VLy9QV9wEXvbcjFTt3sW4vff8CPLpxWLToEC6R30ev9aQ+GUrPiceL7AcyFyNiQs4qKq6v73OAD8eHx7V5Fw==","shasum":"b874678eced66fe82b8531d9c5394921480dfc89","tarball":"https://registry.npmjs.org/@hyperbeam/iframe/-/iframe-0.0.7-alpha.3.tgz","fileCount":4,"unpackedSize":28988,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEAPQoydKKQPib5Bo2MqsPW95jTpdtzTO2NCCXpaXJOHAiBzll8Z4G0XG5At5eWN0xeMFC/K6WMn57Bz60VYBGL1xQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiaCI1ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrRqhAAmB39ZlqZkP9GUHAFYJMdHtYaF5uobvlmQbkxMDdt5klGFg8K\r\n1ub8yyzc5XcITzsSgooPJfSGoBkHXqVk52o/ay0uZS+1sef+tpGK4Fd83JJd\r\nOQxmm4f2/YpI9XlWLsP63PZaOGg9xS0DyE0yc3lrbMp45DWtdAtHbu32A/QA\r\nHS3/LHIY6oRGS7B/pHvsJBiEH9ZP1mIXhIE4TrUl1UEikHTjWWsmQ+ivGlXo\r\nOiPofy14ytDayiHXtmK7EilaZYuM6pQjbrhJyNUoDMtpbfSisIa25/X+lz2K\r\nsBViVWhrpj34xeBgtXat6Gz4UfjIXsMhEeXuubhEBFa15YV4gj+AimDm7+p8\r\n7TkSQWMyyffZxYbdAjOnOuZlpkub70Dv/pnjpyLgNaXdGFVrUPHooVvDeRb+\r\nTBZRaP2Lyb7cMLi7w3CKtUpd5ZUzjs8ZiE9yM2uDqKjoed9SVxeiOssPzhjh\r\ns6HE9YxDrnxALDEwqVJJmA+jv5Q86hUPOdvY1TsqhZrjhrl/8MXsqVvao4j7\r\nWuXdjGxGu7n6PYT7ctYx5XjiqIuVv3Qin+yDEtoGaRHv5ndLp1UmkAonRKGy\r\nfOD8B29txgKu1LUmVfArbwvx0WG1OEp2PpyrqU4iW3Nx0xq+pS7I9YnXcYIs\r\nQIfwu9PWWeElh4xPjtzzomWPJ2m4vIhuFjE=\r\n=21Xm\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ambyjkl","email":"ambareeshbalaji@gmail.com"},"directories":{},"maintainers":[{"name":"ambyjkl","email":"ambareeshbalaji@gmail.com"},{"name":"scottyfillups","email":"scotty@hyperbeam.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/iframe_0.0.7-alpha.3_1650991669419_0.313581320074674"},"_hasShrinkwrap":false,"deprecated":"please use https://www.npmjs.com/package/@hyperbeam/web instead"},"0.0.7":{"name":"@hyperbeam/iframe","version":"0.0.7","description":"iframe client library for the Hyperbeam multiplayer browser API","keywords":["hyperbeam","hyperbeam api","hyperbeam cobrowser","hyperbeam cobrowser api","hyperbeam cobrowsing","hyperbeam cobrowsing api","hyperbeam iframe","hyperbeam iframe api","hyperbeam browser","hyperbeam browser api","multiplayer browser","multiplayer browser api","shared browser","shared browser api","cobrowsing","cobrowsing api","cobrowser","cobrowser api"],"homepage":"https://hyperbeam.dev/","bugs":{"url":"https://hyperbeam.support/Get-in-touch-ad6c0bdc9d074923950a0df76ac516b0","email":"amby@hyperbeam.com"},"author":{"name":"Ambareesh Balaji","email":"amby@hyperbeam.com"},"contributors":[{"name":"Philip Scott","email":"scotty@hyperbeam.com"},{"name":"Declan Goncalves","email":"declan@hyperbeam.com"}],"type":"module","module":"dist/index.js","types":"dist/index.d.ts","dependencies":{"@types/chrome":"^0.0.178"},"gitHead":"c9100e84933d46e0af5745c37cfb8fe862063141","_id":"@hyperbeam/iframe@0.0.7","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-2vMlm0BnSRib2dugdr79s6hzymb8QYIVEUeWR0Z0ubTIj977n5D6AYg6ym/unuBiVtVMe/EgYJlNIT1ASmCY5w==","shasum":"9ef5fddadfed313474f4672e434f3d6dd97424b4","tarball":"https://registry.npmjs.org/@hyperbeam/iframe/-/iframe-0.0.7.tgz","fileCount":4,"unpackedSize":28837,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGE4UsPnNqrjpj5JaZXjchQ3QFC4Shi24c+4tRWFE6p3AiB5geOHhBNBepucPeUtf39gFscrPbF+RGm+QW6e2opcFg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJihn7EACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq5Yw/8CiwH3dNHTeOZSGD9uQ1BjJ9Yp2T/jPSSyoKak5YaNt950NKU\r\nEWA6z3NB1osIcRPr7294pfYowF4EY/oTfLaoQBB3t7ZtT/aJh06nK65+Xe7r\r\no3Fxn5+5qUbwtz5uOrMnzxQOtNIoK/rJQ7eetySiKK8xYCN2iNayOZq5QfhO\r\nXpvNcMexpVj2BIXX/Nu7qIv5DwyT9fassFCZrgt2m42svDA6niIe85el3/N7\r\nIGE2mPdkMtJs0Soc45sLXxEE2dK1i31pxD3v53z0unBBULH6fYhOGkWd4SiH\r\nm1ccYWP8mG0RFNqFQ7N+Wm63moVNvrOwznSyPYjRm+X5K1H3qlgJh3bYhsKu\r\nCwQM9HxTxcWuUviOlmFbbyoD9RziENbkC1fSEZLXU1X+LB3U3Ve5Mt44v8w6\r\nOKfxXTIV4yTg4LWAICAFSmafUyhmAVXSYWlIXsOlCcXOivL7dI4tSOcy6ses\r\nfVojhRIwBQ62IGAW3OojdqEfWNDTcPN2YnoqyI5E223W6W3hrLhhRv1B+vHo\r\nYMYq0rQksSZ5jfDDcFebNswzZLDbrVp6USRB88IQifWbMJURvMIHdN2Wf/cl\r\nVHi8KQvGPJYhj/QBse0g66sPwWyKVOQbjcp7u8ieLxJXpiWUHU8svGy9lpMe\r\n5SzKR1UCo4ijIRClOhAyXD4w50pgMKTfR3U=\r\n=1F8H\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ambyjkl","email":"ambareeshbalaji@gmail.com"},"directories":{},"maintainers":[{"name":"ambyjkl","email":"ambareeshbalaji@gmail.com"},{"name":"scottyfillups","email":"scotty@hyperbeam.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/iframe_0.0.7_1652981444222_0.8311045786694389"},"_hasShrinkwrap":false,"deprecated":"please use https://www.npmjs.com/package/@hyperbeam/web instead"},"0.0.8-alpha.1":{"name":"@hyperbeam/iframe","version":"0.0.8-alpha.1","description":"iframe client library for the Hyperbeam multiplayer browser API","keywords":["hyperbeam","hyperbeam api","hyperbeam cobrowser","hyperbeam cobrowser api","hyperbeam cobrowsing","hyperbeam cobrowsing api","hyperbeam iframe","hyperbeam iframe api","hyperbeam browser","hyperbeam browser api","multiplayer browser","multiplayer browser api","shared browser","shared browser api","cobrowsing","cobrowsing api","cobrowser","cobrowser api"],"homepage":"https://hyperbeam.dev/","bugs":{"url":"https://hyperbeam.support/Get-in-touch-ad6c0bdc9d074923950a0df76ac516b0","email":"amby@hyperbeam.com"},"author":{"name":"Ambareesh Balaji","email":"amby@hyperbeam.com"},"contributors":[{"name":"Philip Scott","email":"scotty@hyperbeam.com"},{"name":"Declan Goncalves","email":"declan@hyperbeam.com"}],"type":"module","module":"dist/index.js","types":"dist/index.d.ts","dependencies":{"@types/chrome":"^0.0.178"},"readme":"# @hyperbeam/iframe\n\niframe client library for the Hyperbeam multiplayer browser API.\n\nUnfamiliar with the Hyperbeam API? Read the full documentation <a href=\"https://hyperbeam.support/API-Design-eb9874bd1ef54c22ba7197324ce22231\" target=\"_blank\">here</a>.\n\n## Table of Contents\n\n- [Features](#features)\n- [Installation](#installation)\n- [Example](#example)\n- [API](#api)\n  - [Loading multiplayer browser](#loading-multiplayer-browser)\n  - [Setting video volume](#setting-video-volume)\n  - [Getting user ID](#getting-user-id)\n  - [Setting admin token](#setting-admin-token)\n  - [Setting permissions](#setting-permissions)\n  - [Control tabs programmatically](#control-tabs-programmatically)\n  - [Listen to tab events](#listen-to-tab-events)\n\n## Features\n\n- Connect to a multiplayer browser\n- Control browser navigation programmatically\n- Query browser state and listen to events\n- Manage user control permissions\n- Set local multiplayer browser volume\n\n## Installation\n\nUsing npm:\n\n```bash\n$ npm install @hyperbeam/iframe --save\n```\n\nUsing unpkg:\n\n```html\n<script type=\"module\">\n  import Hyperbeam from \"https://unpkg.com/@hyperbeam/iframe@0.0.4/dist/index.js\"\n  // ...\n</script>\n```\n\n## Example\n\nYou can save this code snippet as `example.html` and run it in your browser. Make sure you set the embed URL variable to the response data from the [REST API](https://hyperbeam.support/Hyperbeam-API-eb9874bd1ef54c22ba7197324ce22231#d326c958e95244b89cf7ffdbcb07e9bd).\n\n```html\n<div style=\"font-family: Arial\">\n  <button id=\"reload\">Reload</button>\n  <button id=\"back\">Go Back</button>\n  <button id=\"forward\">Go Forward</button>\n  <button id=\"youtube\">Open Youtube.com</button>\n  Volume: <input type=\"range\" min=\"0\" max=\"100\" value=\"100\" id=\"range\">\n  <p>User ID: <span id=\"userId\"></span></p>\n  <p>Current website: <span id=\"currentSite\"></p>\n</div>\n<iframe id=\"iframe\" style=\"height:720px;width:1280px\"></iframe>\n<script type=\"module\">\n  import Hyperbeam from \"https://unpkg.com/@hyperbeam/iframe@0.0.6/dist/index.js\"\n  // TODO: Set the embedURL variable\n  const embedURL = \"<your-embed-url>\"\n  const hb = await Hyperbeam(iframe, embedURL)\n  userId.innerText = hb.userId\n  reload.addEventListener(\"click\", () => {\n    hb.tabs.reload()\n  })\n  back.addEventListener(\"click\", () => {\n    hb.tabs.goBack()\n  })\n  forward.addEventListener(\"click\", () => {\n    hb.tabs.goForward()\n  })\n  youtube.addEventListener(\"click\", () => {\n    hb.tabs.update({ url: \"https://youtube.com\" })\n  })\n  range.addEventListener(\"change\", (e) => {\n    hb.volume = e.target.value / 100\n  })\n  hb.tabs.onUpdated.addListener((tabId, changeInfo) => {\n    if (changeInfo.title) {\n      currentSite.innerText = changeInfo.title\n    }\n  })\n</script>\n```\n\n## API Reference\n\n### Loading multiplayer browser\n\n**Hyperbeam(iframe: IFrame, embedURL: string, opts?: HyperbeamOptions): Promise\\<HyperbeamClient\\>**\n\nCreates a new Hyperbeam IFrame client.\n\n```js\n// The embedURL is retrieved from the REST API\n// Documentation for the REST API can be found here:\n// hyperbeam.support/API-Design-eb9874bd1ef54c22ba7197324ce22231\nconst embedURL = \"https://abc.hyperbeam.com/foo?token=bar\"\nconst iframe = document.getElementById(\"iframe-id\")\n\nconst hb = await Hyperbeam(iframe, embedURL, {\n  // Number of milliseconds until the request to the multiplayer browser times out.\n  // If the request times out, the returned promise will be rejected.\n  timeout: 5000, // default = 2000\n\n  // An admin token returned from the REST API that will grant this user\n  // access to managing user permissions and programmatic navigation.\n  adminToken: \"admin_token_from_rest_api_response\",\n\n  // Starting volume of the multiplayer browser\n  volume: 0.2    // default = 1.0\n})\n```\n\n### Setting video volume\n\n**hb.volume = 0.5**\n\nSets the volume for the multiplayer browser *locally*. Volume changes only apply to the local user. This setting is *not* persisted on refreshing the page.\n\n```js\nconst hb = await Hyperbeam(iframe, embedURL)\n// Valid values range from 0.0 to 1.0\nhb.volume = 0.5 // default = 1.0\n```\n\n### Getting user ID\n\n**hb.userId: string**\n\nGets the client's user ID. A \"user\" is defined as a single connection to the multiplayer browser. If a person has multiple tabs connected to the multiplayer browser, each tab with an active connection will be assigned a different user ID.\n\n```js\nconst hb = await Hyperbeam(iframe, embedURL)\nconsole.log(hb.userId) // A unique string identifying the user\n```\n\n### Setting admin token\n\n**hb.adminToken = \"adminToken\"**\n\nSets the client's admin token. The client must have an admin token set to manage user permissions and control the tabs programmatically.\n\n```js\n// You can provide the admin token during initialization\nconst hb = await Hyperbeam(iframe, embedURL, {\n  adminToken: \"admin_token_from_rest_api_response\"\n})\n\n// In some situations, you may want to promote the user to\n// an admin after initialization. For example, promoting a \"user\" to a \"moderator\".\nconst hb = await Hyperbeam(iframe, embedURL)\nhb.adminToken = \"admin_token_from_rest_api_response\"\n```\n\n### Setting permissions\n\n**hb.setPermission(userId: string, permissionData: PremissionData): Promise\\<void\\>**\n\nSets the permission of a user by their ID. The client must have an admin token set to manage user permissions.\n\n```js\n// You can provide the admin token during initialization\nconst hb = await Hyperbeam(iframe, embedURL, {\n  adminToken: \"admin_token_from_rest_api_response\"\n})\n\nconst targetUserId = \"a_user_id\"\n\n// All keys can be omitted: if the key is omitted, then the existing value will be unchanged\nconst permissions = {\n  // Higher value = higher priority\n  // Users with a higher priority will preempt the control of lower priority users.\n  priority: 2,           // default = 0\n\n  // Number of milliseconds until a user is considered \"idle\". Once a user is considered\n  // idle, they no longer preempt lower priority users until they interact with the\n  // multiplayer browser again.\n  idle_timeout: 3000,    // default = 0\n\n  // If control_disabled = true, all control input (mouse movements, keyboard presses)\n  // will be ignored. Note that disabling control does not restrict access to any\n  // APIs that require admin tokens.\n  control_disabled: true // default = control_disable_default (see REST API)\n}\n\nhb.setPermissions(targetUserId, permissions)\n```\n\n### Control tabs programmatically\n\nHyperbeam's tab API mirrors Chrome extension tab API, found <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method\" target=\"_blank\">here</a>.\n\nRather than calling `chrome.tabs.create({ active: true })`, you will would call `hb.tabs.create({ active: true })`.\n\nWe support the following methods:\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-create\" target=\"_blank\">tabs.create</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-detectLanguage\" target=\"_blank\">tabs.detectLanguage</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-discard\" target=\"_blank\">tabs.discard</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-duplicate\" target=\"_blank\">tabs.duplicate</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-get\" target=\"_blank\">tabs.get</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-getZoom\" target=\"_blank\">tabs.getZoom</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-getZoomSettings\" target=\"_blank\">tabs.getZoomSettings</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-goBack\" target=\"_blank\">tabs.goBack</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-goForward\" target=\"_blank\">tabs.goForward</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-group\" target=\"_blank\">tabs.group</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-highlight\" target=\"_blank\">tabs.highlight</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-move\" target=\"_blank\">tabs.move</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-query\" target=\"_blank\">tabs.query</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-reload\" target=\"_blank\">tabs.reload</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-remove\" target=\"_blank\">tabs.remove</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-setZoom\" target=\"_blank\">tabs.setZoom</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-setZoomSettings\" target=\"_blank\">tabs.setZoomSettings</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-ungroup\" target=\"_blank\">tabs.ungroup</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-update\" target=\"_blank\">tabs.update</a>\n\n```js\nconst hb = await Hyperbeam(iframe, embedURL)\n\n// Create a tab\nconst tab = await hb.tabs.create({ active: true })\n\n// Duplicate a tab\nconst tab2 = await hb.tabs.duplicate(tab.id)\n\n// Set the URL of the active tab\nconst updatedTab = await hb.tabs.update({url: \"https://hyperbeam.dev/\"})\n```\n\n### Listen to tab events\n\nHyperbeam's tab event listener API mirrors Chrome extension tab API, found <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event\" target=\"_blank\">here</a>.\n\nRather than calling `chrome.tabs.onCreated.addListener((tab) => {})`, you will would call `hb.tabs.onCreated.addListener((tab) => {})`.\n\nWe support the following events:\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onActivated\" target=\"_blank\">tabs.onActivated</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onCreated\" target=\"_blank\">tabs.onCreated</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onHighlighted\" target=\"_blank\">tabs.onHighlighted</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onMoved\" target=\"_blank\">tabs.onMoved</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onRemoved\" target=\"_blank\">tabs.onRemoved</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onReplaced\" target=\"_blank\">tabs.onReplaced</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onUpdated\" target=\"_blank\">tabs.onUpdated</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onZoomChange\" target=\"_blank\">tabs.onZoomChange</a>\n\n```js\nconst hb = await Hyperbeam(iframe, embedURL)\n\nfunction onTabCreated(tab) {\n  console.log(tab.id)\n}\n\n// Listen for when a new tab is created\nhb.tabs.onCreated.addListener(onTabCreated)\n\n// Create a new tab\nawait hb.tabs.create({ active: true })\n\n// Remove the event listener\nhb.tabs.onCreated.removeListener(onTabCreated)\n```\n","readmeFilename":"README.md","gitHead":"470c3a0abc8df05ce8f11f4c7798d7eb46119079","_id":"@hyperbeam/iframe@0.0.8-alpha.1","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-fgAemwS6LWMt5wkizQ+HwlYLj7OMoE1LU/2+EsoQ/8Re8IUiKB3rcoborlzoPoWX5ZHDEWtPBvJ2MQZbPCYTxQ==","shasum":"a73a5a26b5bcd722f3196ad7111b114b485981a5","tarball":"https://registry.npmjs.org/@hyperbeam/iframe/-/iframe-0.0.8-alpha.1.tgz","fileCount":4,"unpackedSize":29013,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDToesFDGrweT0WHG5gy9XFXvvmLFpsKo7+mklqriiIfwIgVENSBu4aKSwo+n1anH6fYHx2mPGsjtg+uDbjQEqNTY8="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJij6OyACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmotMBAAnGeQJcos26pErpF7mUw+CcVctgHAawBEUr5mEU0SzsHkOwvY\r\nLPCWuzTsraMGcN+qvPKFgVinLPNHrAv5c4Ig8LuEPXY2OSwFSkdPekjQxFDD\r\n3QLFMvtFqttsWiEdbB1NpJ0mzsZB84ja6EMqX+H1BEKDa3xLP+oJRfl6zAnv\r\nuJtkUUt3HG35HQF6/GtiM9QOd8KrVZD9bjpcA0IQl+3crNVeGfvdNWwz6Vaq\r\n9Pfs/C/W5XSJtLpG3XGE1fIwzQUg+NjU/W3Sq5JGULuZT1uItkCQUbn3DDrC\r\nrTlKmkwEHNqWInCpRYZ5MarQHV5OVkr0H5A1A18sdgY3XIVlmhNAFuZUinrU\r\nw7OuUuUk/ODxlvqvCnk9I++QDOqUZpSPvBKT6FbW+YqlwVJmaz0D7hl4UIat\r\nXKpf7HiyhS+Zp39BGNhbwp0Kvoa5ZuC0KKLvlkEj1F42V2Sxeb2yPin+m7Zh\r\nNUD3rAlYcCwlL3f5H0e5Y9m/aOr9zUo+FWtMELYDXIZJ3zGXvCQobO4p4gWp\r\nwJv6i5Q6OGEKxuqdRkxb4MiOuBiHvsONvRj5WqpZVzd4oCxrKV95bjhPa2CB\r\nT2S+dd7BNvbBbzwGTij7HuwBPcyY8LBFUbY/ck0b44adcVQ3AxJQRP1/QrBW\r\nr1sABX6r5Xh+g1s6t2iFQ82QHgfZD3A1CnM=\r\n=p+a9\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ambyjkl","email":"ambareeshbalaji@gmail.com"},"directories":{},"maintainers":[{"name":"ambyjkl","email":"ambareeshbalaji@gmail.com"},{"name":"scottyfillups","email":"scotty@hyperbeam.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/iframe_0.0.8-alpha.1_1653580722632_0.9577685875542736"},"_hasShrinkwrap":false,"deprecated":"please use https://www.npmjs.com/package/@hyperbeam/web instead"},"0.0.8":{"name":"@hyperbeam/iframe","version":"0.0.8","description":"iframe client library for the Hyperbeam multiplayer browser API","keywords":["hyperbeam","hyperbeam api","hyperbeam cobrowser","hyperbeam cobrowser api","hyperbeam cobrowsing","hyperbeam cobrowsing api","hyperbeam iframe","hyperbeam iframe api","hyperbeam browser","hyperbeam browser api","multiplayer browser","multiplayer browser api","shared browser","shared browser api","cobrowsing","cobrowsing api","cobrowser","cobrowser api"],"homepage":"https://hyperbeam.dev/","bugs":{"url":"https://hyperbeam.support/Get-in-touch-ad6c0bdc9d074923950a0df76ac516b0","email":"amby@hyperbeam.com"},"author":{"name":"Ambareesh Balaji","email":"amby@hyperbeam.com"},"contributors":[{"name":"Philip Scott","email":"scotty@hyperbeam.com"},{"name":"Declan Goncalves","email":"declan@hyperbeam.com"}],"type":"module","module":"dist/index.js","types":"dist/index.d.ts","dependencies":{"@types/chrome":"^0.0.178"},"gitHead":"22282ff4a18869de509846bd15dafd91ed438d65","_id":"@hyperbeam/iframe@0.0.8","_nodeVersion":"16.15.1","_npmVersion":"8.5.5","dist":{"integrity":"sha512-68Or9ligDbPtEw06hyti+JMQZVp/qkQ3JdUBHahMvwoJd54knfqVWq2CloluQ7AfBAPft6rKK2/Nmr6wbJT8BA==","shasum":"a09df13cd32e8b6c5fb3308a7f133dded8d88fa3","tarball":"https://registry.npmjs.org/@hyperbeam/iframe/-/iframe-0.0.8.tgz","fileCount":4,"unpackedSize":31191,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDVGB+X6CFAsgNXUyAbpV0HWIPnxPV9w8fh5k4ENGlv0AIhAPQ5vKKlaKlP+XOYic2jvSRju+KRKLfpgcpJ29N2srma"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJirL9IACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp1OA/+NL1nUVEswWwz6nHrH3BFhZtJef7iAOOeVynNvHb5TJjWcz+D\r\nVioQjknXG+K2RHSmNiLH6xwS1bQ5yZf9bdNmcFhql7mnor1rHn1PrgY7z2g8\r\ny48BpWN3ISs4Z2Z05n3iLcv+GP+pdIQXsjcolbk+UITClyh4x9b3DS40Lwlw\r\n1xZHycyMPDf78gKP/dNPvgoMOUNipVHL9bjioITWF3ddEcRjfN0U2DcnhMf1\r\nKFJWRFl5q8mWrqkBNdzIn1MKEgq51RgrokN+w7QLU/Rg+uozEVjmtpsl39Da\r\n/SFWHMX+cYyX4GnaLWtwH4CMh9gmUD5GYITCC4AsyQhy/9Oz5OJlq4iKFVw6\r\n/6FMwioJurtWRmmyEFrCsw5Xgm8MCFmNVT1jR+EdUb/G/5v1XPABENju6Gaf\r\nXQZ4FNFh9BKKVhG98RXnSyelo1rPuomBOh+riO+3F6V//99/AZX9vSh0fnIB\r\nk0t+tOFzk1bwCfppU+aoD51f0WcHtKNoceJBCcM1x5k/XC2YZvregAZWmVUC\r\nyLZt6dCHDnNy6OgfpkSWT3twklf5FRUZQrnVgeUoh6g7J64+bd+GGHEWuyue\r\n76PRDg46U8qtlWDnV4RE2kta8xjrCWsepHk44LRFb9WX9zosDf7+ejNdvg3W\r\nfy2TCiAJaTM2XEbaBFqaO2DGHOtXzmLfSOY=\r\n=vylO\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ambyjkl","email":"ambareeshbalaji@gmail.com"},"directories":{},"maintainers":[{"name":"ambyjkl","email":"ambareeshbalaji@gmail.com"},{"name":"scottyfillups","email":"scotty@hyperbeam.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/iframe_0.0.8_1655488327930_0.3417851345091525"},"_hasShrinkwrap":false,"deprecated":"please use https://www.npmjs.com/package/@hyperbeam/web instead"},"0.0.9":{"name":"@hyperbeam/iframe","version":"0.0.9","description":"iframe client library for the Hyperbeam multiplayer browser API","keywords":["hyperbeam","hyperbeam api","hyperbeam cobrowser","hyperbeam cobrowser api","hyperbeam cobrowsing","hyperbeam cobrowsing api","hyperbeam iframe","hyperbeam iframe api","hyperbeam browser","hyperbeam browser api","multiplayer browser","multiplayer browser api","shared browser","shared browser api","cobrowsing","cobrowsing api","cobrowser","cobrowser api"],"homepage":"https://hyperbeam.dev/","bugs":{"url":"https://hyperbeam.support/Get-in-touch-ad6c0bdc9d074923950a0df76ac516b0","email":"amby@hyperbeam.com"},"author":{"name":"Ambareesh Balaji","email":"amby@hyperbeam.com"},"contributors":[{"name":"Philip Scott","email":"scotty@hyperbeam.com"},{"name":"Declan Goncalves","email":"declan@hyperbeam.com"}],"type":"module","module":"dist/index.js","types":"dist/index.d.ts","dependencies":{"@types/chrome":"^0.0.178"},"gitHead":"35a395fd94f50115d388e097123f596552839d21","_id":"@hyperbeam/iframe@0.0.9","_nodeVersion":"16.15.1","_npmVersion":"8.5.5","dist":{"integrity":"sha512-XG8MMTNTeGDOlNoFLV93HDuxwZW/fdkS4pke5zAvkxcxAoo2VDEpR0ZVK1U0onfaocCxOZum6FSPFJ6N/daq+g==","shasum":"a5fc6d6d22f540294b35c519db6241f3fa374f4a","tarball":"https://registry.npmjs.org/@hyperbeam/iframe/-/iframe-0.0.9.tgz","fileCount":4,"unpackedSize":31363,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCwbhCDczgFByPWhEdwRjOvIM+yN5Jq1XVC5BE93qUhiAIhAP/0BWJV5tDgjx/pAI0ZRitwT8zrmU08YrpVXpCJYZkH"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJitw/kACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrUdhAAmgB8R1a0C6lXxOSSwCDTNUTvFj5U6CCBwu/oV/9/8eFWpbmw\r\nEDJPF6dSySvyNV+u1h5BKrccBgkNhIgaHkVdN4ULYv4r6MaTixwbgC6RjG3G\r\n78GG5BaaNuHGTgLmY72vXk+GSKGPC4ykyJnUMFXxAC2fCkuSNfO0dQbUX26U\r\naRWy8AH4853Jq/kHK1ShRjgQuJT22OZcjgCZ9jPuiKSmtNPjXfyXZbM3ow3q\r\nx6HVcoexDb5T2VZmQXVWt1DnPq37pCD5GdCs+N18Tk8U0pgdH76gJMwj8IXQ\r\nWIAaJVFVJaoiwy+fFLYahGn+K7BOCvCrIeisudKJjMTgfsYm0UdrYBG6FEFu\r\nAePLKMCkJEkdi2z8l397v43R8OzIUc17BYBeUZk+kZsq8FkQHObY9G4SQh4c\r\nz00zryp0QFtrKZzuVFoDnHUm+2xnGzf6LSPQ8xtf1hqPVaM+h25uas99PMj+\r\nLooL0ECfhvA+s4P2UNtFZb6bs0K6FA/1hc6MKUYCf2W4qynFXvf66ihCxWAJ\r\nVrgsP5PrlWB2p39G3J4MW5cUZOc43ec5aIYZHg2ENgoJJuQsxFcCWuNvG50O\r\nkzUPOeleZB/594+XnGou+yslYHxyTgel1ojrrjZMu60cy4tEN9d1jG1HgMCN\r\nCejn4gUlGmmF1pyDOGdCNuUVO4IN8K4XCoA=\r\n=DM2v\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ambyjkl","email":"ambareeshbalaji@gmail.com"},"directories":{},"maintainers":[{"name":"ambyjkl","email":"ambareeshbalaji@gmail.com"},{"name":"scottyfillups","email":"scotty@hyperbeam.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/iframe_0.0.9_1656164324377_0.7143696451476496"},"_hasShrinkwrap":false,"deprecated":"please use https://www.npmjs.com/package/@hyperbeam/web instead"},"0.0.10":{"name":"@hyperbeam/iframe","version":"0.0.10","description":"iframe client library for the Hyperbeam multiplayer browser API","keywords":["hyperbeam","hyperbeam api","hyperbeam cobrowser","hyperbeam cobrowser api","hyperbeam cobrowsing","hyperbeam cobrowsing api","hyperbeam iframe","hyperbeam iframe api","hyperbeam browser","hyperbeam browser api","multiplayer browser","multiplayer browser api","shared browser","shared browser api","cobrowsing","cobrowsing api","cobrowser","cobrowser api"],"homepage":"https://hyperbeam.dev/","bugs":{"url":"https://hyperbeam.support/Get-in-touch-ad6c0bdc9d074923950a0df76ac516b0","email":"amby@hyperbeam.com"},"author":{"name":"Ambareesh Balaji","email":"amby@hyperbeam.com"},"contributors":[{"name":"Philip Scott","email":"scotty@hyperbeam.com"},{"name":"Declan Goncalves","email":"declan@hyperbeam.com"}],"type":"module","module":"dist/index.js","types":"dist/index.d.ts","dependencies":{"@types/chrome":"^0.0.178"},"gitHead":"35a395fd94f50115d388e097123f596552839d21","_id":"@hyperbeam/iframe@0.0.10","_nodeVersion":"16.15.1","_npmVersion":"8.5.5","dist":{"integrity":"sha512-B9C3zW48hoes8wW1BzUcD/FuYZZfyAXYAZk8UD0v7Vws4WlCt/0f1HGpfmgmKbTsJTrDeuc2IK0W1Zcrxc+hzg==","shasum":"141ffe79f91bff89706029266f63c6287ec163f1","tarball":"https://registry.npmjs.org/@hyperbeam/iframe/-/iframe-0.0.10.tgz","fileCount":4,"unpackedSize":31364,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDzb/KQ9Eh3mhraK70coh9DpucDzWmxqRCIuNA8Ha4S/QIhAOCLwEv1wMYQ7lSv0rs0dc14g/j/Bx/vJoK+RBOcuqQ9"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJitzQCACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmozmg/+P1CI4d1RLTDvpvFji1ASX35FzcOM5h7cdUs0Tef1Lx7oVQPh\r\nvGvLxIPPRRkQJflK3q2C6zRY95zWkHekYvASyIrAmScRMDcwGq4qFlEsTpc8\r\nBYnWmecqJFMGcglanW5RrP6AzccRETbS4T2H7iAdqOXLUY5TfDJfly55l+zj\r\nAAzuv7D2qgjoagVs4aoGQ1C1XVmj430nAoQxxXXfF9pnPtZlLiRAuF3rL0Qy\r\n1VAhD+lnqn1ePOapzkaadPGIp/Hu100ahNV0LXpW6+f+SxHt3QSw0Qs5RV+W\r\noKCGZ/4Rw6f70OlXZV8vkE/Hnapq7RKB5KnLgcTmMRqXKUmgpQjeb1tEhZdG\r\nz2xo/jZRrwLBeV+9jlfIEcnjEP2nx+QsReASLp0EL2rKqpZu6WvjKNcknqf6\r\nGwZaV2I7Tp12ImUei5SDO13Mcd68hfntKmaM8gn/pwuPHBxBV/FCCgp2+1ep\r\nv/orzm3xFhJLeDLMHbgVUY8E0f9LVwKWEU/lVasEKJnAayhU3P06tb/ETIB+\r\n6ZhQUz9GsjWWb8txLLbnmX8iQ1JiHqu23A+VrFl4LSsr1AiVTdxOxdJU6/tp\r\nKvLdnBVqEy/spNvtS+sGAGzodMku6o2QHIahYciAFEfHX959/WC45t2EnTHr\r\nO1PMawYEbHEuLQIXa/YkAQplEA7ryY7X5V4=\r\n=BT21\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ambyjkl","email":"ambareeshbalaji@gmail.com"},"directories":{},"maintainers":[{"name":"ambyjkl","email":"ambareeshbalaji@gmail.com"},{"name":"scottyfillups","email":"scotty@hyperbeam.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/iframe_0.0.10_1656173570141_0.7146227359259716"},"_hasShrinkwrap":false,"deprecated":"please use https://www.npmjs.com/package/@hyperbeam/web instead"},"0.0.11":{"name":"@hyperbeam/iframe","version":"0.0.11","description":"iframe client library for the Hyperbeam multiplayer browser API","keywords":["hyperbeam","hyperbeam api","hyperbeam cobrowser","hyperbeam cobrowser api","hyperbeam cobrowsing","hyperbeam cobrowsing api","hyperbeam iframe","hyperbeam iframe api","hyperbeam browser","hyperbeam browser api","multiplayer browser","multiplayer browser api","shared browser","shared browser api","cobrowsing","cobrowsing api","cobrowser","cobrowser api"],"homepage":"https://hyperbeam.dev/","bugs":{"url":"https://hyperbeam.support/Get-in-touch-ad6c0bdc9d074923950a0df76ac516b0","email":"amby@hyperbeam.com"},"author":{"name":"Ambareesh Balaji","email":"amby@hyperbeam.com"},"contributors":[{"name":"Philip Scott","email":"scotty@hyperbeam.com"},{"name":"Declan Goncalves","email":"declan@hyperbeam.com"}],"type":"module","module":"dist/index.js","types":"dist/index.d.ts","dependencies":{"@types/chrome":"^0.0.178"},"gitHead":"8da9c063c17c944f2010cd2054c157068a033ce8","_id":"@hyperbeam/iframe@0.0.11","_nodeVersion":"16.15.1","_npmVersion":"8.5.5","dist":{"integrity":"sha512-IClVFoHMF9+e88eyK9PlBQ4UMU3vtffHm+EkcdheUVTI+7aqImuZz/CfxyBFGlgoYUmaaNxGhUOL8R6vnxPG+w==","shasum":"8feda9712f3eaa7cf29e1cd118f43ac5f3da707e","tarball":"https://registry.npmjs.org/@hyperbeam/iframe/-/iframe-0.0.11.tgz","fileCount":4,"unpackedSize":31739,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDAm1K0qOkHH294YBc+lKSN/rWdYuGzilvOg99vLgdT6AIhAK8JEM/VVGlOChiflLQH7kH0/sCOUvTcWmVIoGT9yK7m"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi0IHJACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmortg/+PADj+E/xHUFc+8p0gNuiuZt28OUB8dyK4fZm9REQ0LFVPX0m\r\niNo9xdbssWxKHNtAXp+ByIpRcIoc3FtkS7iOAO4Lq0ooW4C96PpRMzIuB/Tg\r\ncSORAquq5NtBak6YlEQO+o5KgJd1IVAjQscOnC3Ge3atzL57z3nTz+2/oNxJ\r\nD/nVzGoWYdLGjg3bLx4a7bGB6uz/Pkt6AJnJ733musHY9ImXK2N+hAaZ584W\r\n1vo8TDePDbFkai32uXXmVeBMvjDLqDmqVbujpPB6NFop4M18D2jR58YkIV51\r\ni07LBB1htNDad2za+Y7fx+LgQzqmizVonxauN+9zAy2ECpaL1Zp8gK3eP9BR\r\nM05dWneq16GUpM63u3VpJ3pnyQJoQACKIG3w6vnv5xuhx5aAExapZM1qFHxC\r\nAYuy04L6KbfttfMz1jj7XOHlf3FFoboX9UojyJsRwJDLe9Dnwn4r7iDhc91W\r\nVzEKi4L2OCEASDgaOUlGAr6QDFfdg29KIah51o1tMAuReQ7bGk4lg2wXqtOq\r\nAtTYki/pGXpJKlq+Dp8ElyAo2s8Z1dL0QppaQqDOwYRX2cGy6VtoyDXvSS+H\r\nxIg6y4nA1mX+dlDt23x0gBYx4svvD8vPqguYbFs38K5xbGv3SHbcPtfZV5bu\r\n4yODl9jVWVW7zOHTGdd7+RxsvCiKQkMKR+g=\r\n=FUqI\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"scottyfillups","email":"scotty@hyperbeam.com"},"directories":{},"maintainers":[{"name":"ambyjkl","email":"ambareeshbalaji@gmail.com"},{"name":"scottyfillups","email":"scotty@hyperbeam.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/iframe_0.0.11_1657831881480_0.10631307154338776"},"_hasShrinkwrap":false,"deprecated":"please use https://www.npmjs.com/package/@hyperbeam/web instead"},"0.0.12":{"name":"@hyperbeam/iframe","version":"0.0.12","description":"iframe client library for the Hyperbeam multiplayer browser API","keywords":["hyperbeam","hyperbeam api","hyperbeam cobrowser","hyperbeam cobrowser api","hyperbeam cobrowsing","hyperbeam cobrowsing api","hyperbeam iframe","hyperbeam iframe api","hyperbeam browser","hyperbeam browser api","multiplayer browser","multiplayer browser api","shared browser","shared browser api","cobrowsing","cobrowsing api","cobrowser","cobrowser api"],"homepage":"https://hyperbeam.dev/","bugs":{"url":"https://hyperbeam.support/Get-in-touch-ad6c0bdc9d074923950a0df76ac516b0","email":"amby@hyperbeam.com"},"author":{"name":"Ambareesh Balaji","email":"amby@hyperbeam.com"},"contributors":[{"name":"Philip Scott","email":"scotty@hyperbeam.com"},{"name":"Declan Goncalves","email":"declan@hyperbeam.com"}],"type":"module","module":"dist/index.js","types":"dist/index.d.ts","dependencies":{"@types/chrome":"^0.0.178"},"gitHead":"af10619ffb99a53b99dd6203a7bb332fc44a9919","_id":"@hyperbeam/iframe@0.0.12","_nodeVersion":"16.15.1","_npmVersion":"8.5.5","dist":{"integrity":"sha512-xO/DbAshe9t7mCFhasHaWJfWS49Ag5fbXPQTbJd86IMDS+8jaLdoa7bRAvZ/QJs9v7r/JjMgWxL3QxCiSoap7Q==","shasum":"4345e87acb10165674ab18b250134015a84b7743","tarball":"https://registry.npmjs.org/@hyperbeam/iframe/-/iframe-0.0.12.tgz","fileCount":4,"unpackedSize":31743,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDIkHBZQHCSGx3EXXG2Q9REEkcynU5ncS2C0Vl/MOmP8wIgUbj65QJYtu/fLkU+8PUwsPD1/37NJrIug0coYLHBmh8="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi0IqUACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqeng/+IGoxwOwI7/Lzd8XqfALBw4zDODOfeBugqyEa26fAMNbDqUOE\r\nQTQ9y+Nx933KT8GKVwWp+0s1zUNTbBRPIxjLhngtPPFJTedRe1M8ESQUWmfv\r\nUh5M/SBCpAyUHws1hLNY+emSbX6cWGUtbvNlFsJUo6PLinV32EGKDpx9lVgy\r\n/z9wrA+ffrqX8/E9pLR97MGEVEkCT9++JAVOXPZsdBEKINh0pVcnNd8kIYA1\r\nqUXX9fKJjlDr8Arm62PpC3AoujWmnwuyma32qhJkGr5mJ9uNLDFjhtqWq5g6\r\ntmBR21tAbYFLg9CnIWTkrbsLqSgZEBhQcjNf031gtg3ta4uYpDC44yMKaxGq\r\nBAoFC2SMvGu07F+xP056ldA77Deyqe97cJFgG1+xR9vW11I/J9ZqMSqPmluu\r\nDp+EKZPYiGWaNdfkhu75cCuU3Lt09j+pfZmGXF+reYnY42AfsvH5k8/RXEni\r\nyUlyYBRCkazDIZES/7L8aExTwhLFWNviA6Gsut7cdLcNXwgBPhdWLjK1kPQE\r\n/WUwwjFqjnD3UoftCokDGklDpaYeH5JWNkOFY4Rys+W1FDVj9JJjz7Mpqdrc\r\npCvHwNR9VOV3B9Vf68qhEtyXgTR8r73/hnqGx/NNb/iE5JPWVbzN2RU0HhUH\r\nTTS4BfHzNtH+al9BLP4BcLP/XPgv7Mxgqko=\r\n=1HoT\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ambyjkl","email":"ambareeshbalaji@gmail.com"},"directories":{},"maintainers":[{"name":"ambyjkl","email":"ambareeshbalaji@gmail.com"},{"name":"scottyfillups","email":"scotty@hyperbeam.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/iframe_0.0.12_1657834132282_0.9870737211092429"},"_hasShrinkwrap":false,"deprecated":"please use https://www.npmjs.com/package/@hyperbeam/web instead"},"0.0.14":{"name":"@hyperbeam/iframe","version":"0.0.14","description":"Web client library for the Hyperbeam multiplayer browser API","keywords":["hyperbeam","hyperbeam api","hyperbeam cobrowser","hyperbeam cobrowser api","hyperbeam cobrowsing","hyperbeam cobrowsing api","hyperbeam iframe","hyperbeam iframe api","hyperbeam browser","hyperbeam browser api","multiplayer browser","multiplayer browser api","shared browser","shared browser api","cobrowsing","cobrowsing api","cobrowser","cobrowser api"],"homepage":"https://hyperbeam.dev/","bugs":{"url":"https://hyperbeam.support/Get-in-touch-ad6c0bdc9d074923950a0df76ac516b0","email":"amby@hyperbeam.com"},"author":{"name":"Ambareesh Balaji","email":"amby@hyperbeam.com"},"contributors":[{"name":"Philip Scott","email":"scotty@hyperbeam.com"},{"name":"Declan Goncalves","email":"declan@hyperbeam.com"}],"type":"module","module":"dist/index.js","types":"dist/index.d.ts","dependencies":{"@types/chrome":"^0.0.178"},"gitHead":"ffd56065c8608a65fcd2f480449b02cef6ad981a","_id":"@hyperbeam/iframe@0.0.14","_nodeVersion":"16.16.0","_npmVersion":"8.14.0","dist":{"integrity":"sha512-2U1SzOxhP92r9z9MRwucrIOz8pG3nUp0T94jozNwa6m5Zm1ASR6totAgEfdJoW58JUNMfUiLy0d/rzTjqU4KGw==","shasum":"984296dbf50279128d17405a72e1538351a2ed8a","tarball":"https://registry.npmjs.org/@hyperbeam/iframe/-/iframe-0.0.14.tgz","fileCount":4,"unpackedSize":32155,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBki7RWT7estaSoYC9wgeF/q+jin7K63yMkIr9Bi738hAiB0ZACPi5/E78fr+V2ypwCydIiONPSzuEZtGGPYDZhHqA=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi2yjaACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqqPxAAhdXJGNoc9yJ+esHkfiXBn0lNC5J6oy6P2ujVFEWOCkFr6qZn\r\nQWaFo9x6gla9VJ20L+OVMuG99w0K114V4uTBPPSLcZYYnsHkEAiFmLaapwas\r\n/xkN+fNqdEnOf9nTN244JsgOcgcydQ6MjawRJsdHJ5mQxVmy/6jKQjq7JCPI\r\nizhZTjmODorOPg5zkhGQmBWkqclMk/DXl6QZDyigRVaynXhonrx31rKxzmrm\r\nuGblDtyCIFv+hyoVp//N0ABDUvy163L1FqoAONSOH+w79I/RXXblP/X4XusO\r\nl1STm+5JEj9SbK5igTJck+1zaH97gEY+bCtB9PahuE8zf980ID5WE8Xn2JyJ\r\nuN/TCZB0FQrqT4+0z7kjrIbxtBERNsSA/1y30+c4CHFE3IglD5Lpm8hCALfW\r\nZnPQERvnOTlHRNCz7vpor8PzdJB2SSgpfry8G1cxgl1zJyM/lp2ONyL7VgpL\r\nQSqaWEnfhybC41Ml8FbGwVIw3gnltOVnC4GuoGeqdhsMWHsT0SBDQpUvSY7J\r\nl9tBYpaXKnqgiWMCRjt3hfeBEatI82hrLqw3MMmo9KJYMWmL6hKaRD5sCmrL\r\nEhxDQ521w7nBjc3DurLzynFTNLu1zDsclx9UUcgQyItp4X8DskcPEpV2CzbM\r\nLVg0I31S+se/0hdaVUpZkKAJ6oKw2rbMZxA=\r\n=BCFa\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ambyjkl","email":"ambareeshbalaji@gmail.com"},"directories":{},"maintainers":[{"name":"ambyjkl","email":"ambareeshbalaji@gmail.com"},{"name":"scottyfillups","email":"scotty@hyperbeam.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/iframe_0.0.14_1658530010080_0.910461803546029"},"_hasShrinkwrap":false,"deprecated":"please use https://www.npmjs.com/package/@hyperbeam/web instead"}},"time":{"created":"2022-02-18T23:19:35.751Z","0.0.0":"2022-02-18T23:19:35.989Z","modified":"2022-07-22T22:47:25.271Z","0.0.1":"2022-02-19T00:42:33.415Z","0.0.2":"2022-02-20T01:54:09.270Z","0.0.3":"2022-02-20T02:20:17.993Z","0.0.4":"2022-02-20T03:03:37.955Z","0.0.5-beta.0":"2022-03-12T01:59:39.607Z","0.0.5-beta.1":"2022-03-12T14:39:00.891Z","0.0.5-beta.2":"2022-03-12T14:40:18.016Z","0.0.5-beta.3":"2022-03-12T14:41:20.924Z","0.0.5-beta.4":"2022-03-14T17:07:25.772Z","0.0.5-beta.5":"2022-03-14T17:41:59.352Z","0.0.5-beta.6":"2022-03-16T01:45:42.694Z","0.0.5-beta.7":"2022-03-18T01:17:21.739Z","0.0.5":"2022-03-31T21:52:54.473Z","0.0.6-alpha.1":"2022-04-06T00:11:00.963Z","0.0.6-alpha.2":"2022-04-06T13:38:32.065Z","0.0.6-alpha.3":"2022-04-06T14:02:32.081Z","0.0.6":"2022-04-19T20:33:39.959Z","0.0.7-alpha.1":"2022-04-24T03:57:18.911Z","0.0.7-alpha.2":"2022-04-24T19:16:50.623Z","0.0.7-alpha.3":"2022-04-26T16:47:49.574Z","0.0.7":"2022-05-19T17:30:44.454Z","0.0.8-alpha.1":"2022-05-26T15:58:42.815Z","0.0.8":"2022-06-17T17:52:08.098Z","0.0.9":"2022-06-25T13:38:44.564Z","0.0.10":"2022-06-25T16:12:50.317Z","0.0.11":"2022-07-14T20:51:21.666Z","0.0.12":"2022-07-14T21:28:52.463Z","0.0.14":"2022-07-22T22:46:50.269Z"},"maintainers":[{"name":"ambyjkl","email":"ambareeshbalaji@gmail.com"},{"name":"scottyfillups","email":"scotty@hyperbeam.com"}],"description":"Web client library for the Hyperbeam multiplayer browser API","homepage":"https://hyperbeam.dev/","keywords":["hyperbeam","hyperbeam api","hyperbeam cobrowser","hyperbeam cobrowser api","hyperbeam cobrowsing","hyperbeam cobrowsing api","hyperbeam iframe","hyperbeam iframe api","hyperbeam browser","hyperbeam browser api","multiplayer browser","multiplayer browser api","shared browser","shared browser api","cobrowsing","cobrowsing api","cobrowser","cobrowser api"],"contributors":[{"name":"Philip Scott","email":"scotty@hyperbeam.com"},{"name":"Declan Goncalves","email":"declan@hyperbeam.com"}],"author":{"name":"Ambareesh Balaji","email":"amby@hyperbeam.com"},"bugs":{"url":"https://hyperbeam.support/Get-in-touch-ad6c0bdc9d074923950a0df76ac516b0","email":"amby@hyperbeam.com"},"readme":"# DEPRECATED, please use [@hyperbeam/web](https://www.npmjs.com/package/@hyperbeam/web) instead\n\nThe JavaScript frontend library for the Hyperbeam multiplayer browser API.\n\nUnfamiliar with the Hyperbeam API? Read the full documentation <a href=\"https://hyperbeam.support/API-Design-eb9874bd1ef54c22ba7197324ce22231\" target=\"_blank\">here</a>.\n\n## Table of Contents\n\n- [Features](#features)\n- [Installation](#installation)\n- [Example](#example)\n- [API](#api)\n  - [Loading multiplayer browser](#loading-multiplayer-browser)\n  - [Setting video volume](#setting-video-volume)\n  - [Getting user ID](#getting-user-id)\n  - [Pausing video stream](#pausing-video-stream)\n  - [Setting admin token](#setting-admin-token)\n  - [Setting permissions](#setting-permissions)\n  - [Send events programmatically](#send-events-programmatically)\n  - [Control tabs programmatically](#control-tabs-programmatically)\n  - [Listen to tab events](#listen-to-tab-events)\n\n## Features\n\n- Connect to a multiplayer browser\n- Control browser navigation programmatically\n- Query browser state and listen to events\n- Manage user control permissions\n- Set local multiplayer browser volume\n\n## Installation\n\nUsing npm:\n\n```bash\n$ npm install @hyperbeam/web --save\n```\n\nUsing unpkg:\n\n```html\n<script type=\"module\">\n  import Hyperbeam from \"https://unpkg.com/@hyperbeam/web@latest/dist/index.js\"\n  // ...\n</script>\n```\n\n## Example\n\nYou can save this code snippet as `example.html` and run it in your browser. Make sure you set the embed URL variable to the response data from the [REST API](https://hyperbeam.support/Hyperbeam-API-eb9874bd1ef54c22ba7197324ce22231#d326c958e95244b89cf7ffdbcb07e9bd).\n\n```html\n<div style=\"font-family: Arial\">\n  <button id=\"reload\">Reload</button>\n  <button id=\"back\">Go Back</button>\n  <button id=\"forward\">Go Forward</button>\n  <button id=\"youtube\">Open Youtube.com</button>\n  Volume: <input type=\"range\" min=\"0\" max=\"100\" value=\"100\" id=\"range\">\n  <p>User ID: <span id=\"userId\"></span></p>\n  <p>Current website: <span id=\"currentSite\"></p>\n</div>\n<iframe id=\"container\" style=\"height:720px;width:1280px\"></iframe>\n<script type=\"module\">\n  import Hyperbeam from \"https://unpkg.com/@hyperbeam/web@latest/dist/index.js\"\n  // TODO: Set the embedURL variable\n  const embedURL = \"<your-embed-url>\"\n  const hb = await Hyperbeam(container, embedURL)\n  userId.innerText = hb.userId\n  reload.addEventListener(\"click\", () => {\n    hb.tabs.reload()\n  })\n  back.addEventListener(\"click\", () => {\n    hb.tabs.goBack()\n  })\n  forward.addEventListener(\"click\", () => {\n    hb.tabs.goForward()\n  })\n  youtube.addEventListener(\"click\", () => {\n    hb.tabs.update({ url: \"https://youtube.com\" })\n  })\n  range.addEventListener(\"change\", (e) => {\n    hb.volume = e.target.value / 100\n  })\n  hb.tabs.onUpdated.addListener((tabId, changeInfo) => {\n    if (changeInfo.title) {\n      currentSite.innerText = changeInfo.title\n    }\n  })\n</script>\n```\n\n## API Reference\n\n### Loading multiplayer browser\n\n**Hyperbeam(container: HTMLIFrameElement | HTMLDivElement, embedURL: string, opts?: HyperbeamOptions): Promise\\<HyperbeamClient\\>**\n\nCreates a new Hyperbeam client.\n\n```js\n// The embedURL is retrieved from the REST API\n// Documentation for the REST API can be found here:\n// hyperbeam.support/API-Design-eb9874bd1ef54c22ba7197324ce22231\nconst embedURL = \"https://abc.hyperbeam.com/foo?token=bar\"\nconst container = document.getElementById(\"container-id\")\n\nconst hb = await Hyperbeam(container, embedURL, {\n  // Number of milliseconds until the request to the multiplayer browser times out.\n  // If the request times out, the returned promise will be rejected.\n  timeout: 5000, // default = 2000\n\n  // An admin token returned from the REST API that will grant this user\n  // access to managing user permissions and programmatic navigation.\n  adminToken: \"admin_token_from_rest_api_response\",\n\n  // Starting volume of the multiplayer browser\n  volume: 0.2,         // default = 1.0\n\n  // Starting video pause state of the multiplayer browser\n  videoPaused: false,  // default = false\n\n  // Data to be provided to your webhook endpoint if you're using webhook authentication\n  webhookUserdata: {myAppData: {user: \"your-app-user-id\"}}\n})\n```\n\n### Destroying the embed\n\n**hb.destroy()**\n\nTears down network connections and browser events. Always call this *before* removing the container element from the page.\n\n```js\nconst hb = await Hyperbeam(container, embedURL)\nsetTimeout(() => {\n  hb.destroy()\n}, 10_000)\n```\n\n### Setting video volume\n\n**hb.volume = 0.5**\n\nSets the volume for the multiplayer browser *locally*. Volume changes only apply to the local user. This setting is *not* persisted on refreshing the page.\n\n```js\nconst hb = await Hyperbeam(container, embedURL)\n// Valid values range from 0.0 to 1.0\nhb.volume = 0.5        // default = 1.0\nconsole.log(hb.volume) // Get the local volume value\n```\n\n### Getting user ID\n\n**hb.userId: string**\n\nGets the client's user ID. A \"user\" is defined as a single connection to the multiplayer browser. If a person has multiple tabs connected to the multiplayer browser, each tab with an active connection will be assigned a different user ID.\n\n```js\nconst hb = await Hyperbeam(container, embedURL)\nconsole.log(hb.userId) // A unique string identifying the user\n```\n\n### Pausing video stream\n\n**hb.videoPaused = true**\n\nPauses/resumes the video stream for the multiplayer browser *locally*. Useful if only the audio component is of interest and you want to minimize CPU usage.\n\n```js\nconst hb = await Hyperbeam(container, embedURL)\nhb.videoPaused = true       // Pause the video stream\nhb.videoPaused = false      // Resume the video stream\nconsole.log(hb.videoPaused) // Get the video stream pause state\n```\n\n### Setting admin token\n\n**hb.adminToken = \"adminToken\"**\n\nSets the client's admin token. The client must have an admin token set to manage user permissions and control the tabs programmatically.\n\n```js\n// You can provide the admin token during initialization\nconst hb = await Hyperbeam(container, embedURL, {\n  adminToken: \"admin_token_from_rest_api_response\"\n})\n\n// In some situations, you may want to promote the user to\n// an admin after initialization. For example, promoting a \"user\" to a \"moderator\".\nconst hb = await Hyperbeam(container, embedURL)\nhb.adminToken = \"admin_token_from_rest_api_response\"\n```\n\n### Setting permissions\n\n**hb.setPermission(userId: string, permissionData: PremissionData): Promise\\<void\\>**\n\nSets the permission of a user by their ID. The client must have an admin token set to manage user permissions.\n\n```js\n// You can provide the admin token during initialization\nconst hb = await Hyperbeam(container, embedURL, {\n  adminToken: \"admin_token_from_rest_api_response\"\n})\n\nconst targetUserId = \"a_user_id\"\n\n// All keys can be omitted: if the key is omitted, then the existing value will be unchanged\nconst permissions = {\n  // Higher value = higher priority\n  // Users with a higher priority will preempt the control of lower priority users.\n  priority: 2,           // default = 0\n\n  // Number of milliseconds until a user is considered \"idle\". Once a user is considered\n  // idle, they no longer preempt lower priority users until they interact with the\n  // multiplayer browser again.\n  idle_timeout: 3000,    // default = 0\n\n  // If control_disabled = true, all control input (mouse movements, keyboard presses)\n  // will be ignored. Note that disabling control does not restrict access to any\n  // APIs that require admin tokens.\n  control_disabled: true // default = control_disable_default (see REST API)\n}\n\nhb.setPermissions(targetUserId, permissions)\n```\n\n### Send events programmatically\n\n**hb.sendEvent(event: KeyEvent | MouseEvent | WheelEvent): void**\n\nSends a keyboard, mouse, or mouse wheel event to the Hyperbeam browser.\n\n```js\nconst keyEvent = {\n  type: \"keydown\", // type can be set to \"keydown\" and \"keyup\"\n  // String denoting which key is pressed.\n  // See https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_key_values\n  key: \"A\",\n  ctrlKey: true // Boolean indicating if the Ctrl key is pressed. Default is false.\n  metaKey: false // Boolean indicating if the Meta key is pressed. Default is false.\n}\n\nconst mouseEvent = {\n  type: \"mousedown\" // type can be set to \"mousemove\", \"mousedown\", and \"mouseup\"\n  x: 0.5, // The mouse's X position as a ratio, with a range of [0, 1]\n  y: 0.5, // The mouse's Y position as a ratio, with a range of [0, 1]\n  // Number that indicates which button was pressed on the mouse. Default is 0.\n  // See https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button\n  button: 2\n}\n\nconst wheelEvent = {\n  type: \"wheel\", // Mouse wheel event, used for scrolling up or down\n  deltaY: 20 // Positive value signifies scrolling down\n}\n\nhb.sendEvent(keyEvent) // Send CTRL+A keystroke\nhb.sendEvent(mouseEvent) // Right-click the center of the screen (0.5, 0.5)\nhb.sendEvent(wheelEvent) // Scroll down\n```\n\n### Control tabs programmatically\n\nHyperbeam's tab API mirrors Chrome extension tab API, found <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method\" target=\"_blank\">here</a>.\n\nRather than calling `chrome.tabs.create({ active: true })`, you will would call `hb.tabs.create({ active: true })`.\n\nWe support the following methods:\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-create\" target=\"_blank\">tabs.create</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-detectLanguage\" target=\"_blank\">tabs.detectLanguage</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-discard\" target=\"_blank\">tabs.discard</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-duplicate\" target=\"_blank\">tabs.duplicate</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-get\" target=\"_blank\">tabs.get</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-getZoom\" target=\"_blank\">tabs.getZoom</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-getZoomSettings\" target=\"_blank\">tabs.getZoomSettings</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-goBack\" target=\"_blank\">tabs.goBack</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-goForward\" target=\"_blank\">tabs.goForward</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-group\" target=\"_blank\">tabs.group</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-highlight\" target=\"_blank\">tabs.highlight</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-move\" target=\"_blank\">tabs.move</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-query\" target=\"_blank\">tabs.query</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-reload\" target=\"_blank\">tabs.reload</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-remove\" target=\"_blank\">tabs.remove</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-setZoom\" target=\"_blank\">tabs.setZoom</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-setZoomSettings\" target=\"_blank\">tabs.setZoomSettings</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-ungroup\" target=\"_blank\">tabs.ungroup</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#method-update\" target=\"_blank\">tabs.update</a>\n\n```js\nconst hb = await Hyperbeam(container, embedURL)\n\n// Create a tab\nconst tab = await hb.tabs.create({ active: true })\n\n// Duplicate a tab\nconst tab2 = await hb.tabs.duplicate(tab.id)\n\n// Set the URL of the active tab\nconst updatedTab = await hb.tabs.update({url: \"https://hyperbeam.dev/\"})\n```\n\n### Listen to tab events\n\nHyperbeam's tab event listener API mirrors Chrome extension tab API, found <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event\" target=\"_blank\">here</a>.\n\nRather than calling `chrome.tabs.onCreated.addListener((tab) => {})`, you will would call `hb.tabs.onCreated.addListener((tab) => {})`.\n\nWe support the following events:\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onActivated\" target=\"_blank\">tabs.onActivated</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onCreated\" target=\"_blank\">tabs.onCreated</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onHighlighted\" target=\"_blank\">tabs.onHighlighted</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onMoved\" target=\"_blank\">tabs.onMoved</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onRemoved\" target=\"_blank\">tabs.onRemoved</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onReplaced\" target=\"_blank\">tabs.onReplaced</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onUpdated\" target=\"_blank\">tabs.onUpdated</a>\n- <a href=\"https://developer.chrome.com/docs/extensions/reference/tabs/#event-onZoomChange\" target=\"_blank\">tabs.onZoomChange</a>\n\n```js\nconst hb = await Hyperbeam(container, embedURL)\n\nfunction onTabCreated(tab) {\n  console.log(tab.id)\n}\n\n// Listen for when a new tab is created\nhb.tabs.onCreated.addListener(onTabCreated)\n\n// Create a new tab\nawait hb.tabs.create({ active: true })\n\n// Remove the event listener\nhb.tabs.onCreated.removeListener(onTabCreated)\n```\n","readmeFilename":"README.md"}