{"_id":"@dytesdk/opentok-shim","_rev":"2-4eea7cabdf3c1b3c3f26719fce0ba84b","name":"@dytesdk/opentok-shim","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.1":{"name":"@dytesdk/opentok-shim","version":"0.0.1","license":"UNLICENSED","_id":"@dytesdk/opentok-shim@0.0.1","maintainers":[{"name":"dyteindia","email":"dev@dyte.io"}],"homepage":"https://dyte.io","bugs":{"url":"https://community.dyte.io"},"dist":{"shasum":"86e9fbd6ba4eca32c8ecba51750b6fe58be3ee6c","tarball":"https://registry.npmjs.org/@dytesdk/opentok-shim/-/opentok-shim-0.0.1.tgz","fileCount":26,"integrity":"sha512-8eA+1js/dhaOFKYZc/NtHj4sVAdFkAymSBeRqYG7T+GlIOGPQ1STzMTvR9xR1d0dC812EsvNOccxY3q0EQDLhg==","signatures":[{"sig":"MEQCICTRWYMMyx1wZR/2e6W39xW6ZbF0vAVGhbVssqrrjojmAiAe77tNh6STWBX5l/KbUXgKghp/LyFKK9MSGEEvYEkwbQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":89542,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkTilTACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp6JQ//YGRAreRER/wqZjZB3kNs7fV3GSWjjHbcpMriKAXE5Cyx4w2+\r\naMH+8yLrXSXz7UFNfka90DVYgGNhTRXkEdCCM5zCmmM6lJNWZdEq4LUZXCrR\r\n2HqnsL05gahYrEO8QrUZt3W0md0M20RPy9yzd7VvyzASozxxfXSsJISv4BkF\r\nT6zytznpGlMFI+klITrs/nkEYNpKYl9nedi21M1D1CKYqffwJ22PaWOLuHN1\r\nYM+xWUndfIRqs1d7uR/2CPyiJC547p/uQWcodoPFLtI2ZEk+pPnOdru0COTl\r\ncp0tCBOgP3bURPRtc1L6h1xetbuoueXoebmnPFu7iC8+ErwAO97N+/YGz6qo\r\ntSnKoJ54ZVrU1qogM46CG5iQ9n/sXVIYfQXHz8a0B0GucMxWtZyr4RTQhN96\r\nymZn157m0RQiL5/EdNxfjTWuKjAKaxgW2Mx9elSqIGxKcmvn1X/maIY6Hsv5\r\nrKQP4cj00n46Gs0liUGUlYmU5XIb7ScVdxeoPsxm7mRgcgLced1wALpHjHzw\r\nCeLeBPs9QhzaGBd72BRdUgjjjF5jeDTyhi5mZi+6OL8IBrUWG5JH+l8OXJB5\r\nmxBjfvICNEC0tXpfTpnj2w6MwO9RSxJsTOgosCriCAccB63m3PyowqggAoDE\r\nAPQ6reX707Bj///VlVSfM8K5//fvJpniE8o=\r\n=gC3e\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/opentok.umd.cjs","type":"module","types":"./dist/src/index.d.ts","module":"./dist/opentok.js","exports":{".":{"node":"./dist/opentok.umd.cjs","import":"./dist/opentok.js","default":"./dist/opentok.iife.js","require":"./dist/opentok.umd.cjs"}},"gitHead":"e1e8703778f2686b435786fb391d1e54315b05b5","scripts":{"lint":"eslint . --cache --cache-location node_modules/.eslintcache && prettier --check .","test":"npm run lint && npm run test:js","build":"vite build && tsc","clean":"rm -rf dist/","serve":"vite preview","start":"vite","lintFix":"eslint . --fix && prettier --write .","test:js":"jest","start:tag":"run-p build:watch serve","build:watch":"vite build --watch --mode development","prepublishOnly":"npm run clean && npm run build"},"_npmUser":{"name":"dyteindia","email":"dev@dyte.io"},"_npmVersion":"8.11.0","description":"Dyte's OpenTok client-side shim","directories":{},"_nodeVersion":"16.16.0","browserslist":[">0.2%","not dead"],"dependencies":{"events":"^3.3.0","@opentok/client":">=2.0.0","@dytesdk/web-core":"latest"},"publishConfig":{"tag":"latest","access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^3.2.5","eslint":"^8.24.0","ts-jest":"^29.0.5","ts-node":"^10.9.1","prettier":"2.7.1","typescript":"^4.8.4","@types/jest":"^29.0.2","@types/node":"^18.6.4","npm-run-all":"^4.1.5","@types/events":"^3.0.0","fake-mediastreamtrack":"^1.1.6","eslint-config-prettier":"^8.5.0","jest-environment-jsdom":"^29.0.3","opentok-network-test-js":"^2.4.4","@typescript-eslint/parser":"^5.38.1","@typescript-eslint/eslint-plugin":"^5.38.1"},"_npmOperationalInternal":{"tmp":"tmp/opentok-shim_0.0.1_1682843986808_0.18486498264368545","host":"s3://npm-registry-packages"}}},"time":{"created":"2023-04-30T08:39:46.749Z","modified":"2025-09-22T09:12:57.566Z","0.0.1":"2023-04-30T08:39:47.058Z"},"bugs":{"url":"https://community.dyte.io"},"license":"UNLICENSED","homepage":"https://dyte.io","description":"Dyte's OpenTok client-side shim","maintainers":[{"email":"dev@dyte.io","name":"dyteindia"},{"email":"roerohan@gmail.com","name":"roerohan"}],"readme":"<!-- PROJECT LOGO -->\n<p align=\"center\">\n  <a href=\"https://dyte.io\">\n    <img src=\"https://assets.dyte.io/logo-outlined.png\" alt=\"Logo\" width=\"120\" />\n  </a>\n\n  <h2 align=\"center\">Opentok shim by dyte</h3>\n\n  <p align=\"center\">\n    <br />\n    <a href=\"https://docs.dyte.io\"><strong>Explore the docs »</strong></a>\n    <br />\n    <br />\n    <a href=\"https://app.dyte.io\">View Demo</a>\n    ·\n    <a href=\"https://community.dyte.io\">Report Bug</a>\n    ·\n    <a href=\"https://community.dyte.io\">Request Feature</a>\n  </p>\n</p>\n\n<!-- TABLE OF CONTENTS -->\n\n## Table of Contents\n\n- [About the Project](#about-the-project)\n  - [Built With](#built-with)\n- [Getting Started](#getting-started)\n- [Usage](#usage)\n- [Version History](#version-history)\n- [Roadmap](#roadmap)\n- [About](#about)\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\nThis package `@dytesdk/opentok-shim` is a wrapper over the [Dyte SDK](https://dyte.io) with a Opentok compatible external API. It is a drop-in replacement for Opentok JS, and supports most of the methods and events that are\npresent in the library.\n\n### Built With\n- [@dytesdk/web-core](https://www.npmjs.com/package/@dytesdk/web-core)\n- [Typescript](https://typescriptlang.org)\n\n<!-- GETTING STARTED -->\n\n## Getting Started\n\nYou can install the `@dytesdk/opentok-shim` from the [NPM Registry](https://npmjs.com/) using the `npm install` command.\n\n```bash\nnpm install @dytesdk/opentok-shim\n```\n\n## Usage\n\nThe `@dytesdk/opentok-shim` shares the same API as the opentok Video SDK. You can use most of the methods that are supported by it. Here's a [compatibility specification](https://dyte.notion.site/opentok-Shim-Compatibility-Spec-38090f970c4845529cb709f2222b438b)\nthat describes the methods from `opentok-video` that are supported by this `@dytesdk/opentok-shim` package.\n\nHere are a few examples:\nReplace:\n\n```js\nimport * as OT from \"@opentok/client\";\n```\nwith\n\n```js\nimport * as OT from \"@dytesdk/opentok-shim\";\n```\n\nConnection\n\n```js\nconst token = \"<DYTE-AUTH-TOKEN>\";\nconst sessionId = \"\";\nconst session = OT.initSession(token, sessionId);\n```\n\n```js\nsession.on(\"streamCreated\", function streamCreated(event) {\n  console.log(\"[streamCreated] index.ts: \", event.stream);\n  session.subscribe(\n    event.stream,\n    \"subscriber\",\n    {\n      insertMode: \"append\",\n      width: \"100%\",\n      height: \"100%\",\n    },\n    handleError\n  );\n  // }\n});\n\nlet connections: OT.Connection[] = [];\nsession.on(\"connectionCreated\", (connectionCreatedEvent) => {\n  console.log(\"session connectionCreatedEvent: \", connectionCreatedEvent);\n  connections.push(connectionCreatedEvent.connection);\n\n  if (\n    connections.find(\n      (connection) =>\n        connection.connectionId ===\n        connectionCreatedEvent.connection.connectionId\n    )\n  ) {\n    console.log(\"connection already exists\");\n    return;\n  }\n  connections.push(connectionCreatedEvent.connection);\n});\n\nsession.on(\"connectionDestroyed\", (connectionDestroyedEvent) => {\n  console.log(\"session connectionDestroyedEvent: \", connectionDestroyedEvent);\n  connections = connections.filter(\n    (connection) =>\n      connection.connectionId !==\n      connectionDestroyedEvent.connection.connectionId\n  );\n});\n```\n\n<!-- CHANGELOG -->\n\n## About\n\n`opentok-shim` is created & maintained by Dyte, Inc. You can find us on Twitter - [@dyte_io](https://twitter.com/dyte_io) or write to us at `dev [at] dyte.io`.\n\nThe names and logos for Dyte are trademarks of Dyte, Inc.\n\nWe love open source software! See [our other projects](https://github.com/dyte-in) and [our products](https://dyte.io).\n","readmeFilename":"README.md"}