Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

expo-constants

expo3.6mMIT17.0.4TypeScript support: included

Provides system information that remains constant throughout the lifetime of your app.

react-native, expo, constants

readme

expo sdk

Expo

Expo SDK version Chat or ask a question License: MIT Downloads

Try Expo in the Browser  •  Read the Documentation  •  Learn more on our blog  •  Request a feature

Follow us on

Expo on X   Expo on GitHub   Expo on Reddit   Expo on LinkedIn   Expo on LinkedIn

Introduction

Expo is an open-source platform for making universal native apps that run on Android, iOS, and the web. It includes a universal runtime and libraries that let you build native apps by writing React and JavaScript.

This repository includes the Expo SDK, Modules API, Go app, CLI, Router, documentation, and various other supporting tools. Expo Application Services (EAS) is a platform of hosted services that are deeply integrated with Expo open source tools. EAS helps you build, ship, and iterate on your app as an individual or a team.

Read the Expo Community Guidelines before interacting in the repository. Thank you for helping keep the Expo community open and welcoming!

Table of contents

📚 Documentation

Learn about building and deploying universal apps in our official docs!

🗺 Project Layout

  • packages All the source code for Expo modules, if you want to edit a library or just see how it works this is where you'll find it.
  • apps This is where you can find Expo projects which are linked to the development modules. You'll do most of your testing in here.
  • apps/expo-go This is where you can find the source code for Expo Go.
  • apps/expo-go/ios/Exponent.xcworkspace is the Xcode workspace. When developing iOS, always open this instead of Exponent.xcodeproj because the workspace also loads the CocoaPods dependencies.
  • docs The source code for https://docs.expo.dev
  • templates The template projects you get when you run npx create-expo-app
  • react-native-lab This is our fork of react-native used to build Expo Go.
  • guides In-depth tutorials for advanced topics like contributing to the client.
  • tools contain build and configuration tools.
  • template-files contains templates for files that require private keys. They are populated using the keys in template-files/keys.json.
  • template-files/ios/dependencies.json specifies the CocoaPods dependencies of the app.

🏅 Badges

Let everyone know your app can be run instantly in the Expo Go app!

runs with Expo Go

runs with Expo Go

