{"_id":"@api.video/private-video-session","_rev":"8-c6d28c2a00477a3c5ee0bf9da1dee40c","name":"@api.video/private-video-session","dist-tags":{"latest":"0.1.0"},"versions":{"0.0.1":{"name":"@api.video/private-video-session","version":"0.0.1","keywords":["video","private","apivideo"],"author":{"url":"https://api.video/","name":"api.video","email":"ecosystem-team@api.video"},"license":"MIT","_id":"@api.video/private-video-session@0.0.1","maintainers":[{"name":"apivideo-ecosystem","email":"ecosystem@api.video"},{"name":"anthony.dantard","email":"hello@api.video"},{"name":"olivierapivideo","email":"olivier@api.video"}],"homepage":"https://github.com/apivideo/api.video-typescript-private-video-session#readme","bugs":{"url":"https://github.com/apivideo/api.video-typescript-private-video-session/issues"},"dist":{"shasum":"252922dcac705e03ad751bc913e7ce3bd8833e21","tarball":"https://registry.npmjs.org/@api.video/private-video-session/-/private-video-session-0.0.1.tgz","fileCount":9,"integrity":"sha512-f1SN55i7gxNWOYEdaEq40kuntsotc7zN7dv08x3ln1TsMZKcADkawmYb5+iuFJYF3AuCUpEX2WDtd9Xedu3XYQ==","signatures":[{"sig":"MEUCIQC7tZTJbmydlunpSR0mW0Vztc7rdwRI44Mz9yoq5UrMQgIgV5T305oWDaUkaYOphJ7wFuGOTzMH6N2oSH6nR+ye8XM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":74621,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj1/atACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrwNQ//YPU706t0uYr+WvW4qMugug+XjAC9tA/E2KRnhsRP5g3WEI3E\r\nFHxfw/ZRf5PUbUmywh3N+q85ZSQepLgTSksKNbv1TNoem/50ivyPZh4YV51Z\r\nvMMKf0JeoT0gSsU7d5p4PeyTpVukoIayPBEWrEH9zxgsTTu7u/8uLb2ELBzK\r\nQCneIYEliff3ZkXq3vbbGqCV7Z9SwakZU671t6b642rOWPQm81r76q47YwLK\r\ntXtbsPZVxgohISNc1a8gT/OAPxpVwV6UnGB7gXt3kxGdJJqlzQEzQBllnrqL\r\nmm2D5ad0O0vEob1UawiLuQjQujC1Avv3qgpYf/GhXA8bwOYMAhK9BCEqnIQ+\r\nlZ40Uy3OORBqaAMYiVmBwKMNGWkJrahnJm4tubwvjrbZgX3NucMVIH3lnIN2\r\njSReQITkrWUyNcfKpmt28jrC1ddwFX9GHGkTXG0GZNwjym4XYFAt9DuxJnP8\r\n9cLQXZiNM6ZiRM+jhGPl5oB+8/z0Bw5WxlkEyE6Loy1gVgdNeEBGi/g+gKH5\r\nhdJKjbCMybxpEq6+jR3SDfVvEKGkbBA7be0f6/Ehdvi7Zr+I7Z6Ba883YihU\r\nSl17jZF/gv5ZZaJMardiQFKHN95vxwPelUXC9TGUTXy/UcjdNAt7ctu1w5td\r\n4HseSFAk3Zw7NF8/ew94sHxkzXV2McbvYpM=\r\n=udJb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","module":"dist/index.js","gitHead":"fa8d225a000dcddeb02c2cafbfcf01e246a281ec","scripts":{"test":"npm run tslint && jest","build":"npm run tslint && webpack --mode production","watch":"webpack --mode development --watch","tslint":"tslint --project .","prepublishOnly":"npm run build"},"typings":"./dist/index.d.ts","_npmUser":{"name":"apivideo-ecosystem","email":"ecosystem@api.video"},"repository":{"url":"git+ssh://git@github.com/apivideo/api.video-typescript-private-video-session.git","type":"git"},"_npmVersion":"8.19.3","description":"api.video private video session","directories":{},"_nodeVersion":"16.19.0","dependencies":{"md5":"^2.3.0","core-js":"^3.8.3","url-polyfill":"^1.1.12","whatwg-fetch":"^3.6.2"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","jsdom":"^16.5.1","tslint":"^6.1.3","ts-jest":"^26.5.4","ts-node":"^9.1.1","webpack":"^5.68.0","ts-loader":"^8.0.18","@types/md5":"^2.3.0","typescript":"^4.2.3","@types/jest":"^26.0.21","webpack-cli":"^4.9.2","@types/jsdom":"^16.2.7","jsdom-global":"^3.0.2","jest-fetch-mock":"^3.0.3","@types/whatwg-fetch":"0.0.33"},"_npmOperationalInternal":{"tmp":"tmp/private-video-session_0.0.1_1675097773349_0.05884149141809503","host":"s3://npm-registry-packages"}},"0.0.2":{"name":"@api.video/private-video-session","version":"0.0.2","keywords":["video","private","apivideo"],"author":{"url":"https://api.video/","name":"api.video","email":"ecosystem-team@api.video"},"license":"MIT","_id":"@api.video/private-video-session@0.0.2","maintainers":[{"name":"apivideo-ecosystem","email":"ecosystem@api.video"},{"name":"anthony.dantard","email":"hello@api.video"},{"name":"olivierapivideo","email":"olivier@api.video"}],"homepage":"https://github.com/apivideo/api.video-typescript-private-video-session#readme","bugs":{"url":"https://github.com/apivideo/api.video-typescript-private-video-session/issues"},"dist":{"shasum":"48d215189642bb948dfa685ca38942445e294a1a","tarball":"https://registry.npmjs.org/@api.video/private-video-session/-/private-video-session-0.0.2.tgz","fileCount":9,"integrity":"sha512-cvXk9zt5vMUmGiArcvxrnXqKXXNveBYkGDd3r/AEjaDtEHLwtoqcarfcz9VkOzFC/o0GI+AZRn5WkxAKoMONRw==","signatures":[{"sig":"MEUCIQDfMI6FGRJt70E5CFgBQRKXY9OvmynXC51qdlHqb/dwUQIgMqQllwMDjSyxys9dcS7Ekwr8r1oaQcYOSlcp+jzfjJU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":75223},"main":"dist/index.js","module":"dist/index.js","gitHead":"abf26e1708a3031a84f1173ae2de5b4aaf3b518e","scripts":{"test":"npm run tslint && jest","build":"npm run tslint && webpack --mode production","watch":"webpack --mode development --watch","tslint":"tslint --project .","prepublishOnly":"npm run build"},"typings":"./dist/index.d.ts","_npmUser":{"name":"apivideo-ecosystem","email":"ecosystem@api.video"},"repository":{"url":"git+ssh://git@github.com/apivideo/api.video-typescript-private-video-session.git","type":"git"},"_npmVersion":"9.8.1","description":"api.video private video session","directories":{},"_nodeVersion":"18.18.2","dependencies":{"md5":"^2.3.0","core-js":"^3.8.3","url-polyfill":"^1.1.12","whatwg-fetch":"^3.6.2"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","jsdom":"^16.5.1","tslint":"^6.1.3","ts-jest":"^26.5.4","ts-node":"^9.1.1","webpack":"^5.68.0","ts-loader":"^8.0.18","@types/md5":"^2.3.0","typescript":"^4.2.3","@types/jest":"^26.0.21","webpack-cli":"^4.9.2","@types/jsdom":"^16.2.7","jsdom-global":"^3.0.2","jest-fetch-mock":"^3.0.3","@types/whatwg-fetch":"0.0.33"},"_npmOperationalInternal":{"tmp":"tmp/private-video-session_0.0.2_1701247519664_0.3806256850938432","host":"s3://npm-registry-packages"}},"0.0.3":{"name":"@api.video/private-video-session","version":"0.0.3","keywords":["video","private","apivideo"],"author":{"url":"https://api.video/","name":"api.video","email":"ecosystem-team@api.video"},"license":"MIT","_id":"@api.video/private-video-session@0.0.3","maintainers":[{"name":"apivideo-ecosystem","email":"ecosystem@api.video"},{"name":"anthony.dantard","email":"hello@api.video"},{"name":"olivierapivideo","email":"olivier@api.video"}],"homepage":"https://github.com/apivideo/api.video-typescript-private-video-session#readme","bugs":{"url":"https://github.com/apivideo/api.video-typescript-private-video-session/issues"},"dist":{"shasum":"d7498005fcb53e041b38ec6f6b84ae06d4cf23e1","tarball":"https://registry.npmjs.org/@api.video/private-video-session/-/private-video-session-0.0.3.tgz","fileCount":9,"integrity":"sha512-w1OdsBRFGte0BbcaXtusRZbaI7SxX3A22iyq01WbXOEDfzuHQuecSUalWy/6XX5nzmRUP+RQ5P79gtqloDpXFw==","signatures":[{"sig":"MEUCIEpKCMFTXwAaSh6AyIUkdIwdEDdR/6CD9hTTcjpgrSOaAiEA1LKd38jU7VKfOTSNz399YrvG9JTnh5dsV3xjtTie8IU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":77618},"main":"dist/index.js","module":"dist/index.js","gitHead":"54e892003b5fad6038150340643e3e2664883778","scripts":{"test":"npm run tslint && jest","build":"npm run tslint && webpack --mode production","watch":"webpack --mode development --watch","tslint":"tslint --project .","prepublishOnly":"npm run build"},"typings":"./dist/index.d.ts","_npmUser":{"name":"apivideo-ecosystem","email":"ecosystem@api.video"},"repository":{"url":"git+ssh://git@github.com/apivideo/api.video-typescript-private-video-session.git","type":"git"},"_npmVersion":"9.8.1","description":"api.video private video session","directories":{},"_nodeVersion":"18.18.2","dependencies":{"md5":"^2.3.0","core-js":"^3.8.3","url-polyfill":"^1.1.12","whatwg-fetch":"^3.6.2"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","jsdom":"^16.5.1","tslint":"^6.1.3","ts-jest":"^26.5.4","ts-node":"^9.1.1","webpack":"^5.68.0","ts-loader":"^8.0.18","@types/md5":"^2.3.0","typescript":"^4.2.3","@types/jest":"^26.0.21","webpack-cli":"^4.9.2","@types/jsdom":"^16.2.7","jsdom-global":"^3.0.2","jest-fetch-mock":"^3.0.3","@types/whatwg-fetch":"0.0.33"},"_npmOperationalInternal":{"tmp":"tmp/private-video-session_0.0.3_1701250970821_0.7976320700060895","host":"s3://npm-registry-packages"}},"0.1.0":{"name":"@api.video/private-video-session","version":"0.1.0","keywords":["video","private","apivideo"],"author":{"url":"https://api.video/","name":"api.video","email":"ecosystem-team@api.video"},"license":"MIT","_id":"@api.video/private-video-session@0.1.0","homepage":"https://github.com/apivideo/api.video-typescript-private-video-session#readme","bugs":{"url":"https://github.com/apivideo/api.video-typescript-private-video-session/issues"},"dist":{"shasum":"1f94222c506beed2c6014c4f8caa40842dd915c4","tarball":"https://registry.npmjs.org/@api.video/private-video-session/-/private-video-session-0.1.0.tgz","fileCount":13,"integrity":"sha512-W+tyVsK6ONHBr5C1STrwGrzJHAuCc97wyAczC8ZuiWLXkAsGJyW7KY3DvcJSpp96fYi+9g62OeZfGCOyIuCrcg==","signatures":[{"sig":"MEQCIHyDROoHqii2STpdbNGfa+KMkus5noSEBDF3SgX3VOldAiA48yLMnobobNvr5DzSIp1BFjygeOtt2yQwv1P61OIdnA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":99270},"main":"dist/index.js","module":"dist/index.es.js","gitHead":"fd77eb667d91eb7ab09e22e60583263139f405d3","scripts":{"test":"jest","build":"webpack --mode production && rollup -c","watch":"webpack --mode development --watch","prepublishOnly":"npm run build"},"typings":"./dist/index.d.ts","_npmUser":{"name":"apivideo-ecosystem","email":"ecosystem@api.video"},"repository":{"url":"git+ssh://git@github.com/apivideo/api.video-typescript-private-video-session.git","type":"git"},"_npmVersion":"10.7.0","description":"api.video private video session","directories":{},"_nodeVersion":"18.20.3","dependencies":{"md5":"^2.3.0","core-js":"^3.37.1","url-polyfill":"^1.1.12","whatwg-fetch":"^3.6.20"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","jsdom":"^24.1.0","rollup":"^4.18.0","ts-jest":"^29.1.5","ts-node":"^10.9.2","webpack":"^5.92.1","ts-loader":"^9.5.1","@types/md5":"^2.3.5","typescript":"^5.4.5","@types/jest":"^29.5.12","webpack-cli":"^5.1.4","@types/jsdom":"^21.1.7","jsdom-global":"^3.0.2","jest-fetch-mock":"^3.0.3","mock-local-storage":"^1.1.24","@types/whatwg-fetch":"0.0.33","jest-environment-jsdom":"^29.7.0","@rollup/plugin-commonjs":"^26.0.1","rollup-plugin-typescript2":"^0.36.0","@rollup/plugin-node-resolve":"^15.2.3"},"_npmOperationalInternal":{"tmp":"tmp/private-video-session_0.1.0_1718952084194_0.22874118843341096","host":"s3://npm-registry-packages"}}},"time":{"created":"2023-01-30T16:56:13.276Z","modified":"2025-05-22T12:50:38.342Z","0.0.1":"2023-01-30T16:56:13.522Z","0.0.2":"2023-11-29T08:45:19.817Z","0.0.3":"2023-11-29T09:42:50.981Z","0.1.0":"2024-06-21T06:41:24.349Z"},"bugs":{"url":"https://github.com/apivideo/api.video-typescript-private-video-session/issues"},"author":{"url":"https://api.video/","name":"api.video","email":"ecosystem-team@api.video"},"license":"MIT","homepage":"https://github.com/apivideo/api.video-typescript-private-video-session#readme","keywords":["video","private","apivideo"],"repository":{"url":"git+ssh://git@github.com/apivideo/api.video-typescript-private-video-session.git","type":"git"},"description":"api.video private video session","maintainers":[{"email":"ecosystem@api.video","name":"apivideo-ecosystem"}],"readme":"[![badge](https://img.shields.io/twitter/follow/api_video?style=social)](https://twitter.com/intent/follow?screen_name=api_video)\n&nbsp; [![badge](https://img.shields.io/github/stars/apivideo/api.video-typescript-private-video-session?style=social)](https://github.com/apivideo/api.video-typescript-private-video-session)\n&nbsp; [![badge](https://img.shields.io/discourse/topics?server=https%3A%2F%2Fcommunity.api.video)](https://community.api.video)\n![](https://github.com/apivideo/.github/blob/main/assets/apivideo_banner.png)\n\n<h1 align=\"center\">Private video session</h1>\n\n[api.video](https://api.video) is the video infrastructure for product builders. Lightning fast\nvideo APIs for integrating, scaling, and managing on-demand & low latency live streaming features in\nyour app.\n\n# Table of contents\n\n- [Table of contents](#table-of-contents)\n- [Project description](#project-description)\n- [Getting started](#getting-started)\n  - [Installation](#installation)\n    - [Method #1: requirejs](#method-1-requirejs)\n    - [Method #2: typescript](#method-2-typescript)\n    - [Method #3: imple include in a javascript project](#method-3-imple-include-in-a-javascript-project)\n  - [Code sample](#code-sample)\n- [Documentation](#documentation)\n  - [Instanciation options](#instanciation-options)\n    - [Instanciation with videoId \\& token](#instanciation-with-videoid--token)\n    - [Instanciation with private asset url](#instanciation-with-private-asset-url)\n    - [Custom domains](#custom-domains)\n  - [Methods](#methods)\n    - [`getSession(): Promise<string>`](#getsession-promisestring)\n    - [`getThumbnailUrl(): Promise<string>`](#getthumbnailurl-promisestring)\n    - [`getPlayerUrl(): Promise<string>`](#getplayerurl-promisestring)\n    - [`getMp4Url(): Promise<string>`](#getmp4url-promisestring)\n    - [`getHlsUrl(): Promise<string>`](#gethlsurl-promisestring)\n- [Sample application](#sample-application)\n- [FAQ](#faq)\n\n# Project description\n\nThis library aims to simplify the assets links retrieval of api.video private videos.\n\n# Getting started\n\n## Installation\n\n### Method #1: requirejs\n\nIf you use requirejs you can add the module as a dependency to your project with\n\n```sh\n$ npm install --save @api.video/private-video-session\n```\n\nYou can then use the module in your script:\n\n```javascript\nvar { PrivateVideoSession } = require(\"@api.video/private-video-session\");\n\nvar privateSession = new PrivateVideoSession({\n  ...options, // see below for available options\n});\n```\n\n### Method #2: typescript\n\nIf you use Typescript you can add the SDK as a dependency to your project with\n\n```sh\n$ npm install --save @api.video/private-video-session\n```\n\nYou can then use the SDK in your script:\n\n```typescript\nimport { PrivateVideoSession } from \"@api.video/private-video-session\";\n\nconst privateSession = new PrivateVideoSession({\n  ...options, // see below for available options\n});\n```\n\n### Method #3: imple include in a javascript project\n\nInclude the SDK in your HTML file like so:\n\n```html\n<head>\n  ...\n  <script\n    src=\"https://unpkg.com/@api.video/private-video-session\"\n    defer\n  ></script>\n</head>\n\n<script type=\"text/javascript\">\n  var privateSession = new PrivateVideoSession(\n      ...options // see below for available options\n  });\n</script>\n```\n\n## Code sample\n\n```javascript\n(async () => {\n    const privateSession = new PrivateVideoSession({\n        videoId: 'viMgTc1KULkXrjFfDCTBtLs',\n        token: 'aafe99ed-3d96-44a4-beac-eca06439467c'\n    });\n\n    const thumbnailUrl = await privateSession.getThumbnailUrl();\n    console.log(thumbnailUrl);\n\n    const playerUrl = await privateSession.getPlayerUrl();\n    console.log(playerUrl);\n)();\n```\n\n# Documentation\n\n## Instanciation options\n\nThe private video session can be instanciated with either a videoId & a private token, or directly with a private asset url:\n\n### Instanciation with videoId & token\n\n```javascript\nconst privateSession = new PrivateVideoSession({\n  videoId: \"viMgTc1KULkXrjFfDCTBtLs\",\n  token: \"aafe99ed-3d96-44a4-beac-eca06439467c\",\n});\n```\n\n### Instanciation with private asset url\n\n```javascript\nconst privateSession = new PrivateVideoSession({\n  assetUrl:\n    \"https://embed.api.video/vod/viMgTc1KULkXrjFfDCTBtLs?token=aafe99ed-3d96-44a4-beac-eca06439467c\",\n});\n```\n\n### Custom domains\n\nIf you've configured [custom domains](https://docs.api.video/delivery-analytics/using-custom-domains) for your account, it's necessary to use the `domains` parameter when instantiating.\n\nHere's a quick example on how to do it:\n\n```javascript\nconst privateSession = new PrivateVideoSession({\n  assetUrl:\n    \"https://embed.mydomain.com/vod/viMgTc1KULkXrjFfDCTBtLs?token=aafe99ed-3d96-44a4-beac-eca06439467c\",\n  domains: {\n    embed: \"embed.mydomain.com\",\n    vod: \"vod.mydomain.com\",\n    live: \"live.mydomain.com\",\n  },\n});\n```\n\n## Methods\n\n### `getSession(): Promise<string>`\n\n> Get the private video session token\n\n### `getThumbnailUrl(): Promise<string>`\n\n> Get the thumbnail url of the private video\n\n### `getPlayerUrl(): Promise<string>`\n\n> Get the player url of the private video\n\n### `getMp4Url(): Promise<string>`\n\n> Get the mp4 url of the private video\n\n### `getHlsUrl(): Promise<string>`\n\n> Get the hls url of the private video\n\n# Sample application\n\nSee the [sample page](./tree/main/sample/) for a working example.\n\n# FAQ\n\nIf you have any questions, ask us in the [community](https://community.api.video). Or\nuse [issues](https://github.com/apivideo/api.video-typescript-private-video-session/issues)..\n","readmeFilename":"README.md"}