{"id":15613,"library":"expo-eas-client","title":"Expo EAS Client","description":"The `expo-eas-client` package provides a stable client identifier for Expo Application Services (EAS) within a React Native application. This identifier, often a UUID, is persistently stored on the device—in `NSUserDefaults` on iOS and `SharedPreferences` on Android—ensuring it remains consistent even after app reinstalls or device restores. This is crucial for EAS services to uniquely identify an app installation across sessions and device lifecycles. As of the provided version `55.0.5`, this package is an integral part of the Expo SDK, which releases major versions approximately three times a year, aligning with React Native's release cadence. Its key differentiator is its transparent management of a persistent client ID, forming a foundational component for robust analytics, push notifications, and other device-specific EAS functionalities, rather than being a standalone library for direct end-developer interaction outside the Expo ecosystem.","status":"active","version":"55.0.5","language":"javascript","source_language":"en","source_url":"https://github.com/expo/expo","tags":["javascript","react-native","expo","eas-client","EASClient","typescript"],"install":[{"cmd":"npm install expo-eas-client","lang":"bash","label":"npm"},{"cmd":"yarn add expo-eas-client","lang":"bash","label":"yarn"},{"cmd":"pnpm add expo-eas-client","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"This package is primarily designed for ES Module imports. While CommonJS might work in some older setups, ESM is the standard for modern Expo projects, especially with SDK 50+.","wrong":"const { getOrCreateUUIDAsync } = require('expo-eas-client');","symbol":"getOrCreateUUIDAsync","correct":"import { getOrCreateUUIDAsync } from 'expo-eas-client';"},{"note":"Importing the entire module as a namespace is possible, though `getOrCreateUUIDAsync` is typically the only public API for application logic.","symbol":"EASClient","correct":"import * as EASClient from 'expo-eas-client';"},{"note":"For specific error handling related to this module, the `ExpoEASClientError` class might be exported, if applicable, allowing for more granular catch blocks.","symbol":"ExpoEASClientError","correct":"import { ExpoEASClientError } from 'expo-eas-client';"}],"quickstart":{"code":"import { getOrCreateUUIDAsync } from 'expo-eas-client';\nimport Constants from 'expo-constants';\nimport { Platform } from 'react-native';\n\nasync function displayClientInfo() {\n  try {\n    // The primary function of expo-eas-client is to manage a stable UUID.\n    // Developers typically access a 'client ID' via expo-constants.installationId,\n    // which is underlaid by expo-eas-client for persistence.\n    const easClientId = await getOrCreateUUIDAsync();\n    console.log(`EAS Client ID (from expo-eas-client): ${easClientId}`);\n\n    const installationIdFromConstants = Constants.installationId;\n    console.log(`Installation ID (from expo-constants): ${installationIdFromConstants}`);\n    console.log(`These two IDs should typically be the same.`);\n\n    if (!easClientId || !installationIdFromConstants) {\n      console.warn('Could not retrieve a stable client identifier.');\n      return;\n    }\n\n    console.log(`Platform: ${Platform.OS} ${Platform.Version}`);\n    console.log('This ID is stable across app reinstalls and device restores for consistent EAS services.');\n\n  } catch (error) {\n    console.error('Failed to get EAS Client ID:', error);\n    // Log detailed error for debugging\n    if (error instanceof Error) {\n      console.error('Error message:', error.message);\n      console.error('Error stack:', error.stack);\n    } else {\n      console.error('Unknown error:', error);\n    }\n  }\n}\n\ndisplayClientInfo();","lang":"typescript","description":"Demonstrates how to retrieve the persistent client identifier managed by `expo-eas-client` and compares it with `expo-constants.installationId`."},"warnings":[{"fix":"Rename `metro.config.js` to `metro.config.cjs` and `babel.config.js` to `babel.config.cjs`. If issues persist, consider adding a symlink from `.js` to `.cjs` files for compatibility, or ensure your Metro config correctly handles ES Modules by referring to the latest Expo documentation on customizing Metro.","message":"Projects using `\"type\": \"module\"` in `package.json` may encounter issues with `metro.config.js` or `babel.config.js` files during EAS builds. Metro bundler's ES Module resolution can be strict, leading to build failures.","severity":"breaking","affected_versions":">=50.0.0"},{"fix":"Upgrade your Node.js environment to version 18 (LTS) or later. Use a Node Version Manager (e.g., `nvm use 18`) to manage multiple Node.js versions effectively across projects.","message":"Expo SDK 50+ and related tools, including `eas-cli`, now explicitly require Node.js version 18 or higher. Using older Node.js versions will lead to build failures or unexpected behavior.","severity":"breaking","affected_versions":">=50.0.0"},{"fix":"Transition to EAS Update. Follow the official Expo documentation for migrating from Classic Updates to EAS Update, which involves configuring `eas.json` and using `eas update` commands.","message":"The 'Classic Updates' system (using `expo publish`) has been deprecated since SDK 50. All new and existing projects are encouraged to migrate to EAS Update for over-the-air updates.","severity":"deprecated","affected_versions":">=50.0.0"},{"fix":"Create a 'Web Application' OAuth Client ID in Google Cloud Platform, set `Authorized JavaScript origins` to `https://auth.expo.io`, and `Authorized redirect URIs` to `https://auth.expo.io/@{username}/{SLUG}`. Use the generated Client ID as your `expoClientId` in your authentication configuration.","message":"When implementing Google authentication (and potentially other OAuth providers) in an Expo Go or development build environment, a specific `expoClientId` is required in addition to `androidClientId` and `iosClientId`.","severity":"gotcha","affected_versions":">=40.0.0"},{"fix":"Always include `--environment <environment_name>` (e.g., `eas update --branch main --environment production`) when running `eas update` commands for SDK 55+ projects.","message":"For `eas update` commands with Expo SDK 55 and later, the `--environment` flag is now mandatory to explicitly specify the target environment (e.g., development, preview, production).","severity":"breaking","affected_versions":">=55.0.0"}],"env_vars":null,"last_verified":"2026-04-21T00:00:00.000Z","next_check":"2026-07-20T00:00:00.000Z","problems":[{"fix":"Follow the steps to generate a 'Web Application' OAuth Client ID on Google Cloud Platform, setting `Authorized JavaScript origins` to `https://auth.expo.io` and `Authorized redirect URIs` to `https://auth.expo.io/@{username}/{SLUG}`. Use this ID as `expoClientId`.","cause":"Missing or incorrectly configured `expoClientId` for Google OAuth in an Expo Go or development build environment.","error":"Error: Client Id property expoClientId must be defined to use Google auth on this platform."},{"fix":"Rename configuration files like `metro.config.js` and `babel.config.js` to `.cjs` extensions. If the project itself strictly uses ESM, ensure all dependencies are compatible or use a bundler configuration that correctly handles module interop.","cause":"This error typically occurs during EAS builds when `package.json` specifies `\"type\": \"module\"`, leading to CommonJS modules (like `dotenv`) being treated as ESM and failing to resolve Node.js built-in modules like `fs`.","error":"Error: Unable to resolve module fs from /home/expo/workingdir/build/node_modules/dotenv/lib/main.js: fs could not be found within the project"},{"fix":"Convert `require()` calls to `import` statements (e.g., `import * as Module from 'module';` or `import { namedExport } from 'module';`). For files that must remain CommonJS, ensure they use a `.cjs` extension or remove `\"type\": \"module\"` from `package.json` if the project is predominantly CommonJS.","cause":"Attempting to use `require()` syntax in a JavaScript file that is being treated as an ES Module (e.g., due to `\"type\": \"module\"` in `package.json` or a `.mjs` extension) in an environment that doesn't fully support mixed module types or where specific tools expect ESM.","error":"require() not supported, uses a dynamic import() which is available in all CommonJS modules"}],"ecosystem":"npm"}