npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vue3-facebook-login

v1.0.2

Published

A facebook login component which hides the complexity of facebook javascript SDK to initialize and connect with facebook and get access token.

Downloads

311

Readme

vue3-facebook-login

A facebook login component which hides the complexity of facebook javascript SDK to initialize and connect with facebook and get access token.

Installation

npm install vue3-facebook-login

Usage

vue3-facebook-login hides the complexity of facebook javascript SDK hence it is comparitively very easy to use.

ES6

For Local Registration

import FacebookLogin from "vue3-facebook-login";

export default {
    ...
    components : {
        FacebookLogin,
        ...
    },
    ...
}

For Global Registration

Update main.js

import { createApp } from "vue";
import App from "./App.vue";
...
import FacebookLogin from "vue3-facebook-login";

createApp(App).component("facebook-login", FacebookLogin)
...

After importing the component, you can use it in your templates as:

<facebook-login
    :appId="appId"
    @loggedIn="handleLogin"
    @loginFailed="handleLoginFailed"
>
</facebook-login>
...
</template>
<script>
...
{
    ...
    methods : {
        handleLogin(response) {
            console.log("User Successfully Logged In" , response)
        },
        handleLoginFailed() {
            console.log("User Cancelled or Abort the Login")
        }
    }
...
}
...

where appId is the appId recieved after creating App to use Facebook Authentication from Facebook

Props

| Property | Required | Type | Default | Decription | | -------- | -------- | ------ | ------------------- | ------------------------------------------------------- | | appId | true | String | - | appId recieved from Facebook after creating App. | | type | false | String | normal | defines the type of button (minimal, normal, or custom) | | theme | false | String | light | defines the theme for the button(light or dark) | | text | false | String | Login with Facebook | text for the login button when used custom type | | classes | false | String | null | classes needs to be applied to custom login button | | styles | false | String | null | styles needs to be applied to custom login button |

Events

| Event | Invoking Time | Type | Decription | | ----------- | ---------------------------------------------- | -------- | --------------------------------------------------------------------------------------------------------- | | loggedIn | When user successfully logged in with facebook | function | pass a function which should contain all the operations to be performed after successful facebook login | | loginFailed | When user cancelled/abort login with facebook | function | pass a function which should contain all the operations to be performed after cancel/abort facebook login |

Warning

If after following all the instructions carefully Facebook Login is still not working and saying App not set up This app is still in development mode, and you don't have access to it. Switch to a registered test user or ask an app admin for permissions. then there may be 2 reasons behind it.

  1. You may have used wrong appId.
  2. Facebook Policy : The method FB.login can no longer be called from http pages

So I would Suggest just go ahead and move the app to a https environment and it will be finely working.

Creator

Mohammad Dilshad Alam created and maintains this component.