Hi friend! Meet us at App.js Conf in Krakow, Poland on April 4th and 5th with workshops and talks. Learn more


Provides access to Amplitude mobile analytics which basically lets you log various events to the Cloud. This module wraps Amplitude's iOS and Android SDKs. For a great example of usage, see the Expo app source code.
Note: Session tracking may not work correctly when running Experiences in the main Expo app. It will work correctly if you create a standalone app.

This API is pre-installed in managed apps. To use it in a bare React Native app, follow its installation instructions.

// in managed apps:
import { Amplitude } from 'expo';

// in bare apps:
import * as Amplitude from 'expo-analytics-amplitude';

Initializes Amplitude with your Amplitude API key. If you're having trouble finding your API key, see step 4 of these instructions.

  • apiKey (string) -- Your Amplitude application's API key.

Assign a user ID to the current user. If you don't have a system for user IDs you don't need to call this. See this page for details.

  • userId (string) -- User ID for the current user.

Set properties for the current user. See here for details.

  • userProperties (object) -- A map of custom properties.

Clear properties set by Amplitude.setUserProperties().

Log an event to Amplitude. For more information about what kind of events to track, see here.

  • eventName (string) -- The event name.

Log an event to Amplitude with custom properties. For more information about what kind of events to track, see here.

  • eventName (string) -- The event name.
  • properties (object) -- A map of custom properties.

Add the current user to a group. For more information, see here for iOS and see here for Android.

  • groupType (string) -- The group name, e.g. "sports".
  • groupNames (object) -- An array of group names, e.g. ["tennis", "soccer"]. Note: the iOS and Android Amplitude SDKs allow you to use a string or an array of strings. We only support an array of strings. Just use an array with one element if you only want one group name.