Skip to main content

Environment variables

The Expo Open OTA server requires several environment variables to be set in order to function correctly. These variables are used to configure the server, interact with the Expo API, and manage the server's behavior. You can set these variables in a .env file for local development or in your deployment environment.

Supported Environment Variables

🌍 API Configuration

NameRequiredDescriptionExampleReference
BASE_URLRoot URL of your serverhttps://ota.mysite.comRef

🔑 Authentication & Security

NameRequiredDescriptionExampleReference
JWT_SECRETJWT secret used to sign some endpointsRandom stringRef

📱 Expo Configuration

NameRequiredDescriptionExampleReference
EXPO_APP_IDThe ID of the Expo projectRandom stringRef
EXPO_ACCESS_TOKENExpo access tokenRandom stringRef

📦 Storage Configuration

NameRequiredDescriptionExampleReference
STORAGE_MODElocal or s3localRef
S3_BUCKET_NAME✅ if STORAGE_MODE = s3S3 bucket namemy-bucketRef
LOCAL_BUCKET_BASE_PATH✅ if STORAGE_MODE = localPath to store assets/path/to/assetsRef

🔐 Key store Configuration

NameRequiredDescriptionExampleReference
KEYS_STORAGE_TYPEenvironment, aws-secrets-manager, or localenvironmentRef

AWS Secrets Manager Key Store

NameRequiredDescriptionExampleReference
AWSSM_EXPO_PUBLIC_KEY_SECRET_ID✅ if KEYS_STORAGE_TYPE = aws-secrets-managerExpo public key secret name in AWSmy-expo-public-keyRef
AWSSM_EXPO_PRIVATE_KEY_SECRET_ID✅ if KEYS_STORAGE_TYPE = aws-secrets-managerExpo private key secret name in AWSmy-expo-private-keyRef

Environment-Based Key Store

NameRequiredDescriptionExampleReference
PUBLIC_EXPO_KEY_B64✅ if KEYS_STORAGE_TYPE = environmentBase64-encoded Expo public keyBase64 stringRef
PRIVATE_EXPO_KEY_B64✅ if KEYS_STORAGE_TYPE = environmentBase64-encoded Expo private keyBase64 stringRef

Local Key Store

NameRequiredDescriptionExampleReference
PRIVATE_LOCAL_EXPO_KEY_PATH✅ if KEYS_STORAGE_TYPE = localPath to the Expo private key/path/to/private-key.pemRef
PUBLIC_LOCAL_EXPO_KEY_PATH✅ if KEYS_STORAGE_TYPE = localPath to the Expo public key/path/to/public-key.pemRef

☁️ AWS & CloudFront Configuration

NameRequiredDescriptionExampleReference
AWS_REGION✅ if using aws-secrets-manager or s3AWS Regionus-east-1Ref, Storage
AWS_ACCESS_KEY_ID✅ if using aws-secrets-manager or s3 without IAM rolesAWS Access Key IDACCESSKEYIDRef, Storage
AWS_SECRET_ACCESS_KEY✅ if using aws-secrets-manager or s3 without IAM rolesAWS Secret Access KeySECRETACCESSKEYRef, Storage

CloudFront Settings

NameRequiredDescriptionExampleReference
CLOUDFRONT_DOMAINCloudFront domainhttps://XXX.cloudfront.netRef
CLOUDFRONT_KEY_PAIR_ID✅ if CLOUDFRONT_DOMAIN is setCloudFront key pair IDRandom stringRef
CLOUDFRONT_PRIVATE_KEY_B64✅ if using environment & CLOUDFRONT_DOMAIN is setBase64 CloudFront private keyBase64 stringRef
AWSSM_CLOUDFRONT_PRIVATE_KEY_SECRET_ID✅ if using aws-secrets-manager & CLOUDFRONT_DOMAIN is setCloudFront private key in AWS Secrets Managermy-cloudfront-private-keyRef
PRIVATE_LOCAL_CLOUDFRONT_KEY_PATH✅ if using local & CLOUDFRONT_DOMAIN is setPath to CloudFront private key/path/to/cloudfront-private-key.pemRef