Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including cocoon-cloud-sdk with all npm packages installed. Try it out:

const cocoonSDK = require("cocoon-cloud-sdk"); const CLIENT_ID = ""; const CLIENT_SECRET = ""; const USERNAME = ""; const PASSWORD = ""; const oAuth = new cocoonSDK.OAuth("password", CLIENT_ID, CLIENT_SECRET); oAuth.tokenExchangePassword(USERNAME, PASSWORD) .then((response) => { cocoonSDK.CocoonAPI.setupAPIAccess(response.access_token, response.refresh_token, response.expires_in); return undefined; }) .then(cocoonSDK.UserAPI.get) .then((me) => { console.log(me); return undefined; }) .catch(console.error);

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

cocoon-cloud-sdk v3.0.0

Cocoon.io is a cloud service that allows any web developer to build performant mobile native apps/games based on their HTML5 content.

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free