Giter Club home page Giter Club logo

vue-google-sign-in's Introduction

๐ŸŽช vue-google-sign-in

GitHub latest tag GitHub Repo Size GitHub latest commit GitHub license


A simple Vue component for Sign in With Google.

If you are migrating from Google Sign-In JavaScript Platform Library, this might be a great decision for you. Just simply import this plugin as a component and pass your client id as a component prop, and then vue-google-sign-in would do all the stuff for you!

๐Ÿš€ Features

โญ Support Vue 2 (composition-api is required) and Vue 3.

โญ Popup UX mode

โญ Render sign in button which is built by Google (You could do a bit customization)

In progress:

๐Ÿ”ธ One Tap UX mode

๐Ÿ”ธ Render my custom button with slot

๐Ÿ“ฅ Install

$ npm i @kevin_hws/vue-google-sign-in

$ yarn add @kevin_hws/vue-google-sign-in

$ pnpm i @kevin_hws/vue-google-sign-in

โš ๏ธ When using with Vue 2.6 or older, @vue/composition-api is required separately.

For Vue 2.7 or later, import vue directly like Vue3.

๐Ÿ”– Example

<script setup lang="ts">
    import VueGoogleSignInButton from "@kevin_hws/vue-google-sign-in";
    // Or you can import like this
    // import { VueGoogleSignInButton } from "@kevin_hws/vue-google-sign-in";

    // clientId: Your google client id it would looks like: XXXXXXXXXXXX.apps.googleusercontent.com
    const clientId: string = `YOUR_GOOGLE_CLIENT_ID`;
</script>

<template>
    <div>
        <VueGoogleSignInButton
            :client-id="clientId"
            :button-configs="{
                type: 'standard',
                theme: 'filled_black',
                size: 'large',
                text: 'signin_with',
                shape: 'pill',
                logo_alignment: 'left',
                width: '300',
                locale: 'en',
            }"
        />
    </div>
</template>

Props

Prop Type default information
clientId String (Required) - Google API client ID. Follow the steps here to get your own client ID.
buttonConfigs Object (Optional)
{
type: "standard",
theme: "outline", size: "large",
text: "signin",
shape: "rectangular",
logo_alignment: "left",
width: "200",
locale: "",
}
The button is rendered by GSI API. If you need more detail, please check it out on GsiButtonConfiguration

โ“ Q&A

  • How to get my Google API client ID ?
    • Please follow the steps here to setup Credential and OAuth Consent Screen

๐Ÿ“ Reference

vue-google-sign-in's People

Contributors

kevinshu1995 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.