vue-hellojs

A small wrapper for integrating HelloJs to Vuejs
8,682 20
Install
npm install vue-hellojs
Latest Version:0.0.4
Vue:1 · 2
License:MIT
Last Updated:Aug 1, 2017
Links: GitHub  ·  npm
Maintainer: jacobgoh101

vue-hellojs

A small wrapper for integrating HelloJs to Vuejs.

HelloJs is a simple and easy to use library for implementing Social Login in web app.

Demo

How to install:

CommonJS:

npm install --save hellojs vue-hellojs
or
yarn add hellojs vue-hellojs

And in your entry file:

import Vue from 'vue';
const HelloJs = require('hellojs/dist/hello.all.min.js');
const VueHello = require('vue-hellojs');

HelloJs.init({
  google: GOOGLE_APP_CLIENT_ID,
  facebook: FACEBOOK_APP_CLIENT_ID
}, {
  redirect_uri: 'authcallback/'
});
Vue.use(VueHello, HelloJs);

Usage:

This wrapper bind hello to Vue or this if you're using single file component.

You can hello like this:

Vue.hello('google').login()

this.hello('google').login()

Example Component

In a .vue component file

<template>
  <div>
    <button @click="auth('google')">Google</button>
  </div>
</template>

<script>
export default {
  data() {
    return {

    }
  }, methods: {
    auth(network) {
      const hello = this.hello;
      hello(network).login().then(() => {
        const authRes = hello(network).getAuthResponse();
        /*
          performs operations using the token from authRes
        */
        hello(network).api('me').then(function (json) {
          const profile = json;
          /*
            performs operations using the user info from profile
          */
        });
      })
    }
  }
}
</script>

<style scoped></style>

Related Packages

vue-axios

A small wrapper for integrating axios to Vuejs

5,218,200 1,996
vue-lodash

A small wrapper for integrating lodash into VueJs

853,868 105
vue-momentjs

A tiny Moment.js wrapper for Vue.

71,108 21
tray-login

Web Component para realizar login nas lojas da Tray.

1,315
vue-electron

The vue plugin that attaches electron APIs to the Vue object, making them access...

161,317 294

Version History

Version Released Vue License
0.0.4 >= 1.0.0 MIT
0.0.3 >= 1.0.0 MIT
0.0.2 >= 1.0.0 MIT
0.0.1 >= 1.0.0 MIT