{"_id":"opentok-token","_rev":"11-6a3450e77e53c71ebed474bd2633c8b1","name":"opentok-token","description":"Generates tokens for `X-TB-TOKEN-AUTH` header when using OpenTok REST API.","dist-tags":{"latest":"1.1.1"},"versions":{"1.0.0":{"name":"opentok-token","version":"1.0.0","description":"Generates tokens for `X-TB-TOKEN-AUTH` header when using OpenTok REST API.","repository":{"type":"git","url":"https://github.com/opentok/token-encoder.git"},"bugs":{"url":"https://github.com/opentok/token-encoder/issues","email":"support@tokbox.com"},"main":"index.js","scripts":{"test":"tap ./test"},"keywords":["opentok","testing","tools","sign","hmac"],"author":{"name":"Ankur Oberoi","email":"aoberoi@gmail.com"},"license":"MIT","devDependencies":{"tap":"^0.6.0"},"gitHead":"249e276ede282cbd5fa075394c95b5a385316bb7","homepage":"https://github.com/opentok/token-encoder","_id":"opentok-token@1.0.0","_shasum":"ed11d675ad470100a1c0a3ccd236e5b52f653b71","_from":".","_npmVersion":"2.1.8","_nodeVersion":"0.10.33","_npmUser":{"name":"aoberoi","email":"aoberoi@gmail.com"},"maintainers":[{"name":"aoberoi","email":"aoberoi@gmail.com"}],"dist":{"shasum":"ed11d675ad470100a1c0a3ccd236e5b52f653b71","tarball":"https://registry.npmjs.org/opentok-token/-/opentok-token-1.0.0.tgz","integrity":"sha512-PolMRsxkD2uSOWbnl/fcmUxLcyqVwLbOc6VAY+ywIpIwHv50sLE8HxX6S8Rr6TzA8Dk6HKrDRiWuQ1uAI+6lkw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDomyktTdUsY7Ma4D2dFkXzmInYMnTbxfaD6P4+jLBVagIhAKfEhg0k8yTXemyr2bZD0mja8ohGrc1RDwBwcLPOi/5A"}]},"directories":{}},"1.1.0":{"name":"opentok-token","version":"1.1.0","description":"Generates tokens for `X-TB-TOKEN-AUTH` header when using OpenTok REST API.","repository":{"type":"git","url":"https://github.com/opentok/token-encoder.git"},"bugs":{"url":"https://github.com/opentok/token-encoder/issues","email":"support@tokbox.com"},"main":"index.js","scripts":{"test":"tap ./test","docs":"rm -rf docs/; doxx --source . --ignore node_modules,helpers.js,test --title \"OpenTok Token Encoder\""},"keywords":["opentok","testing","tools","sign","hmac"],"author":{"name":"Ankur Oberoi","email":"aoberoi@gmail.com"},"license":"MIT","devDependencies":{"doxx":"^1.2.5","tap":"^0.6.0"},"dependencies":{"lodash":"^3.2.0","nonce":"^1.0.3","unix-timestamp":"^0.1.2"},"gitHead":"3962396baa2622a8a68b20727d04a7b76547ef70","homepage":"https://github.com/opentok/token-encoder","_id":"opentok-token@1.1.0","_shasum":"f0174e495e6af4b255a2cffe9c34d48023e892af","_from":".","_npmVersion":"2.1.8","_nodeVersion":"0.10.33","_npmUser":{"name":"aoberoi","email":"aoberoi@gmail.com"},"maintainers":[{"name":"aoberoi","email":"aoberoi@gmail.com"}],"dist":{"shasum":"f0174e495e6af4b255a2cffe9c34d48023e892af","tarball":"https://registry.npmjs.org/opentok-token/-/opentok-token-1.1.0.tgz","integrity":"sha512-xJwi/8IQEc0Fcbh7ps5Yxbho4P7HF3wdb9ZkP8cEtfegE5yWMsWfEJgKpi/uvCPhw3Ek4NTCbpIY730vBGsLTA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDEFJV53NubHUhf0y52395CTljRkbQBLijDuPLIE+FlPwIgAxlIMW0h1npkeMe6hqUBWnjiyzKWAdJb3HUS9NDcde8="}]},"directories":{}},"1.1.1":{"name":"opentok-token","version":"1.1.1","description":"Generates tokens for `X-TB-TOKEN-AUTH` header when using OpenTok REST API.","repository":{"type":"git","url":"git+https://github.com/opentok/token-encoder.git"},"bugs":{"url":"https://github.com/opentok/token-encoder/issues","email":"support@tokbox.com"},"main":"index.js","scripts":{"test":"tap ./test"},"keywords":["opentok","testing","tools","sign","hmac"],"author":{"name":"Ankur Oberoi","email":"aoberoi@gmail.com"},"license":"MIT","devDependencies":{"tap":"^0.6.0"},"dependencies":{"lodash":"^4.17.11","nonce":"^1.0.3","unix-timestamp":"^0.1.2"},"gitHead":"79125673b8bb425ded8c9e0f072c901e83d813b3","homepage":"https://github.com/opentok/token-encoder#readme","_id":"opentok-token@1.1.1","_npmVersion":"6.4.1","_nodeVersion":"8.15.0","_npmUser":{"name":"opentok-owner","email":"adam@tokbox.com"},"dist":{"integrity":"sha512-/uMsmUMiGWT95zemuE9H3OWSb+1NcDmZSDzjum1oKk2KLLGkjqlPsEo8NWarH2q1rfd+cBWP8Pu+dwJS0uNHcg==","shasum":"1ec2b0f29d84477060934c43a2ce4b08f7e8fcc2","tarball":"https://registry.npmjs.org/opentok-token/-/opentok-token-1.1.1.tgz","fileCount":7,"unpackedSize":9895,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc/pkPCRA9TVsSAnZWagAAfd4P/iJdJvQkGKNx5suHfYgS\ntJUDdl3GcIhOlD3UJSWilwKrWvagKgox4w5Xxud5bNU+ThXSm42dvT/E0XaA\nWTMHFtfo5Wg+pbGO3Ky9e1lnADZEJQEschthvx/8F3utI0v2oUjD1HTgM0g4\nIRw0fSauEjfr+zjxeoCPJwL0g7a/jUa6XyStcKgibzPq/uB24m52DS+VRfTh\nXGuCBcTTGagqL2qo9aMe8vUWZ7WZ3uISrC64JTallzDINv1khsPNHDREuOQS\n/67GkkM/lGWONlWdPsNIW2YOLI7e3WsK7ILtb0QrXvhS6aa9UE+gEfEcqYDl\n90cIZKK9PYD8tzN/OmsbB6cFvcm3jML9T7W/nM0rlx9hygpMKlDvFoUUwNH6\n6oNW7ws4FSnf/hW6J3QDiXUqwr4U+8PyBZKzS7XlxzOFC+iy3HHKb6sNyn2l\nYOF7XbanSCDpgxtcj8zPzwxNLthIMfET8DI4N+EaXc9N0q9UjpX8uRZqoZPX\n87wTBB8OGpRc2Sr7G7FPG/GfuNhyQc9ltf9h2E9ul2xfOiTpKEzUh41Nx8rp\nQTZEr2WXkIQCmXpjfX3iPujMs7YXaX+1WY4sHvrzq0HildtniTNgGjbP7Muf\nMTewfl2cEFWQ8OECnOxS3Af3IZbyXx6tdOrRbbD8WzEuCmj4qflGggkJagVr\nJUoU\r\n=NvVQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDRxt1Eqsl5aXHMS+pA5TNMNpg7+tOAQjWZQn5ivTXQOgIhAKd0GngCZrDY0dDY0OGmgI2nYdc53+bzjRZFCiZfkYzY"}]},"maintainers":[{"name":"opentok-owner","email":"adam@tokbox.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/opentok-token_1.1.1_1560189198647_0.7454386896527607"},"_hasShrinkwrap":false}},"readme":"# OpenTok Token Encoder\n\n[![Build Status](https://travis-ci.org/opentok/token-encoder.png)](https://travis-ci.org/opentok/token-encoder)\n\nGenerates tokens for `X-TB-TOKEN-AUTH` header when using [OpenTok REST API](https://tokbox.com/opentok/api/).\n\n## Installation\n\n```\nnpm install --save opentok-token\n```\n\n## Usage\n\n**WARNING:** This module does not check for the validity of the data being encoded into the token.\nIt doesn't know about the OpenTok REST API semantics, and you can encode data that doesn't result in\na valid token. Its merely a utility. Use the [OpenTok Node Server\nSDK](https://github.com/opentok/opentok-node) for a more complete module.\n\n### Generating a token\n\n```javascript\nvar encodeToken = require('opentok-token');\n\nvar tokenData = {\n  session_id: 'SESSIONID',\n  create_time: 1424221013,\n  nonce: 50885,\n  role: 'moderator',\n  expire_time: 1424307413,\n  connection_data: '{\"name\":\"value\"}'\n};\nvar apiKey = 'APIKEY';\nvar apiSecret = 'APISECRET'\n\nvar token = encodeToken(tokenData, apiKey, apiSecret);\n```\n**NOTE:** The API key, secret, and session ID above are not real.\n\n\n### Default values\n\nIf you do not specify certain properties of the `tokenData` parameter, defaults will be applied for\nyou.\n\n| Property      | Type                                | Default                     |\n|---------------|-------------------------------------|-----------------------------|\n| `create_time` | unix timestamp in seconds (integer) | now                         |\n| `expire_time` | unix timestamp in seconds (integer) | now + 1 day                 |\n| `role`        | string                              | 'publisher'                 |\n| `nonce`       | number                              | unique random number        |\n\n","maintainers":[{"name":"opentok-owner","email":"adam@tokbox.com"}],"time":{"modified":"2022-06-23T00:29:50.505Z","created":"2015-02-18T01:33:04.514Z","1.0.0":"2015-02-18T01:33:04.514Z","1.1.0":"2015-02-18T23:56:47.865Z","1.1.1":"2019-06-10T17:53:18.825Z"},"homepage":"https://github.com/opentok/token-encoder#readme","keywords":["opentok","testing","tools","sign","hmac"],"repository":{"type":"git","url":"git+https://github.com/opentok/token-encoder.git"},"author":{"name":"Ankur Oberoi","email":"aoberoi@gmail.com"},"bugs":{"url":"https://github.com/opentok/token-encoder/issues","email":"support@tokbox.com"},"license":"MIT","readmeFilename":"README.md"}