{"_id":"552917a3a15e530d00af3cac","project":"5435693035740020002a1c1c","category":{"_id":"5435693035740020002a1c20","__v":5,"pages":["5435693035740020002a1c22","552917a3a15e530d00af3cac","55297cdfa15e530d00af3d51","558d812ebeb7c719007f62b0","568160e14047cf0d004121ba"],"project":"5435693035740020002a1c1c","version":"5435693035740020002a1c1f","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2014-10-08T16:41:20.738Z","from_sync":false,"order":0,"slug":"overview","title":"Overview"},"version":{"_id":"5435693035740020002a1c1f","__v":15,"project":"5435693035740020002a1c1c","createdAt":"2014-10-08T16:41:20.702Z","releaseDate":"2014-10-08T16:41:20.702Z","categories":["5435693035740020002a1c20","551c03c1ff892b3700d1c57a","551ca3927405910d00900a59","551cac6448564a2f0024d89e","551cb4d848564a2f0024d8a3","551cb52db7a32b3b00d1ef78","5526e2064a7ac121004c6073","5526e5147d4a4417009516b3","5526e9877d4a4417009516bb","5528362cd9e1db2d00cd924d","5580240ebe698419008f2ba2","5580a7dabe698419008f2db6","568161799de23c0d00c54750","5866c905a2cbb31900f6f1aa","5bfc066d8342500013783e0c"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"githubsync":"","parentDoc":null,"__v":26,"user":"5526f1ef975eef3700ca802c","updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-04-11T12:46:27.637Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":1,"body":"## NPM\nMaking a node app? Download the latest package:\n\n```\nnpm install robin-js-sdk\n```\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"npm install robin-js-sdk\",\n      \"language\": \"shell\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n## Download for the browser\nYou can download (or load) the Javascript browser SDK from our CDN: \n[https://static.robinpowered.com/js/sdk/releases/0.7.0/robin.browser.min.js](https://static.robinpowered.com/js/sdk/releases/0.7.0/robin.browser.min.js)\n\nYou can also find the source on [GitHub](https://github.com/robinpowered/robin-js-sdk-public) directly.\n\n## Getting set up\nOnce you have the SDK loaded, instantiate an instance with your access token and start making requests. Robin's Javascript SDK is a [promise-based](http://www.html5rocks.com/en/tutorials/es6/promises/) library, so you can expect all the [standard promise endpoints](https://github.com/petkaantonov/bluebird/blob/master/API.md).\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Example\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"// Instantiate a new SDK object with your token\\nvar robin = new Robin('[[app:Token]]');\\n\\n// Get a space's current presence\\nrobin.api.spaces.presence.get(spaceId).then(function (response) {\\n  var peoplePresent = response.getData();\\n});\",\n      \"language\": \"javascript\",\n      \"name\": \"JavaScript SDK\"\n    }\n  ]\n}\n[/block]","excerpt":"The easiest way to get started with Robin's API","slug":"javascript-sdk","type":"basic","title":"Javascript SDK"}

Javascript SDK

The easiest way to get started with Robin's API

## NPM Making a node app? Download the latest package: ``` npm install robin-js-sdk ``` [block:code] { "codes": [ { "code": "npm install robin-js-sdk", "language": "shell" } ], "sidebar": true } [/block] ## Download for the browser You can download (or load) the Javascript browser SDK from our CDN: [https://static.robinpowered.com/js/sdk/releases/0.7.0/robin.browser.min.js](https://static.robinpowered.com/js/sdk/releases/0.7.0/robin.browser.min.js) You can also find the source on [GitHub](https://github.com/robinpowered/robin-js-sdk-public) directly. ## Getting set up Once you have the SDK loaded, instantiate an instance with your access token and start making requests. Robin's Javascript SDK is a [promise-based](http://www.html5rocks.com/en/tutorials/es6/promises/) library, so you can expect all the [standard promise endpoints](https://github.com/petkaantonov/bluebird/blob/master/API.md). [block:api-header] { "type": "basic", "title": "Example" } [/block] [block:code] { "codes": [ { "code": "// Instantiate a new SDK object with your token\nvar robin = new Robin('[[app:Token]]');\n\n// Get a space's current presence\nrobin.api.spaces.presence.get(spaceId).then(function (response) {\n var peoplePresent = response.getData();\n});", "language": "javascript", "name": "JavaScript SDK" } ] } [/block]