{"_id":"59c502bd1d49570010cbb4f6","project":"54523fec04160008005b1cc8","version":{"_id":"57b557f0d3092517007cfac3","project":"54523fec04160008005b1cc8","__v":2,"createdAt":"2016-08-18T06:38:40.018Z","releaseDate":"2016-08-18T06:38:40.018Z","categories":["57b557f0d3092517007cfac4","57b557f0d3092517007cfac5","59c4d73c5237e3003c4532c3"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"2.0.0","version":"2.0"},"category":{"_id":"59c4d73c5237e3003c4532c3","project":"54523fec04160008005b1cc8","version":"57b557f0d3092517007cfac3","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2017-09-22T09:26:20.780Z","from_sync":false,"order":9999,"slug":"cloud-app-javascript-api","title":"Cloud App JavaScript API"},"user":"54523f0604160008005b1cc0","__v":0,"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-09-22T12:31:57.676Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"settings":"","results":{"codes":[]},"auth":"never","params":[],"url":""},"isReference":false,"order":1,"body":"Before you can use rollApp Cloud API you need to get your application published on rollApp Cloud Platform and get an API key. Once you get an API key, you can add rollApp Cloud API client to your page.\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Domain whitelisting\",\n  \"body\": \"The API key is tied to the domain, when you create an application. You can then use this key to access rollApp Cloud API **only** on that domain.\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"var key = \\\"SeCur3AP1K3y\\\";\\n\\nvar rollAppCloud = new RollAppCloud(key, function() {\\n  // oninitcomplete handler\\n});\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]\nDuring initialization rollApp Cloud API client makes requests to rollApp backend. Until these requests are processed you should not use *isBrowserSupported*. If you need to perform your own initialization based, e.g. activate application launch buttons, you should do that in `oninitcomplete` handler.","excerpt":"","slug":"cloudapp-js-constructor","type":"fn","title":"new RollAppCloud(key, oninintcomplete)"}

new RollAppCloud(key, oninintcomplete)


Before you can use rollApp Cloud API you need to get your application published on rollApp Cloud Platform and get an API key. Once you get an API key, you can add rollApp Cloud API client to your page. [block:callout] { "type": "warning", "title": "Domain whitelisting", "body": "The API key is tied to the domain, when you create an application. You can then use this key to access rollApp Cloud API **only** on that domain." } [/block] [block:code] { "codes": [ { "code": "var key = \"SeCur3AP1K3y\";\n\nvar rollAppCloud = new RollAppCloud(key, function() {\n // oninitcomplete handler\n});", "language": "javascript" } ] } [/block] During initialization rollApp Cloud API client makes requests to rollApp backend. Until these requests are processed you should not use *isBrowserSupported*. If you need to perform your own initialization based, e.g. activate application launch buttons, you should do that in `oninitcomplete` handler.