# vue-facebook-login-button-directive

> A simple Vue directive to include Facebook Sign-In Button behavior in any component.

Latest version **0.0.1** (published 2020-05-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install vue-facebook-login-button-directive
pnpm add vue-facebook-login-button-directive
yarn add vue-facebook-login-button-directive
bun add vue-facebook-login-button-directive
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2020-05-08 |
| First published | 2020-05-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Collin Pedersen |
| Maintainers | collinped |
| Keywords | vue, facebook, signin, login |

## Links

- npm: https://www.npmjs.com/package/vue-facebook-login-button-directive
- Repository: https://github.com/collinped/vue-facebook-login-button-directive
- Homepage: https://github.com/collinped/vue-facebook-login-button-directive#readme
- Issues: https://github.com/collinped/vue-facebook-login-button-directive/issues
- npm.io page: https://npm.io/package/vue-facebook-login-button-directive

## Alternatives

- [cli-color](https://npm.io/package/cli-color.md) — 3.4M weekly downloads
- [log](https://npm.io/package/log.md) — 1.3M weekly downloads
- [logstash-client](https://npm.io/package/logstash-client.md) — 4.5K weekly downloads
- [@nocobase/plugin-logger](https://npm.io/package/@nocobase/plugin-logger.md) — 2.0K weekly downloads
- [child-process-debug](https://npm.io/package/child-process-debug.md) — 695 weekly downloads

## Recent versions

- 0.0.1 (latest) — 2020-05-08

## README

# vue-facebook-login-button-directive

> :closed_lock_with_key: A simple [Vue](https://vuejs.org) directive to include [Facebook Sign-In Button](https://developers.facebook.com/docs/facebook-login/web?locale=en_US) behavior in any component.

## Install

```bash
$ npm install --save vue-facebook-login-button-directive

$ yarn add vue-facebook-login-button-directive
```

## Usage

Import the directive and attach it to any component, let's give you an example:

> Important: `OnFacebookAuthSuccess` and `OnFacebookAuthFail` are mandatory methods you have to declare in your component where you are using the directive.

```html
<template>
  <button v-facebook-login-button="appId" class="facebook-login-button">
    Continue with Facebook
  </button>
</template>

<script>
  import FacebookLoginButton from 'vue-facebook-login-button-directive'
  export default {
    directives: {
      FacebookLoginButton
    },
    data: () => ({
      appId: 'Your_Facebook_App-Id'
    }),
    methods: {
      OnFacebookAuthSuccess(idToken) {
        // Receive the idToken and make your magic with the backend
      },
      OnFacebookAuthFail(error) {
        console.log(error)
      }
    }
  }
</script>

<style>
  .facebook-login-button {
    color: white;
    background-color: #3b5998;
    height: 50px;
    font-size: 16px;
    border-radius: 10px;
    padding: 10px 20px 25px 20px;
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
  }
</style>
```

---
_Source: https://npm.io/package/vue-facebook-login-button-directive · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
