Last active
December 23, 2015 23:19
-
-
Save xcambar/6708931 to your computer and use it in GitHub Desktop.
hull.api.js - Lightning fast snippet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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