Skip to content

Instantly share code, notes, and snippets.

@xcambar
Last active December 23, 2015 23:19
Show Gist options
  • Save xcambar/6708931 to your computer and use it in GitHub Desktop.
Save xcambar/6708931 to your computer and use it in GitHub Desktop.
hull.api.js - Lightning fast snippet
Hull.init({
appId: "XYZ",
orgUrl: "abc"
}).then(function (obj) {
console.log('Hull.js is initialized, you can starts doing API calls');
// You can do API calls whether from the obj parameter or from the global object Hull (see below)
}, function (err) {
console.error('Ooops, something went wrong:', err);
});
//If everything went fine (i.e. after init has completed successfully),
// the global object Hull has the following new methods:
Hull.api(); //is now available. See http://hull.io/docs for the parameters and return values (hint: this call only return promises)
Hull.auth.login(_providerName_); //Opens a login popup for the provider of your choice (if configured in your account at http://hullapp.io)
Hull.auth.logout(); // Logs out the current user
//
// Have fun...
//
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment