Skip to content

Instantly share code, notes, and snippets.

@MariuszWisniewski
Created March 3, 2016 00:59
Show Gist options
  • Save MariuszWisniewski/72cf492a000ccfef0dae to your computer and use it in GitHub Desktop.
Save MariuszWisniewski/72cf492a000ccfef0dae to your computer and use it in GitHub Desktop.
Create a channel in JS CodeBox
var Syncano = require('syncano'); //CommonJS
var account = new Syncano({accountKey: "ACCOUNT_KEY"});
var channel = {
"name":"realtime",
"type":"default",
"other_permissions": "subscribe",
"custom_publish": "false"
};
account.instance(META['instance']).channel().add(channel)
.then(function(res) {
console.log(res);
})
.catch(function(err) {
console.log(err);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment