Need help with vue-facebook-signin-button?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

phanan
129 Stars 31 Forks 5 Commits 22 Opened issues

Description

A simple plugin to include a custom Facebook sign-in button into your web app.

Services available

!
?

Need anything else?

Contributors list

# 2,701
Vue.js
Laravel
PHP
TypeScr...
3 commits

vue-facebook-signin-button

A simple Vue plugin to include a custom Facebook sign-in button into your web app.

Screenshot

Install

This plugin can be installed as a module

$ npm install vue-facebook-signin-button

or, if you're not in a modular environment, just include it as a

.

Usage

Important: The Facebook SDK must first be loaded asynchronously for the plugin to work. Something like this will do:

js
  window.fbAsyncInit = function() {
    FB.init({
      appId      : '{your-app-id}',
      cookie     : true,  // enable cookies to allow the server to access the session
      xfbml      : true,  // parse social plugins on this page
      version    : 'v2.8' // use graph api version 2.8
    });
  };
  (function(d, s, id) {
    var js, fjs = d.getElementsByTagName(s)[0];
    if (d.getElementById(id)) return;
    js = d.createElement(s); js.id = id;
    js.src = "//connect.facebook.net/en_US/sdk.js";
    fjs.parentNode.insertBefore(js, fjs);
  }(document, 'script', 'facebook-jssdk'));

Step 1:

import
and
use
the plugin if you're in a modular environment (you don't need this step otherwise, as the plugin will register itself).
import FBSignInButton from 'vue-facebook-signin-button'
Vue.use(FBSignInButton)

Step 2: Now you have a

fb-signin-button
global component, ready for use. It's best to demonstrate the usage with an example:


That's it!

Looking for the Google counterpart?

License

MIT © Phan An

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.