Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Google OAuth2 plugin for Vue3 Apps. This uses latest Google Identity Service Library. It also provides set of composables which can be used easily to implement different authentication strategies

License

NotificationsYou must be signed in to change notification settings

wavezync/vue3-google-signin

Repository files navigation

Buildnpmnpm bundle sizenpmNPMDocs

Use Google Identity Services with your Vue3 App easily

Documentation

Full documentation can be accessedhere

Installation

  • WithNPM
npm install -S vue3-google-signin
  • WithYarn
yarn add vue3-google-signin
  • WithPNPM
pnpm add vue3-google-signin

Setup the Library

Setting up the library is very simple. In your application entry point(main.js ormain.ts)put the following code.

// rest of the codeimportGoogleSignInPluginfrom"vue3-google-signin"app.use(GoogleSignInPlugin,{clientId:'CLIENT ID OBTAINED FROM GOOGLE API CONSOLE',});// other configapp.mount("#app");

With Nuxt

To easily use the library withNuxt3 we have provided a module callednuxt-vue3-google-signin which take care of proper component registration and plugin initialization 🔥.

Add package

  • WithNPM
npm install -S nuxt-vue3-google-signin
  • WithYarn
yarn add nuxt-vue3-google-signin
  • WithPNPM
pnpm add nuxt-vue3-google-signin

Initialize

Now you can add following entry to thenuxt.config.ts(ornuxt.config.js)

import{defineNuxtConfig}from'nuxt/config'exportdefaultdefineNuxtConfig({modules:['nuxt-vue3-google-signin'],googleSignIn:{clientId:'CLIENT ID OBTAINED FROM GOOGLE API CONSOLE',}})

Development

Recommended IDE Setup

VSCode +Volar (and disable Vetur) +TypeScript Vue Plugin (Volar).

Type Support for.vue Imports in TS

TypeScript cannot handle type information for.vue imports by default, so we replace thetsc CLI withvue-tsc for type checking. In editors, we needTypeScript Vue Plugin (Volar) to make the TypeScript language service aware of.vue types.

If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented aTake Over Mode that is more performant. You can enable it by the following steps:

  1. Disable the built-in TypeScript Extension
    1. RunExtensions: Show Built-in Extensions from VSCode's command palette
    2. FindTypeScript and JavaScript Language Features, right click and selectDisable (Workspace)
  2. Reload the VSCode window by runningDeveloper: Reload Window from the command palette.

Customize configuration

SeeVite Configuration Reference.

Project Setup

npm install

Compile and Hot-Reload for Development

npm run dev

Type-Check, Compile and Minify for Production

npm run build

Lint withESLint

npm run lint

About

Google OAuth2 plugin for Vue3 Apps. This uses latest Google Identity Service Library. It also provides set of composables which can be used easily to implement different authentication strategies

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors10

Languages


[8]ページ先頭

©2009-2025 Movatter.jp