An auth provider for react-admin v5+ that integrates Google Identity Services (GIS) for sign-in with Google, One Tap, and automatic sign-in. Current stable version is 3.0.0, released November 2024, with monthly updates. Simplifies authentication by providing an authProvider, LoginButton, OneTapButton, and httpClient. Key differentiators: tightly coupled with react-admin, supports client-side GIS features only, and removes the previous useGoogleAuthProvider/GoogleAuthContext in v3.0.0.
npm install ra-auth-googleVerified import paths — ran on the pinned version, not inferred.
Minimal setup: configure googleAuthProvider and googleHttpClient with client ID, and use LoginButton as login page.
Replace `useGoogleAuthProvider()` with `googleAuthProvider({clientId})` directly.Call as function: `googleAuthProvider({clientId})` instead of `new GoogleAuthProvider(config)`.Upgrade react-admin to v5 or later.
Ensure TypeScript usage; prop-types no longer needed.
Add `<script async defer src="https://accounts.google.com/gsi/client"></script>` to your HTML `<head>`.
Use `VITE_GOOGLE_CLIENT_ID` instead of `GOOGLE_CLIENT_ID`.
Import and use `googleAuthProvider` from 'ra-auth-google' directly.
Run `npm install ra-auth-google --save` and ensure react-admin v5+ is installed.
Set `VITE_GOOGLE_CLIENT_ID` in .env or pass clientId explicitly.
Add `<script async defer src="https://accounts.google.com/gsi/client"></script>` to index.html.