- Notifications
You must be signed in to change notification settings - Fork18
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
wavezync/vue3-google-signin
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Use Google Identity Services with your Vue3 App easily
Full documentation can be accessedhere
- WithNPM
npm install -S vue3-google-signin
- WithYarn
yarn add vue3-google-signin
- WithPNPM
pnpm add vue3-google-signin
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");
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 🔥.
- WithNPM
npm install -S nuxt-vue3-google-signin
- WithYarn
yarn add nuxt-vue3-google-signin
- WithPNPM
pnpm add nuxt-vue3-google-signin
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',}})
VSCode +Volar (and disable Vetur) +TypeScript Vue Plugin (Volar).
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:
- Disable the built-in TypeScript Extension
- Run
Extensions: Show Built-in Extensionsfrom VSCode's command palette - Find
TypeScript and JavaScript Language Features, right click and selectDisable (Workspace)
- Run
- Reload the VSCode window by running
Developer: Reload Windowfrom the command palette.
SeeVite Configuration Reference.
npm install
npm run dev
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
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors10
Uh oh!
There was an error while loading.Please reload this page.