Use Google Identity Services with your Vue3 App easily
Full documentation can be accessed here
- With NPM
npm install -S vue3-google-signin- With Yarn
yarn add vue3-google-signin- With PNPM
pnpm add vue3-google-signinSetting up the library is very simple. In your application entry point(main.js or main.ts)
put the following code.
// rest of the code
import GoogleSignInPlugin from "vue3-google-signin";
app.use(GoogleSignInPlugin, {
clientId: "CLIENT ID OBTAINED FROM GOOGLE API CONSOLE",
});
// other config
app.mount("#app");For Nuxt 3 and 4, add the nuxt-vue3-google-signin module. It installs the plugin and auto-imports the component, composables and helpers.
npx nuxi@latest module add nuxt-vue3-google-signin// nuxt.config.ts
export default defineNuxtConfig({
modules: ["nuxt-vue3-google-signin"],
googleSignIn: {
clientId: "CLIENT ID OBTAINED FROM GOOGLE API CONSOLE",
},
});Or leave clientId out and set NUXT_PUBLIC_GOOGLE_SIGN_IN_CLIENT_ID when the server starts. The Nuxt guide covers SSR, sessions, protected pages and server routes.
Requires Node.js 22+ and pnpm. Recommended IDE: VSCode + Vue - Official.
pnpm install
cp .env.example .env # set VITE_GOOGLE_CLIENT_ID for the dev playground
pnpm dev # playground (src/App.vue)
pnpm docs:dev # docs site
pnpm lint
pnpm build # type-check + library build
pnpm test # build, then E2E tests (Playwright uses your installed Chrome)