Docs-logo

Expo

Get Started
API Reference
Slash-shortcut-icon
Hamburger-icon

Constants

expo-constants provides system information that remains constant throughout the lifetime of your app's install.

Platform Compatibility

Android DeviceAndroid EmulatoriOS DeviceiOS SimulatorWeb
Status-success-iconStatus-success-iconStatus-success-iconStatus-success-iconStatus-success-icon

Installation

Terminal
→ expo install expo-constants

If you're installing this in a bare React Native app, you should also follow these additional installation instructions.

import Constants from 'expo-constants';

NameTypeDescription
scopeKey
(optional)
stringAn opaque unique string for scoping client-side data to this project. This value will not change when a project is transferred between accounts or renamed.

NameTypeDescription
projectId
(optional)
stringThe ID for this project if it's using EAS. UUID. This value will not change when a project is transferred between accounts or renamed.

ExpoConfig extended by:

NameTypeDescription
bundleUrlstring-
currentFullName
(optional)
stringThe Expo account name and slug used for display purposes. Formatted like @username/slug. When unauthenticated, the username is @anonymous. For published projects, this value may change when a project is transferred between accounts or renamed.
hostUri
(optional)
string-
id
(optional)
string
Info-icon
Deprecated. Prefer projectId or originalFullName instead for identification and scopeKey for scoping due to immutability.
The Expo account name and slug for this project.
originalFullName
(optional)
stringThe original Expo account name and slug for this project. Formatted like @username/slug. When unauthenticated, the username is @anonymous. For published projects, this value will not change when a project is transferred between accounts or renamed.
publishedTime
(optional)
string-
releaseChannel
(optional)
string-
releaseId
(optional)
stringPublished apps only.
revisionId
(optional)
string-

NameTypeDescription
debuggerHost
(optional)
string-
developer
(optional)
{ tool: string }-
logUrl
(optional)
string-
mainModuleName
(optional)
string-
packagerOpts
(optional)
ExpoGoPackagerOpts-

NameTypeDescription
dev
(optional)
boolean-
hostType
(optional)
string-
lanType
(optional)
string-
minify
(optional)
boolean-
strict
(optional)
boolean-
urlRandomness
(optional)
string-
urlType
(optional)
string-

A modern manifest.

NameTypeDescription
assetsManifestAsset[]-
createdAtstring-
extra
(optional)
ManifestExtra-
idstring-
launchAssetManifestAsset-
metadataobject-
runtimeVersionstring-

ClientScopingConfig extended by:

NameTypeDescription
eas
(optional)
EASConfig-
expoClient
(optional)
ExpoClientConfig-
expoGo
(optional)
ExpoGoConfig-

NameTypeDescription
versionCodenumber
Info-icon
Deprecated. Use expo-application's Application.nativeBuildVersion.
The version code set by android.versionCode in app.json. The value is set to null in case you run your app in Expo Go.

Extends: NativeConstants

NameTypeDescription

NameTypeDescription
buildNumbernull | stringThe build number specified in the embedded Info.plist value for CFBundleVersion in this app. In a standalone app, you can set this with the ios.buildNumber value in app.json. This may differ from the value in Constants.manifest.ios.buildNumber because the manifest can be updated, whereas this value will never change for a given native binary. The value is set to null in case you run your app in Expo Go.
modelnull | string
Info-icon
Deprecated. Moved to expo-device as Device.modelName.
The human-readable model name of this device, e.g. "iPhone 7 Plus" if it can be determined, otherwise will be null.
platformstring
Info-icon
Deprecated. Use expo-device's Device.modelId.
The Apple internal model identifier for this device, e.g. iPhone1,1.
systemVersionstring
Info-icon
Deprecated. Use expo-device's Device.osVersion.
The version of iOS running on this device, e.g. 10.3.
userInterfaceIdiomUserInterfaceIdiom
Info-icon
Deprecated. Use expo-device's Device.getDeviceTypeAsync().
The user interface idiom of this device, i.e. whether the app is running on an iPhone or an iPad.

NameTypeDescription
urlstring-

NameTypeDescription
android
(optional)
AndroidManifest-
detach
(optional)
{ scheme: string }-
developer
(optional)
string-
hostUri
(optional)
string-
ios
(optional)
IOSManifest-
logUrl
(optional)
string-
scheme
(optional)
string-
web
(optional)
WebManifest-

  • Expo - The experience is running inside of the Expo Go app.

    AppOwnership.Expo"expo"

  • Guest - It has been opened through a link from a standalone app.

    AppOwnership.Guest"guest"

  • Standalone - It is a standalone app.

    AppOwnership.Standalone"standalone"

  • Bare

    ExecutionEnvironment.Bare"bare"

  • Standalone

    ExecutionEnvironment.Standalone"standalone"

  • StoreClient

    ExecutionEnvironment.StoreClient"storeClient"

Current supported values are handset and tablet. Apple TV and CarPlay will show up as unsupported.

  • Handset

    UserInterfaceIdiom.Handset"handset"

  • Tablet

    UserInterfaceIdiom.Tablet"tablet"

  • Unsupported

    UserInterfaceIdiom.Unsupported"unsupported"