{"_id":"@accedo/accedo-one","_rev":"7-bd0ef28ea9201d996c396227f1724760","name":"@accedo/accedo-one","description":"The official Accedo One SDK for Node.js and browsers (previously known as AppGrid)","dist-tags":{"latest":"4.0.2"},"versions":{"4.0.0":{"name":"@accedo/accedo-one","version":"4.0.0","description":"The official Accedo One SDK for Node.js and browsers (previously known as AppGrid)","main":"src/node/index.js","browser":"dist/accedo-one.umd.min.js","scripts":{"clean":"rimraf dist/*","prebuild":"npm run clean && npm run lint","build":"rollup -c rollup.config.browser.js","lint":"eslint {src/,test/} --ext .js","lint:check":"eslint --print-config .eslintrc.json | eslint-config-prettier-check","prettier":"prettier --write \"{src,test}/**/*.js\"","test":"jest","doc":"documentation build src/**/index.js -c doc_config.yml --format html -o docs","docmd":"documentation build src/**/index.js -c doc_config.yml --format md > API.md","prepublishOnly":"npm test && npm run doc && npm run build"},"repository":{"type":"git","url":"git+ssh://git@github.com/Accedo-Products/accedo-one-sdk-js.git"},"keywords":["AppGrid","Accedo","Accedo One","SDK","ES6","Javascript"],"author":{"name":"Accedo, AB"},"contributors":[{"name":"Jason Dujardin-Terry"},{"name":"Gregory Desfour"},{"name":"Nicolas Nannoni"},{"name":"Oskar Nordgren"}],"license":"Apache-2.0","engines":{"node":">= 4"},"homepage":"https://www.accedo.tv/one","files":["dist/","src/"],"devDependencies":{"chalk":"^1.1.3","documentation":"^4.0.0-rc.1","eslint":"^3.19.0","eslint-config-airbnb-base":"^11.1.3","eslint-config-prettier":"^2.6.0","eslint-import-resolver-node":"^0.3.1","eslint-plugin-import":"^2.7.0","eslint-plugin-prettier":"^2.3.1","jest":"^21.2.1","prettier":"^1.7.4","rimraf":"^2.6.2","rollup":"^0.47.6","rollup-plugin-buble":"^0.16.0","rollup-plugin-commonjs":"^8.2.1","rollup-plugin-multi-entry":"^2.0.1","rollup-plugin-node-resolve":"^3.0.0","rollup-plugin-uglify":"^1.0.2","source-map-support":"^0.4.18"},"dependencies":{"isomorphic-unfetch":"^1.0.0","qs":"^6.5.1","stampit":"^2.1.2","uuid":"^3.1.0"},"bugs":{"url":"https://github.com/Accedo-Products/accedo-one-sdk-js/issues"},"directories":{"doc":"docs","test":"test"},"gitHead":"868dbbb65e2b63063fef090792f6d45897e78a2c","_id":"@accedo/accedo-one@4.0.0","_npmVersion":"5.4.2","_nodeVersion":"8.3.0","_npmUser":{"name":"gouegd","email":"npm@pow.red"},"dist":{"integrity":"sha512-aVba98EnmruPKptrUvyxkYc3Oi/6Or8NTH72ZvvdWfLIPO9N/GDkj0twMLTcns33aaQAMo70hktdzk/QKhEbHA==","shasum":"e078045ff861c6c02a1b3169793f4ff1f4e19917","tarball":"https://registry.npmjs.org/@accedo/accedo-one/-/accedo-one-4.0.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCzxOhi77UHmNn5+adRS5x8q4shVLxynxskA9Vb61i6/gIgbhdBEEtYzr5V6IcE3Og7WQIJBGRS6ceil2Kl2azajf4="}]},"maintainers":[{"name":"gouegd","email":"npm@pow.red"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/accedo-one-4.0.0.tgz_1508370631555_0.6937020861078054"}},"4.0.1":{"name":"@accedo/accedo-one","version":"4.0.1","description":"The official Accedo One SDK for Node.js and browsers (previously known as AppGrid)","main":"src/node/index.js","browser":"dist/accedo-one.umd.min.js","scripts":{"clean":"rimraf dist/*","prebuild":"npm run clean && npm run lint","build":"rollup -c rollup.config.browser.js","lint":"eslint {src/,test/} --ext .js","lint:check":"eslint --print-config .eslintrc.json | eslint-config-prettier-check","prettier":"prettier --write \"{src,test}/**/*.js\"","test":"jest","doc":"documentation build src/**/index.js -c doc_config.yml --format html -o docs","docmd":"documentation build src/**/index.js -c doc_config.yml --format md > API.md","prepublishOnly":"npm test && npm run doc && npm run build"},"repository":{"type":"git","url":"git+ssh://git@github.com/Accedo-Products/accedo-one-sdk-js.git"},"keywords":["AppGrid","Accedo","Accedo One","SDK","ES6","Javascript"],"author":{"name":"Accedo, AB"},"contributors":[{"name":"Jason Dujardin-Terry"},{"name":"Gregory Desfour"},{"name":"Nicolas Nannoni"},{"name":"Oskar Nordgren"}],"license":"Apache-2.0","engines":{"node":">= 4"},"homepage":"https://www.accedo.tv/one","files":["dist/","src/"],"devDependencies":{"chalk":"^1.1.3","documentation":"^4.0.0-rc.1","eslint":"^3.19.0","eslint-config-airbnb-base":"^11.1.3","eslint-config-prettier":"^2.6.0","eslint-import-resolver-node":"^0.3.1","eslint-plugin-import":"^2.7.0","eslint-plugin-prettier":"^2.3.1","jest":"^21.2.1","prettier":"^1.7.4","rimraf":"^2.6.2","rollup":"^0.47.6","rollup-plugin-buble":"^0.16.0","rollup-plugin-commonjs":"^8.2.1","rollup-plugin-multi-entry":"^2.0.1","rollup-plugin-node-resolve":"^3.0.0","rollup-plugin-uglify":"^1.0.2","source-map-support":"^0.4.18"},"dependencies":{"isomorphic-unfetch":"^1.0.0","qs":"^6.5.1","stampit":"^2.1.2","uuid":"^3.1.0"},"bugs":{"url":"https://github.com/Accedo-Products/accedo-one-sdk-js/issues"},"directories":{"doc":"docs","test":"test"},"gitHead":"e06f689a1783847f21c6e1f79c191bb4a2a3c10d","_id":"@accedo/accedo-one@4.0.1","_npmVersion":"5.4.2","_nodeVersion":"8.3.0","_npmUser":{"name":"gouegd","email":"npm@pow.red"},"dist":{"integrity":"sha512-yLsTFgTq5E3QM1iWozOdGyF1wxxyMrJoVHklQi34C7UIR1ZQy/42kWKW4wS0jaRM5l4aiVDz+aUNZtscv57jRQ==","shasum":"81c8eb3ace9cf101ac26d29aa301c4cbf4f45812","tarball":"https://registry.npmjs.org/@accedo/accedo-one/-/accedo-one-4.0.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDWRBODHvnBQw3mo1yyKL+g0nB49v00hJk+LTX3RuYcoAiAKvmML1kenGnLHGfhxucGnqTT6tpKnKTwfsdBiMQwF7g=="}]},"maintainers":[{"email":"npm@pow.red","name":"gouegd"},{"email":"appgrid-support@accedo.tv","name":"accedo-products"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/accedo-one-4.0.1.tgz_1509507687063_0.8110044379718602"}},"4.0.2":{"name":"@accedo/accedo-one","version":"4.0.2","description":"The official Accedo One SDK for Node.js and browsers (previously known as AppGrid)","main":"src/node/index.js","browser":"dist/accedo-one.umd.min.js","scripts":{"clean":"rimraf dist/*","prebuild":"npm run clean && npm run lint","build":"rollup -c rollup.config.browser.js","lint":"eslint {src/,test/} --ext .js","lint:check":"eslint --print-config .eslintrc.json | eslint-config-prettier-check","prettier":"prettier --write \"{src,test}/**/*.js\"","test":"jest","doc":"documentation build src/**/index.js -c doc_config.yml --format html -o docs","docmd":"documentation build src/**/index.js -c doc_config.yml --format md > API.md","prepublishOnly":"npm test && npm run doc && npm run build"},"repository":{"type":"git","url":"git+ssh://git@github.com/Accedo-Products/accedo-one-sdk-js.git"},"keywords":["AppGrid","Accedo","Accedo One","SDK","ES6","Javascript"],"author":{"name":"Accedo, AB"},"contributors":[{"name":"Jason Dujardin-Terry"},{"name":"Gregory Desfour"},{"name":"Nicolas Nannoni"},{"name":"Oskar Nordgren"}],"license":"Apache-2.0","engines":{"node":">= 4"},"homepage":"https://www.accedo.tv/one","files":["dist/","src/"],"devDependencies":{"chalk":"^2.3.2","documentation":"^6.1.0","eslint":"^4.19.1","eslint-config-airbnb-base":"^12.1.0","eslint-config-prettier":"^2.9.0","eslint-import-resolver-node":"^0.3.2","eslint-plugin-import":"^2.9.0","eslint-plugin-prettier":"^2.6.0","jest":"^22.4.3","prettier":"^1.11.1","rimraf":"^2.6.2","rollup":"^0.57.1","rollup-plugin-buble":"^0.19.2","rollup-plugin-commonjs":"^9.1.0","rollup-plugin-multi-entry":"^2.0.2","rollup-plugin-node-resolve":"^3.3.0","rollup-plugin-uglify":"^3.0.0","source-map-support":"^0.5.4"},"dependencies":{"@stamp/compose":"^1.0.2","@stamp/it":"^1.0.3","isomorphic-unfetch":"^2.0.0","qs":"^6.5.1","uuid":"^3.2.1"},"bugs":{"url":"https://github.com/Accedo-Products/accedo-one-sdk-js/issues"},"directories":{"doc":"docs","test":"test"},"gitHead":"cd8fd694b4b634ef69e79e3610f7d75bfaaf3eb2","_id":"@accedo/accedo-one@4.0.2","_npmVersion":"5.4.2","_nodeVersion":"8.3.0","_npmUser":{"name":"gouegd","email":"npm@pow.red"},"dist":{"integrity":"sha512-R4jCkpnPdPzXYkHM3rva4tkSZSpDdLUlJrAji3/xKzPts5tOxXIvxR6LIwk8xLdd6rwtQe6ZiJcKqcVOHpDWEQ==","shasum":"13b3b9720ab9eedadd95554e1a69b27f75a02523","tarball":"https://registry.npmjs.org/@accedo/accedo-one/-/accedo-one-4.0.2.tgz","fileCount":25,"unpackedSize":84954,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCkDXwxmv6nzctKUbpSgnKiQUY6fKjx3g3f7b7evNiebQIgbvhB8aB8i6kLmFgEhG7Ei1il5PrwwfIndoevLgGD6ZU="}]},"maintainers":[{"email":"appgrid-support@accedo.tv","name":"accedo-products"},{"email":"npm@pow.red","name":"gouegd"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/accedo-one_4.0.2_1522111174039_0.20159780049628218"},"_hasShrinkwrap":false}},"readme":"# Accedo One SDK for Node.js and browsers [![npm](https://img.shields.io/npm/v/@accedo/accedo-one.svg?maxAge=3600)](https://www.npmjs.com/package/@accedo/accedo-one)\n\n```\n   _                    _           ___\n  /_\\   ___ ___ ___  __| | ___     /___\\_ __   ___\n //_\\\\ / __/ __/ _ \\/ _` |/ _ \\   //  // '_ \\ / _ \\\n/  _  \\ (_| (_|  __/ (_| | (_) | / \\_//| | | |  __/\n\\_/ \\_/\\___\\___\\___|\\__,_|\\___/  \\___/ |_| |_|\\___|\n\n```\n\n## Summary\n\nThis is the official [Accedo One](https://www.accedo.tv/one) SDK for Node.js and browsers, previously known as the AppGrid JS SDK.\nWhile Accedo One exposes a set of friendly REST APIs, this SDK is intended to provide a smoother experience when coding in JS.\nIt also encourages the use of best practices (for example: reusing the same sessionId for a client, but different clients for different devices).\n\nWe follow [semantic versioning](http://semver.org/).\nCheck the [change log](./CHANGELOG.md) for a listing of changes and new features per version.\n\n## Supported browsers\n\nThis project is written in ES2015 and the browsers build is transpiled to ES5.\nAll modern browsers are supported (Firefox, Chrome, Opera, Safari, Edge, their mobile versions and declinations).\n\n⚠️ If you need to support IE 11 (or other legacy browsers), make sure to load polyfills for the ES2015 features before loading this library. You can either use one such as what babel offers, or just the strict necessary: an ES6 Promise polyfill and another one for `Object.assign`.\nRefer to `example-browser.html` for an example on using such a polyfill.\n\nWe use CommonJS modules rather than ES6 modules, so no compilation step is needed on Node.\n\n## Supported Node.js versions\n\nThis should work from version 4, but we test on, and recommend to use the latest LTS version of Node (currently Node 6, soon Node 8).\n\n## Features\n\nThe default factory exposed by this SDK allows creating a client instance tied to a device id and an application key. It provides these features :\n - easy access to Accedo One APIs\n - automatic deviceId creation when none was provided\n - automatic session creation when none was provided (lazy - only when needed)\n - automatic session re-creation when the previous one has expired (lazy)\n - ensures only one session will be created at a time, even if concurrent Accedo One requests are made\n - specific to Detect:\n  - ensures concurrent calls to get the log level will result in one network call at most\n  - caches the log level for 3 minutes\n  - on browsers, individual logs are only sent when necessary (i.e. when the log's level is equal or higher than the current level set on the app), and automatically grouped then sent as a batch (see the `sendLog` doc)\n\n:information_source: _For Node, an [express-compatible middleware is also available as a separate package](https://github.com/Accedo-Products/accedo-one-sdk-express).\nYou should really consider using it if possible, as it makes things even easier and provides extra features._\n\n## Documentation\n\nRefer to the [API docs for this SDK](https://accedo-products.github.io/accedo-one-sdk-js/).\n\nYou may also want to refer to the [Accedo One Rest API documentation](https://developer.one.accedo.tv/) that this SDK uses behind the scenes. Accedo One-specific terminology is defined there.\n\n## Installation\n\n`npm install --save @accedo/accedo-one` (or, for yarn users: `yarn add @accedo/accedo-one`)\n\nThen you can use the default export to get a factory:\n```js\nconst accedoOne = require('@accedo/accedo-one')\n```\nOr, using the ES6 module syntax:\n```js\nimport accedoOne from '@accedo/accedo-one'\n```\n\n## Examples\nBelow are a few examples, refer to `example-node.js` for more of them that you can run yourself (clone this repo then execute `node example-node.js`).\n\n### Create an Accedo One client instance\n\n:point_right: _On Node, we recommend you use the [Express middleware](https://github.com/Accedo-Products/accedo-one-sdk-express) instead, as it makes it easier and enforces some more best practices._\n\nAn instance of an Accedo One client must be obtained. It's created with the factory exported as the default export in this library, with parameters for the specific client you need.\n\n```javascript\n// This is an Accedo One client factory - name it \"factory\", \"accedoOne\", or anything else.\n// If you use this library on a browser through a <script> tag, `accedoOne` is a global variable\n// so you do not need to import or require anything.\nimport accedoOne from '@accedo/accedo-one';\n\nconst client = accedoOne({\n  appKey: 'YOUR_ACCEDO_ONE_APPLICATION_KEY',\n  deviceId: 'A_DEVICE_ID',\n  // if there is already a session for this appKey/deviceId tuple, provide it\n  sessionKey: 'AN_EXISTING_SESSION_KEY',\n  // gid can be passed as well, it will be used for all API calls\n  gid: 'SOME_GROUP_ID',\n  // turn on the SDK debug logs by adding a log function such as this one\n  // log(...args) { console.log(...args); },\n});\n```\n\nYou should create a new client for every device that needs to access the Accedo One APIs.\n\n:warning: **DO NOT** reuse a single client, in your Node server, to relay requests from various consumers.\n\nIf you are triggering some Accedo One API calls in response to server requests, **you should create a new client every time**, by using the factory and reusing your application key and the consumer's deviceId (typically you would persist a consumer deviceId via the cookies, or as a request parameter in your server APIs - unless the device lets you use some unique ID like a MAC address).\n\n:bulb: Note again, the middleware (see above) does that work for you, so it's best to use it whenever possible.\n\n### Create a new Accedo One session\n\nThe `client.createSession` lets you manually create a new session, that will be stored for reuse onto this client instance.\nAs any API call that needs a session will trigger this method implicitly when needed, **you will normally not need to ever do this yourself**.\n\n### Get all Accedo One Metadata associated with your application key\n```javascript\nclient.getAllMetadata()\n  .then(metadata => {\n    console.log('Successfully requested all metadata from Accedo One', metadata);\n  })\n  .catch(error => {\n    // TODO handle error\n  });\n```\n\n## SDK development\n\n  * Clone/fork this repo\n  * Run `yarn` (you should have yarn installed globally)\n  * Code !\n  * Before pushing, remember to:\n    - update the UMD bundle (`yarn run build`)\n    - add tests and check they all pass (`yarn test`)\n    - add examples and check they all work (`node example-node.js`)\n    - document any public API with JSDoc comments and generate the new doc (`yarn run doc`)\n\n### Testing code in the browser\n\nIf necessary, update the UMD bundle as noted above, then open the `example-browser.html` file in your browser.\n\nOn an OSX shell, you can use `open example-browser.html`.\nTo serve it on a local web server, you can use `php -S localhost:9000` or `python -m SimpleHTTPServer 9000` if you have php or python binaries available on your path.\nOther options include Apache, Nginx, and Node-based servers such as [`http-server`](https://www.npmjs.com/package/http-server) or [`static-server`](https://www.npmjs.com/package/static-server).\n\nThe sample includes the polyfills necessary for older browsers like IE11 (those that do not support ES6).\n\n## More information & Links\n\n* [Accedo One homepage](https://www.accedo.tv/one)\n* [Accedo One help center](https://support.one.accedo.tv)\n* [Accedo One API documentation](https://developer.one.accedo.tv)\n* [The Express-compatible middleware](https://github.com/Accedo-Products/accedo-one-sdk-express) that relies on this library.\n\n## Unit Tests\n\nJest unit tests have been written to cover all of the exported APIs from this module. Tests will we called by running `npm test` or `yarn test`.\n\n## License\n\nSee the [LICENSE file](./LICENSE.md) for license rights and limitations (Apache 2.0)\n","maintainers":[{"email":"ignacio.lopez@accedo.tv","name":"ignaciolopezgomez"},{"email":"appgrid-support@accedo.tv","name":"accedo-products"}],"time":{"modified":"2022-04-04T11:06:30.949Z","created":"2017-10-18T23:50:32.382Z","4.0.0":"2017-10-18T23:50:32.382Z","4.0.1":"2017-11-01T03:41:27.178Z","4.0.2":"2018-03-27T00:39:34.156Z"},"homepage":"https://www.accedo.tv/one","keywords":["AppGrid","Accedo","Accedo One","SDK","ES6","Javascript"],"repository":{"type":"git","url":"git+ssh://git@github.com/Accedo-Products/accedo-one-sdk-js.git"},"contributors":[{"name":"Jason Dujardin-Terry"},{"name":"Gregory Desfour"},{"name":"Nicolas Nannoni"},{"name":"Oskar Nordgren"}],"author":{"name":"Accedo, AB"},"bugs":{"url":"https://github.com/Accedo-Products/accedo-one-sdk-js/issues"},"license":"Apache-2.0","readmeFilename":"README.md"}