Constants
@symbiote-native/constants wraps
expo-constants and keeps its
native fields: session ID, status bar height, system fonts, linking URI, execution environment,
device name and year class, the platform block and the WebView user agent. Every field is a plain
value resolved once, so all five adapters re-export the same Constants object.
| OS platform | Support |
|---|---|
| iOS | live |
| Android | live |
Installation
Section titled “Installation”pnpm add @symbiote-native/constantsScaffolding or extending an app? npx @symbiote-native/cli new --constants (or add --constants)
installs and wires it. expo-constants and expo-modules-core come along as pinned dependencies,
never install either yourself and never add the expo meta-package.
import { Constants, ExecutionEnvironment } from '@symbiote-native/constants';
const isBare = Constants.executionEnvironment === ExecutionEnvironment.Bare;const sessionId = Constants.sessionId;const userAgent = await Constants.getWebViewUserAgentAsync();The import path is the same on every adapter: @symbiote-native/constants, or the
/react, /vue, /svelte, /solid and /angular entries.
Not ported
Section titled “Not ported”Common questions
Section titled “Common questions”- Where is
Constants.expoConfig? Not ported: there is no Expo manifest here, so read build-time values from your own config, inlined by your Babel or Metro setup. Constants.manifestisnull. Upstream deprecated it in favor ofexpoConfig; it is not available here either.- Where is
installationId? Deprecated upstream. Use@symbiote-native/application’s Android ID on Android and@symbiote-native/secure-storefor a stored id on iOS. makeRedirectUrineeds a scheme. Passschemeexplicitly, since auto-detection readsexpoConfig.
Sources: Expo docs: Constants, expo/expo#44527, Constants manifests and config.