Expo EAS Client

55.0.5 · active · verified Tue Apr 21

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.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates how to retrieve the persistent client identifier managed by `expo-eas-client` and compares it with `expo-constants.installationId`.

import { getOrCreateUUIDAsync } from 'expo-eas-client';
import Constants from 'expo-constants';
import { Platform } from 'react-native';

async function displayClientInfo() {
  try {
    // The primary function of expo-eas-client is to manage a stable UUID.
    // Developers typically access a 'client ID' via expo-constants.installationId,
    // which is underlaid by expo-eas-client for persistence.
    const easClientId = await getOrCreateUUIDAsync();
    console.log(`EAS Client ID (from expo-eas-client): ${easClientId}`);

    const installationIdFromConstants = Constants.installationId;
    console.log(`Installation ID (from expo-constants): ${installationIdFromConstants}`);
    console.log(`These two IDs should typically be the same.`);

    if (!easClientId || !installationIdFromConstants) {
      console.warn('Could not retrieve a stable client identifier.');
      return;
    }

    console.log(`Platform: ${Platform.OS} ${Platform.Version}`);
    console.log('This ID is stable across app reinstalls and device restores for consistent EAS services.');

  } catch (error) {
    console.error('Failed to get EAS Client ID:', error);
    // Log detailed error for debugging
    if (error instanceof Error) {
      console.error('Error message:', error.message);
      console.error('Error stack:', error.stack);
    } else {
      console.error('Unknown error:', error);
    }
  }
}

displayClientInfo();

view raw JSON →