@jackhuynh1995/vue3-facebook-login

0.1.6 • Public • Published

Vue 3 facebook login

npm npm GitHub

Demo

Demo and docs

Installation

Prerequisites

To get started, you can install vue3-facebook-login with:

npm i @healerlab/vue3-facebook-login

with pnpm:

pnpm add @healerlab/vue3-facebook-login

with yarn:

yarn add @healerlab/vue3-facebook-login

Usage

See the FaceBook Graph API for more information about scope.

Import the component and register it locally in your Vue component:

<script setup>
import { HFaceBookLogin } from '@healerlab/vue3-facebook-login';

const onSuccess = (response) => {
  // get your auth token and info
}

const onFailure = () => {
  // logic if auth failed
}
</script>

Use the component in your template:

<HFaceBookLogin 
  v-slot="fbLogin" 
  app-id="391069538168549" 
  @onSuccess="onSuccess" 
  @onFailure="onFailure"
  scope="id,name,email,first_name,last_name,birthday"
>
  <span @click="fbLogin.initFBLogin" class="fb-button">Login with facebook</span>
</HFaceBookLogin>

This is style for this example and not required, you can change and customize it to match your use-case:

.fb-button {
  display: inline-block;
  margin: 10px 0 10 0;
  color: white;
  background-color: #1967d2;
  border-radius: 8px;
  padding: 16px;
  cursor: pointer;
}

See the Vue3 FaceBook Login page for more information.

Package Sidebar

Install

npm i @jackhuynh1995/vue3-facebook-login

Weekly Downloads

4

Version

0.1.6

License

MIT

Unpacked Size

82.1 kB

Total Files

10

Last publish

Collaborators

  • jackhuynh95