{"id":16723,"library":"expo-google-auth","title":"Expo Google Auth Module","description":"The `expo-google-auth` package, currently at version 0.3.0, offers a dedicated solution for integrating Google authentication into React Native Expo applications. It achieves this by leveraging Google's modern Identity API and Credential Manager, presenting an updated approach to handling user sign-ins compared to traditional methods. While it provides two primary authentication methods, the module explicitly recommends \"Method 1\" as the latest approach endorsed by Google. A crucial aspect of this library is its current platform limitation: it exclusively supports Android environments. Developers targeting iOS are directed to use `expo-auth-session` for their authentication needs. Launched publicly in November 2025, the package has seen a consistent, albeit minor, release cadence, signaling ongoing development. To function correctly, users must perform essential Google Credentials setup for both Android and web clients, which includes obtaining and configuring a Google Web Client ID. This package aims to simplify Google sign-in workflows specifically for Android within the Expo ecosystem.","status":"active","version":"0.3.0","language":"javascript","source_language":"en","source_url":"https://github.com/spbro007/npm-packages#main","tags":["javascript","react-native","expo","expo-google-auth","ExpoGoogleAuth","typescript"],"install":[{"cmd":"npm install expo-google-auth","lang":"bash","label":"npm"},{"cmd":"yarn add expo-google-auth","lang":"bash","label":"yarn"},{"cmd":"pnpm add expo-google-auth","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core Expo framework dependency.","package":"expo","optional":false},{"reason":"Core React library for UI development.","package":"react","optional":false},{"reason":"Core React Native library for mobile app development.","package":"react-native","optional":false}],"imports":[{"note":"Primarily designed for ESM usage within Expo/React Native projects. CommonJS `require` is not officially supported and may lead to issues.","wrong":"const ExpoGoogleAuth = require('expo-google-auth');","symbol":"ExpoGoogleAuth","correct":"import ExpoGoogleAuth from 'expo-google-auth';"}],"quickstart":{"code":"import ExpoGoogleAuth from 'expo-google-auth';\nimport { Alert } from 'react-native'; // For showing results in a real app\n\nconst MY_GOOGLE_WEB_CLIENT_ID = process.env.GOOGLE_WEB_CLIENT_ID ?? 'YOUR_GWC_ID_HERE'; // Replace with your actual GWC ID\n\nasync function signInWithGoogle() {\n  if (MY_GOOGLE_WEB_CLIENT_ID === 'YOUR_GWC_ID_HERE') {\n    Alert.alert('Configuration Error', 'Please replace YOUR_GWC_ID_HERE with your actual Google Web Client ID.');\n    return;\n  }\n  try {\n    // Method 1: Latest, Recommended by Google\n    const idToken = await ExpoGoogleAuth.launchGoogleAuth(\"GID\", MY_GOOGLE_WEB_CLIENT_ID);\n    if (idToken) {\n      Alert.alert('Sign-in Successful', `Received ID Token: ${idToken.substring(0, 30)}...`);\n      console.log('Google ID Token:', idToken);\n      // Now, provide this id token to your backend auth provider\n    } else {\n      Alert.alert('Sign-in Failed', 'No ID token received.');\n    }\n  } catch (error) {\n    console.error('Google Sign-in Error:', error);\n    Alert.alert('Sign-in Error', error.message || 'An unknown error occurred during Google sign-in.');\n  }\n}\n\n// Example of how to call it (e.g., from a button press in a React Native component)\nsignInWithGoogle();","lang":"typescript","description":"Demonstrates how to initiate Google authentication using the recommended 'GID' method and handle the returned ID token. Includes error handling and prompts for necessary configuration."},"warnings":[{"fix":"For iOS, implement Google authentication using `expo-auth-session` as recommended in the official Expo documentation.","message":"This module currently provides native Google authentication support exclusively for Android. For iOS applications, developers are explicitly advised to use `expo-auth-session`.","severity":"gotcha","affected_versions":">=0.1.1"},{"fix":"Refer to Google's Identity API documentation and Expo's guides for setting up Google Credentials, ensuring your GWC ID and Android SHA-1 fingerprints are correctly configured.","message":"Successful Google authentication requires proper setup of Google Credentials, including obtaining a Google Web Client ID (GWC ID) and configuring it in the Google Cloud Console for your Android application (and potentially web client).","severity":"gotcha","affected_versions":">=0.1.1"},{"fix":"Always prefer `ExpoGoogleAuth.launchGoogleAuth(\"GID\", gwcId)` for the most current and recommended Google Identity API integration.","message":"The `launchGoogleAuth` method accepts two string arguments: 'GID' (recommended) or 'SWIG' (traditional). While both may work, Google's latest recommendations favor the 'GID' approach.","severity":"gotcha","affected_versions":">=0.1.1"}],"env_vars":null,"last_verified":"2026-04-22T00:00:00.000Z","next_check":"2026-07-21T00:00:00.000Z","problems":[{"fix":"Verify that your Google Web Client ID is correct, the Android client is registered with the correct package name and SHA-1 fingerprint in the Google Cloud Console, and ensure the API is enabled.","cause":"Google credentials (e.g., Google Web Client ID, SHA-1 fingerprints for Android) are incorrectly configured or missing in the Google Cloud Console.","error":"Failed to authenticate. ID token is null or undefined."},{"fix":"Ensure you are using `import ExpoGoogleAuth from 'expo-google-auth';` in your JavaScript/TypeScript files. If using CommonJS, consider project-wide migration to ESM or using dynamic import.","cause":"This error typically occurs when attempting to use CommonJS `require()` syntax with an ESM-only package, or when TypeScript/Babel transpilation is misconfigured.","error":"TypeError: ExpoGoogleAuth.launchGoogleAuth is not a function"},{"fix":"Run `npm install expo-google-auth` or `yarn add expo-google-auth` in your project directory. Double-check the spelling of the import path.","cause":"The package `expo-google-auth` has not been installed, or there's a typo in the import path.","error":"Module not found: Can't resolve 'expo-google-auth'"}],"ecosystem":"npm"}