[![runs with Expo Go](https://img.shields.io/badge/Runs%20with%20Expo%20Go-000.svg?style=flat-square&logo=EXPO&labelColor=f3f3f3&logoColor=000)](https://expo.dev/client)

[![runs with Expo Go](https://img.shields.io/badge/Runs%20with%20Expo%20Go-4630EB.svg?style=flat-square&logo=EXPO&labelColor=f3f3f3&logoColor=000)](https://expo.dev/client)

👏 Contributing

If you like Expo and want to help make it better then check out our contributing guide! Check out the CLI package to work on the Expo CLI.

❓ FAQ

If you have questions about Expo and want answers, then check out our Frequently Asked Questions!

If you still have questions you can ask them on our Discord and Forums or X @expo.

💙 The Team

Curious about who makes Expo? Here are our team members!

License

The Expo source code is made available under the MIT license. Some of the dependencies are licensed differently, with the BSD license, for example.

Star the Expo repo on GitHub to support the project

changelog

Changelog

Unpublished

🛠 Breaking changes

🎉 New features

🐛 Bug fixes

💡 Others

17.0.4 — 2025-01-10

This version does not introduce any user-facing changes.

17.0.3 — 2024-11-14

This version does not introduce any user-facing changes.

17.0.2 — 2024-10-28

This version does not introduce any user-facing changes.

17.0.1 — 2024-10-22

💡 Others

17.0.0 — 2024-10-22

🛠 Breaking changes

🎉 New features

🐛 Bug fixes

  • Add missing react-native peer dependencies for isolated modules. (#30464 by @byCedric)
  • Only import from expo/config to follow proper dependency chains. (#30501 by @byCedric)

💡 Others

16.0.2 - 2024-05-29

🐛 Bug fixes

16.0.1 — 2024-04-23

This version does not introduce any user-facing changes.

16.0.0 — 2024-04-18

🛠 Breaking changes

  • Remove deprecated installationId, isDevice, nativeAppVersion, nativeBuildVersion, platform.platform, platform.systemVersion, platform.userInterfaceIdiom properties. (#26329 by @aleqsio)

💡 Others

  • [iOS] Add privacy manifest describing required reason API usage. (#27770 by @aleqsio)
  • [expo-updates] Migrate to requireNativeModule/requireOptionalNativeModule. (#25648 by @wschurman)
  • Remove most of Constants.appOwnership. (#26313 by @wschurman)
  • Improve updates types and clarity in expo-asset. (#26337 by @wschurman)
  • Removed deprecated backward compatible Gradle settings. (#28083 by @kudo)

15.4.5 - 2024-01-18

This version does not introduce any user-facing changes.

15.4.4 - 2024-01-15

🐛 Bug fixes

15.4.3 - 2024-01-10

🎉 New features

15.4.2 - 2023-12-19

This version does not introduce any user-facing changes.

15.4.1 — 2023-12-13

This version does not introduce any user-facing changes.

15.4.0 — 2023-12-12

💡 Others

15.3.0 — 2023-11-14

🛠 Breaking changes

15.2.0 — 2023-10-17

This version does not introduce any user-facing changes.

15.1.0 — 2023-09-15

🎉 New features

💡 Others

  • Use dedicated requireOptionalNativeModule instead of try-catching requireNativeModule. (#24262 by @tsapeta)

15.0.0 — 2023-09-04

🛠 Breaking changes

🎉 New features

  • Added support for React Native 0.73. (#24018 by @kudo)

14.5.1 — 2023-08-02

🛠 Breaking changes

  • Drop support for logUrl which sent console logs to the legacy expo-cli. (#18596 by @EvanBacon)

14.5.0 — 2023-07-28

🐛 Bug fixes

  • Fix task ':expo-constants:packageDebugAssets' uses this output of task ':expo-constants:copyReleaseExpoConfig' without declaring an explicit or implicit dependency when running gradlew test on Android. (#23511 by @lukmccall)

💡 Others

14.4.2 — 2023-06-24

💡 Others

  • Remove the long-deprecated Constants.deviceYearClass and Constants.platform.ios.model. These properties now live on expo-device. (#23068 by @brentvatne)

14.4.1 — 2023-06-22

This version does not introduce any user-facing changes.

14.4.0 — 2023-06-13

🐛 Bug fixes

14.3.0 — 2023-05-08

💡 Others

14.2.1 — 2023-02-09

This version does not introduce any user-facing changes.

14.2.0 — 2023-02-03

💡 Others

  • On Android bump compileSdkVersion and targetSdkVersion to 33. (#20721 by @lukmccall)

14.1.0 — 2022-12-30

🎉 New features

🐛 Bug fixes

14.0.2 — 2022-10-30

This version does not introduce any user-facing changes.

14.0.1 — 2022-10-28

This version does not introduce any user-facing changes.

14.0.0 — 2022-10-06

🛠 Breaking changes

  • Bumped iOS deployment target to 13.0 and deprecated support for iOS 12. (#18873 by @tsapeta)

🐛 Bug fixes

  • Fixed with-node.sh doesn't keep quotes when passing arguments to Node.js and caused build errors when there are spaces in target name. (#18741 by @kudo)

💡 Others

  • Refactored inline Android emulator checks to use enhanced checking in EmulatorUtilities.isRunningOnEmulator(). (#16177) by @kbrandwijk, @keith-kurak)

13.2.3 — 2022-07-25

🐛 Bug fixes

  • Deprecated the unreliable source-login-scripts.sh and sourcing the Node.js binary path from .xcode.env and .xcode.env.local. (#18330 by @kudo)

13.2.2 — 2022-07-16

This version does not introduce any user-facing changes.

13.2.1 — 2022-07-11

This version does not introduce any user-facing changes.

13.2.0 — 2022-07-07

🎉 New features

🐛 Bug fixes

13.1.0 — 2022-04-18

🐛 Bug fixes

  • Fixed iOS script phase build error when extendedglob is enabled in zsh config. (#17024 by @kudo)

💡 Others

⚠️ Notices

  • On Android bump compileSdkVersion to 31, targetSdkVersion to 31 and Java version to 11. (#16941 by @bbarthec)

13.0.2 - 2022-02-01

🐛 Bug fixes

  • Fix Plugin with id 'maven' not found build error from Android Gradle 7. (#16080 by @kudo)

13.0.1 — 2022-01-20

🐛 Bug fixes

  • Fix the PhaseScriptExecution build errors when the source_login_scripts.sh failed to load. (#15890 by @kudo)

13.0.0 — 2021-12-03

🛠 Breaking changes

💡 Others

  • Add missing null to the Constants.buildNumber type. (#15280 by @Simek)

12.2.0 — 2021-11-17

🐛 Bug fixes

💡 Others

  • Extract nested objects from current types to new, separate types - ExpoGoPackagerOpts and ManifestExtra. (#15113 by @Simek)

12.1.3 — 2021-10-22

🐛 Bug fixes

  • Don't include fonts from family "System Font" (introduced by iOS 15) (#14577 by @brentvatne)
  • Fix Constants.deviceId has been deprecated in favor of generating and storing your own ID. warnings in classic react-native projects. (#14837 by @kudo)

12.1.2 — 2021-10-21

This version does not introduce any user-facing changes.

12.1.1 — 2021-10-15

🛠 Breaking changes

  • Deprecated Constants.deviceYearClass, moved to expo-device - Device.deviceYearClass (#14691 by @EvanBacon)
  • Deprecated Constants.platform.ios.model, moved to expo-device - Device.modelName (#14691 by @EvanBacon)

🎉 New features

12.1.0 — 2021-10-01

🐛 Bug fixes

  • Don't include fonts from family "System Font" (introduced by iOS 15) (#14577 by @brentvatne)

12.0.0 — 2021-09-28

🛠 Breaking changes

🐛 Bug fixes

  • Fix building errors from use_frameworks! in Podfile. (#14523 by @kudo)

💡 Others

11.1.0 — 2021-09-08

🎉 New features

🐛 Bug fixes

  • fix __dir__ absolute path in script_phase making an inconsistent Podfile.lock. (#13610 by @kudo)
  • Fix PROJECT_ROOT path resolution in get-app-config-ios.sh. (#13439 by @ajsmth)
  • Fix app.config not generated. (#13667 by @kudo)
  • Fix build phase error in xcode for nodejs possibly not found in nvm. (#14047 by @kudo)

⚠️ Notices

  • Modularized expo-constants without further app setup. (#13424 by @kudo)

11.0.2 — 2021-09-02

💡 Others

  • Skip running build scripts during iOS debug builds and add support for SKIP_BUNDLING/FORCE_BUNDLING environment variables. (#14116 by @fson)

11.0.1 — 2021-06-22

This version does not introduce any user-facing changes.

11.0.0 — 2021-06-16

🛠 Breaking changes

🐛 Bug fixes

💡 Others

  • Migrated module interface from unimodules-constants-interface to expo-modules-core. (#12876 by @tsapeta)
  • Build Android code using Java 8 to fix Android instrumented test build error. (#12939 by @kudo)
  • Inherit env vars in get-app-config-android.gradle. (#13208 by @jakub-gonet)

10.1.3 — 2021-04-13

This version does not introduce any user-facing changes.

10.1.2 — 2021-04-09

🛠 Breaking changes

  • Remove the xde property from Constants.manifest. (#12438 by @fson)
  • Update @expo/config to include currentFullName in embedded config manifest. Related PR on expo-cli.

10.1.1 — 2021-03-23

🎉 New features

  • Added new Constants.__unsafeNoWarnManifest property that behaves as Constants.manifest property, but suppresses warning upon no manifest available. (#12237 by @bbarthec)

    Warning: don't use this property, it's introduced for internal use only.

10.1.0 — 2021-03-10

🎉 New features

  • Updated Android build configuration to target Android 11 (added support for Android SDK 30). (#11647 by @bbarthec)
  • Use @expo/config-types package for ExpoConfig type. (#11810 by @EvanBacon)

🐛 Bug fixes

  • Fixed support for Android Gradle plugin 4.1+ (#11926 by @esamelson)
  • Add deprecation messages for previously deprecated Constants fields. (#11960 by @ide)

10.0.1 — 2021-01-25

This version does not introduce any user-facing changes.

10.0.0 — 2021-01-15

🛠 Breaking changes

🎉 New features

  • Add support for new Apple devices to platform.ios.deviceModel. (#11446 by @sjchmiela)
  • Changed Constants.platform.ios.model nullability — it can now be null, if the value cannot be determined. (#11445 by @sjchmiela)

🐛 Bug fixes

  • Removed fbjs dependency (#11396 by @cruzach)
  • Added support for simulators running on Apple ARM64 processors (previously, constants expected to be exported by native code were unavailable). (#11445 by @sjchmiela)

9.3.5 — 2020-12-11

🐛 Bug fixes

  • Add @expo/config to dependencies

9.3.4 — 2020-12-09

🐛 Bug fixes

  • Fixed an issue where Constants.manifest was still undefined in debug Android builds in the bare workflow

9.3.3 — 2020-12-02

This version does not introduce any user-facing changes.

9.3.2 — 2020-12-01

🐛 Bug fixes

  • Fixed the getAppConfig.js script to work with the latest version of @expo/config.

9.3.1 — 2020-11-25

🛠 Breaking changes

  • Fixed installationId being backed up on Android which resulted in multiple devices having the same installationId. (#11005 by @sjchmiela)
  • Deprecated .installationId and .deviceId as these properties can be implemented in user space. Instead, implement the installation identifier on your own using expo-application's .androidId on Android and a storage API like expo-secure-store on iOS and localStorage on Web. (#10997 by @sjchmiela)

9.3.0 — 2020-11-17

🎉 New features

  • Added Constants.executionEnvironment to distinguish between apps running in a bare, managed standalone, or App/Play Store development client environment. (#10986 by @esamelson)
  • Added script to embed app configuration into a bare app and export this object as Constants.manifest. (#10948 and #10949 by @esamelson)
  • If manifest is defined on expo-updates then use it instead of ExponentConstants.manifest (#10668 by @esamelson)
  • Warn when developer attempts to access empty Constants.manifest in bare. Throw error when it is empty in managed. (#11028 by @esamelson)
  • Set Contants.executionEnvironment to ExecutionEnvironment.Bare on web.

9.2.0 — 2020-08-18

This version does not introduce any user-facing changes.

9.1.1 — 2020-05-28

This version does not introduce any user-facing changes.

9.1.0 — 2020-05-27

🐛 Bug fixes