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 🙏

© 2026 – Pkg Stats / Ryan Hefner

google-signin-vue

v1.2.2

Published

This package can be used for both vue and nuxt.

Readme

google-signin-vue

This Package can be used for both vue and nuxt. Both Documentation are given below.

Project setup

npm install google-signin-vue

Basic Setup

To use this package, we must get the client-id from google.

  • Go to Google developer Console

  • Create a Project or select an existing project

  • Then goto oath consent tab on the left sidebar

  • Choose the option internal if this can be used only by the organization. For example, if you registered the organization like myowndomain.com, then anyone who has mail id with @mydomain.com registered with Gmail only can log in.

  • Choose the option external if anyone registered with Gmail can log in.

  • Then You can fill all the details.

  • In case you are testing in localhost, you can just enter application name (mandatory) and enter logo(optional)

  • Save the Details

  • Goto Credentials tab on the left sidebar

  • Select Create Credential

  • Select application type as a web application, specify a name.

  • In the Authorized javascript origins section, enter the project domain name.

  • In Case of localhost just type localhost, If the project running on a specific port, enter the port like localhost:XXXX.

  • Now you’ll get the credentials, use only the client-id, keep your client- secret confidential. client- secret should be provided only to the backend.

For Vue Project

  • In public/index.html add the below script in header
<script src="https://apis.google.com/js/platform.js"></script>

Inside Template

<googleSignIn
      :clientId="'xxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com'"
      :successCallBack="getSuccessData"
      :failureCallBack="getFailureData"
/>

On the script of the same template

import googleSignIn from 'google-signin-vue'

export default {
  name: 'app',
  components: {
    googleSignIn
  },
  methods:{
    getSuccessData:function (user) {
      // The User variable contains id_token, id, name, image, email as objects.
      // Send The id_token to the Backend for the verication.
    },
    getFailureData:function (errorData) {
      // The errorData variable contains failure details
    }
  }
}

For Nuxt Project

  • Create app.html in the root directory of the project and add
   <html {{ HTML_ATTRS }}>
   <head {{ HEAD_ATTRS }}>
     {{ HEAD }}
       <script src="https://apis.google.com/js/platform.js"></script>
   </head>
   <body {{ BODY_ATTRS }}>
   {{ APP }}
   </body>
   </html>

Nuxt Js App Template Documentation

Inside Template

<googleSignIn
      :clientId="'xxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com'"
      :successCallBack="getSuccessData"
      :failureCallBack="getFailureData"
/>

On the script of the same template

import googleSignIn from 'google-signin-vue/src/googleSignIn.vue'

export default {
  name: 'app',
  components: {
    googleSignIn
  },
  methods:{
    getSuccessData:function (user) {
      // The User variable contains id_token, id, name, image, email as objects.
      // Send The id_token to the Backend for the verication.
    },
    getFailureData:function (errorData) {
      // The errorData variable contains failure details
    }
  }
}

Note: You must specify the callback function as props to get the data, The supported props are given below.

| Prop | Type | Required | Description | | ------------------------------------------------------- | :------: | :----------------: | ------------------------------------------------------------------------------------------------ | | clienId | string | :white_check_mark: | Client Id Obtained from google. | | warning | boolean | | Warnings on console is displayed on true. Default is true | | className | string | | Any classname if needed to append on the button | | successCallBack | function | | Function to receive success data, must have one parameter | | failureCallBack | function | | Function to receive failure data, must have one parameter | | customButton | boolean | | True if gonna set the custom button. Set via <slot> Your Code Here</slot> . customButtonId is mandatory if it is set to True | | customButtonId | string | | Id of the custom button, so we can trigger the google on clicking the button | | longTitle | boolean | | Google's Option to set long title. Default is false. | | theme | string | | Google's Option to change the button's display. 'light' / 'dark' are the only value supported. | | buttonWidth | number | | Specify the Button width to google. | | buttonHeight | number | | Specify the Button width to google. |