hook-javascript plugin for OAuth integration. With less than 5kb minified.
View documentation for configuration examples.
var hook = new Hook.Client({/* browser credentials */})
// login with twitter
$('#twitter-login').click(function(e) {
hook.oauth.popup('twitter').then(function(data) {
console.log("Success!", data);
}).otherwise(function(err) {
console.log("Canceled!", err);
});
});
// login with facebook
$('#facebook-login').click(function(e) {
hook.oauth.popup('facebook').then(function(data) {
console.log("Success!", data);
}).otherwise(function(err) {
console.log("Canceled!", err);
});
});
npm install
npm run build
MIT