
// Set up a new intents handler Carbyn.connect("app.registerIntent", [], doSomethingWithIntent);// Get intents when launching an app Carbyn.connect("app.getInitIntents", [], doSomethingWithInitIntents);

* Partially available in web context
** Not available in web context
Context.http.get("http://vm01.eadams.dev.opal.synacor.com/some/assets")
.then(doSomethingWithResponse)
.fail(doSomethingWithError);Context.cache
.set('foo', 'bar')
.set('bar', 'bat')
.purge();Context.preferences.get('foo')
.then(doSomethingWithValue)
.fail(doSomethingWithNothing);Context.track('clickButton', {
// arbitary params to track
page: 'home',
user: 'eadams',
date: '2013-06-16'
});Context.registerIntent('read')
.then(doSomethingWithIntent);Context.user.getUsername()
.then(doSomethingWithUsername)
.fail(doSomethingWithError);git://git01.dev.synacor.com/repos/synacor-apps-libs-context
(for a moment.)
git://git01.dev.synacor.com/repos/carbyn-apps



window.location.href = href;
// If the link did not load, open in a new window.
_.delay(function() {
if (window.location.href !== ev.currentTarget.href) {
window.open(href);
}
}, 3000);// Example using express
app.all('/', function(req, res, next) {
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "X-Requested-With");
next();
});