{"_id":"2klic-sdk","_rev":"6-816b024d42bae278e2596dbf342e9785","name":"2klic-sdk","description":"Javascript SDK for 2klic API","dist-tags":{"latest":"2.16.8"},"versions":{"2.16.8":{"name":"2klic-sdk","version":"2.16.8","private":false,"description":"Javascript SDK for 2klic API","main":"src/index.js","scripts":{"test":"gulp test"},"repository":{"type":"git","url":"git+https://bitbucket.org/2klicdev/2klic-sdk.git"},"keywords":["2klic","api"],"author":{"name":"Joel Lavoie","email":"joel.lavoie.ing@gmail.com"},"license":"MIT","devDependencies":{"brfs":"^1.4.0","browserify":"^11.0.1","chai":"^3.2.0","gulp":"^3.9.0","gulp-jsdoc":"^0.1.5","gulp-mocha":"^2.1.3","gulp-sourcemaps":"^1.5.2","gulp-testem":"0.0.1","gulp-uglify":"^1.2.0","gulp-util":"^3.0.6","nock":"^2.10.0","sinon":"^1.15.4","vinyl-buffer":"^1.0.0","vinyl-source-stream":"^1.1.0","watchify":"^3.3.1"},"dependencies":{"bluebird":"^3.0.5","browser-request":"^0.3.3","inherits":"^2.0.1","joi":"^7.0.0","lodash":"^3.10.1","request":"^2.67.0","socket.io-client":"^1.3.7"},"browser":{"request":"browser-request"},"homepage":"https://bitbucket.org/2klicdev/2klic-sdk#readme","directories":{"test":"test"},"_id":"2klic-sdk@2.16.8","_shasum":"3ba1121eb11d257f0fafd16995acf41f0a41bac5","_from":".","_npmVersion":"2.15.8","_nodeVersion":"4.4.7","_npmUser":{"name":"korey_conway","email":"koc@2klic.com"},"dist":{"shasum":"3ba1121eb11d257f0fafd16995acf41f0a41bac5","tarball":"https://registry.npmjs.org/2klic-sdk/-/2klic-sdk-2.16.8.tgz","integrity":"sha512-Z83lVxqpWS+th6Hk5/1KcpdZrcoLgXFGeYy9gJJJglB4tdL0rRSPz3IWN1lNhPSjVmSQ0DrxNuqP8R0YoboqsQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHpf5dEkcg2a7IrXZ3lU7bpe+rPJvJ43nl0f3Bh+4KVsAiBhkmADwsn1MrjQ81NrESr/Sb39ME4aIgCm/xIRzNUtbw=="}]},"maintainers":[{"name":"korey_conway","email":"koc@2klic.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/2klic-sdk-2.16.8.tgz_1477341555719_0.8523025966715068"}}},"readme":"# 2Klic.io SDK\n\n## Installing the library from the private repository\n\nbower install 2klic-sdk --save\n\n## Getting Started\n\nInclude the library in your index.html\n\n    <script src=\"bower_components/dist/sdk.js\"></script>\n\n\nInstantiate a new engine: \n\n    var platform = new Klic();\n    \nBy default, the engine will point to https://api.2klic.io. If you want to work with a local development engine, just use the url option:\n\n    var platform = new Klic({url: 'http://localhost:5000'});\n    \n2Klic.io is using JWT tokens for authentication. In order to use most of the available methods and helpers, you need to retrieve a valid token.\n\n### How to instantiate in Node:\n\n    var Klic = require('@2klic/2klic-sdk');\n    var KlicSDK = new Klic();\n    KlicSDK.devices.list().then(function(devices){\n        console.log(devices);\n        return devices\n    });\n\n### Configuring our SDK to retrieve a token\n\nYou need to set the following options in order to retrieve a valid token:\n\n    url: Url of the 2klic.io instance you want to use. default to https://api.2klic.io\n    auth: {\n        token: An existing token (previously retrieved) or nothing\n    },\n    unsafe: true indicates that we're in an unsafe environment (client app, browser, etc)\n    app_key : The key of the app as provided by 2klic.io\n    app_secret: Optional. The secret if you are in a safe environment (do not use for client or browser app)\n\nWith these options you can instantiate the Klic instance:\n\n    var platform = new Klic({\n        unsafe: isClient,\n        app_key: \"b2423a98430c03213d7ad86033622f5066a44b69\"\n    });\n\nNote that we haven't provided any token as we don't have one yet.\n\n### Retrieving a valid token\n\nYou execute the authenticate method to retrieve your token :\n\n    platform.authenticate({username:username, password:password}).then(function(result) {\n\n        // Save the token for subsequent calls\n        platform.auth = {\n            token: result.token\n        };\n\n    });\n","maintainers":[{"email":"joel.lavoie.ing@gmail.com","name":"joellavoie"},{"email":"korey.conway@gmail.com","name":"koreyconway"},{"email":"koc@2klic.com","name":"korey_conway"}],"time":{"modified":"2022-06-12T14:06:59.378Z","created":"2016-10-24T20:39:18.000Z","2.16.8":"2016-10-24T20:39:18.000Z"},"homepage":"https://bitbucket.org/2klicdev/2klic-sdk#readme","keywords":["2klic","api"],"repository":{"type":"git","url":"git+https://bitbucket.org/2klicdev/2klic-sdk.git"},"author":{"name":"Joel Lavoie","email":"joel.lavoie.ing@gmail.com"},"license":"MIT","readmeFilename":"README.md"}