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

@xtiannyeto/vue-auth-social

v0.1.9

Published

Use social authentication Facebook / Google with Vue 3 composition api

Downloads

122

Readme

@xtiannyeto/vue-auth-social

Use social authentication Facebook / Google with Vue 3 composition api

Installation

Use the package manager yarn or npm to install vue-auth-social.

yarn add @xtiannyeto/vue-auth-social
npm install @xtiannyeto/vue-auth-social

in your main css or scss file

@import '~vue-auth-social/dist/vue-auth-social.css';

Using Auth Modal you need tailwind in your main css or scss file

@import '~tailwindcss/base';
@import '~tailwindcss/components';
@import '~tailwindcss/utilities';

Usage

Facebook Auth

 <FacebookAuth :appId="facebookAppId" @on-submit="facebook">
    Facebook <!-- Whatever you want event your own custom button-->
 </FacebookAuth>
import { defineComponent } from 'vue';
import { FacebookAuth } from '@xtiannyeto/vue-auth-social';

export default defineComponent({
  name: 'xxx',
  components: {
    ...
    FacebookAuth,
    ...
  },
  setup() {
    const facebookAppId = process.env.FACEBOOK_APP_ID; // your facebook application ID
    return { facebookAppId };
  },
  methods: {
    facebook(event: any) {
      console.log(event); // event response handler
    }
  }
});

Google Auth

 <GoogleAuth :clientId="googleClientId" @on-submit="google">
    Google <!-- Whatever you want, even your own custom button -->
 </GoogleAuth>
import { defineComponent } from 'vue';
import { GoogleAuth } from '@xtiannyeto/vue-auth-social';

export default defineComponent({
  name: 'xxx',
  components: {
    ...
    GoogleAuth,
    ...
  },
  setup() {
    const googleClientId = process.env.GOOGLE_CLIENT_ID; // your Google Client ID
    return { googleClientId };
  },
  methods: {
    google(event: any) {
      console.log(event); // event response handler
    }
  }
});

Use Auth Modal

 <Auth ref="authRef"
    :logo="YOUR_ICON_PATH"
    :color="MAIN_COLOR" <!-- tailwind color, indigo by default -->
    :facebookAppId="facebookAppId"
    :googleClientId="googleClientId"
    @on-google="google"
    @on-facebook="facebook">
     Login <!-- Whatever you want, even your own custom button -->
 </Auth>
import { defineComponent } from 'vue';
import { Auth } from '@xtiannyeto/vue-auth-social';

export default defineComponent({
  name: 'xxx',
  components: {
    Auth
  },
  setup() {
    const facebookAppId = process.env.FACEBOOK_APP_ID; // your application ID
    const googleClientId = process.env.GOOGLE_CLIENT_ID; // your Google Client ID
    return { googleClientId, facebookAppId };
  },
  methods: {
    facebook(event: any) {
      console.log(event);
    },
    google(event: any) {
      console.log(event);
    }
  }
});

Use Auth Modal with user / password (No authentication just form handler)

In previe

 <Auth ref="authRef"
    ....
    :color="MAIN_COLOR" 
    :userPassword="true" <!-- active user / Mp auth on modal and register -->
    .......
    .......
    @on-signin="signin" <!-- handle signIn -->
    @on-signup="signup"> <!-- handle signup -->
     Login
 </Auth>
.....
signIn(event: any) {
  console.log(event);
},
signUp(event: any) {
  console.log(event);
}
.....

Close Auth Modal

 <Auth ref="authRef"
     Login
 </Auth>
<button @click="closeAuth">Close</button>
setup() {
    const authRef: any = ref(null);
    function closeAuth() {
      authRef.value?.close();
    }
    return { authRef, closeAuth, ...};
  }

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT