@wireapp/config

March 13, 2026 ยท View on GitHub

Shared configuration library for Wire webapp and server.

Overview

This library contains environment variable type definitions and configuration generators used by both the webapp and server applications. It provides:

  • Env type - Type definition for all environment variables
  • ClientConfig type - Configuration object passed to the webapp client
  • ServerConfig type - Configuration object used by the Node.js server
  • generateClientConfig() - Function to generate client config from environment variables
  • generateServerConfig() - Function to generate server config from environment variables

Installation

This package is part of the workspace and should be installed using workspace protocol:

{
  "dependencies": {
    "@wireapp/config": "workspace:^"
  }
}

Usage

Importing Types

import type {Env, ClientConfig, ServerConfig} from '@wireapp/config';

Generating Configuration

import {generateClientConfig, generateServerConfig} from '@wireapp/config';

// Generate client configuration
const clientConfig = generateClientConfig(
  {version: '1.0.0', env: 'production', urls: {...}},
  env
);

// Generate server configuration
const serverConfig = generateServerConfig(
  {version: '1.0.0', env: 'production', urls: {...}},
  env
);

Environment Variables

The Env type defines all supported environment variables. This section documents environment variables currently used by this library's config generators (src/client.config.ts and src/server.config.ts), including effective default values and purpose.

Configuration sources and priority

Configuration values are resolved from multiple sources. The effective value priority is:

  1. Process environment variables (highest priority)
  • Example: AWS Elastic Beanstalk / container runtime environment variables.
  • dotenv-extended is loaded with includeProcessEnv: true, so process env wins.
  1. .env file
  • Local or deployment-specific overrides checked into the deployment artifact/environment.
  1. .env.defaults file
  • Baseline defaults copied from configuration repositories.
  1. Code-level fallback in generators (lowest priority)
  • Example: MAX_API_VERSION fallback to 13, PORT fallback to 21080.

If FEDERATION is not set, APP_BASE, BACKEND_REST, and BACKEND_WS must resolve to non-empty values (otherwise config generation throws an error).

How configuration repositories are used

  • apps/webapp/app-config/package.json pins configuration repositories and versions.
  • webapp:configure runs copy-config using apps/webapp/.copyconfigrc.js.
  • That step copies repository content into apps/webapp/resource/ and writes repo .env.defaults into workspace root .env.defaults.
  • Configuration selection order in .copyconfigrc.js:
    1. If FORCED_CONFIG_URL is set, that URL is used directly.
    2. Otherwise, if DISTRIBUTION is set (and not wire), it selects dependency key wire-web-config-default-${DISTRIBUTION}.
    3. Otherwise, if the current commit tag contains staging or production, it selects master.
    4. Otherwise, it selects staging.
    5. The selected key is resolved via apps/webapp/app-config/package.json dependencies to get the final repository URL.

What "additional conditions" means

  • Additional Conditions indicates whether runtime/platform/backend constraints may still keep a feature effectively disabled even when the environment variable is enabled.
  • This column is informational and separate from value priority.
  • For non-feature rows, this is usually N/A.

Where default values come from

  • Primary source: configuration repositories (pinned in apps/webapp/app-config/package.json) provide baseline values via their .env.defaults.
  • During webapp:configure, the selected config repository is copied and its .env.defaults is written to workspace root .env.defaults.
  • At runtime/build time, values are loaded with this priority: process env > .env > .env.defaults > code fallback.
  • Code fallbacks are defined in config generators for specific variables only (for example MAX_API_VERSION = 13, PORT = 21080).
  • So, defaults are mostly from config repositories; webapp/server code provides fallback defaults only for a smaller subset.

Notes:

  • Defaults below are based on generator behavior in src/client.config.ts and src/server.config.ts.
  • Where an environment variable is read directly without fallback logic, the value is expected to come from deployment env files (for example .env.defaults/.env).
  • From .env.defaults means the value is expected from environment files and is present in repository defaults.
  • No default in .env.defaults means the value must be provided per deployment/environment.
  • Additional Conditions is about runtime gating, not environment value precedence.

Core / Server

Environment VariableDefault / SourceUsed forAdditional Conditions
PORT21080 when empty/invalid/0HTTP server portN/A
ENFORCE_HTTPStrue (unless explicitly false)Enforce HTTPS redirects/behavior in server configN/A
SSL_CERTIFICATE_KEY_PATHcertificate/development-key.pem (workspace or apps/server/dist)TLS private key pathN/A
SSL_CERTIFICATE_PATHcertificate/development-cert.pem (workspace or apps/server/dist)TLS certificate pathN/A
ENABLE_DYNAMIC_HOSTNAMEfalseReplace {{hostname}} placeholders in URLs with client hostnameN/A
ENABLE_CLIENT_VERSION_ENFORCEMENTfalseEnforce exact deployed client version matching for incident-driven force reloadsN/A
APP_NAMEWireApp name shown in client configN/A
ANALYTICS_API_KEYFrom .env.defaultsTracking API key exposed to client configN/A
BACKEND_NAMEFrom .env.defaultsBackend display name in client configN/A
BRAND_NAMEFrom .env.defaultsBrand name in client configN/A
WEBSITE_LABELFrom .env.defaultsLabel for website links in client configN/A
ENABLE_DEV_BACKEND_APIfalseAllow development API usage in clientN/A
MAX_API_VERSION13Max backend API version accepted by clientN/A
GOOGLE_WEBMASTER_IDFrom .env.defaultsVerification id in server-rendered metadataN/A
OPEN_GRAPH_DESCRIPTIONFrom .env.defaultsOpenGraph description meta tagN/A
OPEN_GRAPH_IMAGE_URLFrom .env.defaultsOpenGraph image URL meta tagN/A
OPEN_GRAPH_TITLEFrom .env.defaultsOpenGraph title meta tagN/A

Feature toggles

Environment VariableDefault / SourceUsed forAdditional Conditions
FEATURE_ENABLE_CELLSfalseEnables Cells integration featuresMay apply (requires conversation Cells state not disabled)
FEATURE_CELLS_INIT_WITH_ZAUTH_TOKENfalseInitialize Cells with ZAuth tokenN/A
FEATURE_ALLOW_LINK_PREVIEWSfalseEnables link preview renderingMay apply (also requires user preview preference enabled)
FEATURE_CHECK_CONSENTtrueUser consent checksN/A
FEATURE_CONFERENCE_AUTO_MUTEfalseAuto-mute when joining callsMay apply (conference calls only)
FEATURE_DEFAULT_LOGIN_TEMPORARY_CLIENTfalsePreselect temporary client on loginN/A
FEATURE_ENABLE_ACCOUNT_REGISTRATIONtrueAccount registration availabilityN/A
FEATURE_ENABLE_ADVANCED_FILTERSfalseAdvanced filters UI featureN/A
FEATURE_ENABLE_AUTO_LOGINfalseAuto-login supportN/A
FEATURE_ENABLE_BLUR_BACKGROUNDfalseBackground blur in video callsMay apply (requires MediaPipe/WebGL processing path)
FEATURE_ENABLE_CHANNELSfalseChannels featureMay apply (requires backend/team feature gating)
FEATURE_ENABLE_CHANNELS_HISTORY_SHARINGfalseChannels history sharingMay apply (channel context + channels gating)
FEATURE_ENABLE_CROSS_PLATFORM_BACKUP_EXPORTfalseCross-platform backup exportN/A
FEATURE_ENABLE_DEBUGfalseDebug mode toggles in client/server (also relaxes CSP connect-src in server)N/A
FEATURE_ENABLE_DETACHED_CALLING_WINDOWfalsePop-out calling windowMay apply (desktop support flag required)
FEATURE_ENABLE_DOMAIN_DISCOVERYtrueDomain discovery in login/auth flowsN/A
FEATURE_ENABLE_ENCRYPTION_AT_RESTfalseEncryption-at-rest client behavior switchN/A
FEATURE_ENABLE_ENFORCE_DESKTOP_APPLICATION_ONLYfalseRestrict web usage to desktop-app contextMay apply (applies on non-desktop runtime)
FEATURE_ENABLE_EXTRA_CLIENT_ENTROPYfalseExtra entropy during client creationMay apply (effective on Windows, or when FORCE_EXTRA_CLIENT_ENTROPY is enabled)
FEATURE_ENABLE_IN_CALL_HAND_RAISEfalseIn-call hand raise featureMay apply (visible in calls, except 1:1 conversations)
FEATURE_ENABLE_IN_CALL_REACTIONSfalseIn-call reactions featureN/A
FEATURE_ENABLE_MEDIA_EMBEDStrueMedia embeds (YouTube/Vimeo/Spotify/etc.)May apply (also requires user preview setting enabled)
FEATURE_ENABLE_MESSAGE_FORMAT_BUTTONSfalseRich text formatting controlsMay apply (format button also depends on markdown-preview preference)
FEATURE_ENABLE_PING_CONFIRMATIONfalseConfirm modal before pinging large groupsMay apply (confirmation shown only for non-1:1 conversations with participant count at/above threshold)
FEATURE_ENABLE_PRESS_SPACE_TO_UNMUTEfalsePress-space-to-unmute behaviorMay apply (also requires user call preference enabled)
FEATURE_ENABLE_PROTEUS_CORE_CRYPTOfalseEnable Proteus core-crypto integration pathN/A
FEATURE_ENABLE_PUBLIC_CHANNELSfalsePublic channels featureMay apply (requires public-channel permission/role gating)
FEATURE_ENABLE_REMOVE_GROUP_CONVERSATIONfalseRemove conversation locallyMay apply (only for group/channel conversations where self user is already removed)
FEATURE_ENABLE_SCREEN_SHARE_WITH_VIDEOfalseScreen sharing with video overlayMay apply (requires both screen-share and camera streams to be available)
FEATURE_ENABLE_SSOfalseSSO login flowN/A
FEATURE_ENABLE_TEAM_CREATIONfalseTeam creation flow for individual usersMay apply (requires backend API version support and user not already in a team)
FEATURE_ENABLE_VIRTUALIZED_MESSAGES_LISTfalseVirtualized message list renderingN/A
FEATURE_ENFORCE_CONSTANT_BITRATEfalseConstant bitrate call encodingMay apply (enforced for all calls; practical impact is where VBR would otherwise be available, typically 1:1)
FEATURE_FORCE_EXTRA_CLIENT_ENTROPYfalseAdditional entropy safeguards for client creationMay apply (only affects behavior when ENABLE_EXTRA_CLIENT_ENTROPY is enabled; otherwise has no effect)
FEATURE_SHOW_LOADING_INFORMATIONfalseExtra loading-state information in UIMay apply (only visible while processing pending notifications during sync/loading)
FEATURE_USE_CORE_CRYPTOfalseEnable MLS/core-crypto protocol pathN/A

Numeric and limits

Environment VariableDefault / SourceUsed forAdditional Conditions
FEATURE_APPLOCK_SCHEDULED_TIMEOUTnullScheduled app lock timeout (seconds)N/A
FEATURE_MAX_USERS_TO_PING_WITHOUT_ALERT4Ping confirmation thresholdN/A
FEATURE_MLS_CONFIG_KEYING_MATERIAL_UPDATE_THRESHOLDundefinedMLS keying material update threshold (numeric value)N/A
MAX_GROUP_PARTICIPANTS500Group conversation participant capN/A
MAX_CHANNEL_PARTICIPANTS2000Channel participant capN/A
MAX_VIDEO_PARTICIPANTS4Legacy video call participant capN/A
NEW_PASSWORD_MINIMUM_LENGTH8Minimum password lengthN/A

Cells

Environment VariableDefault / SourceUsed forAdditional Conditions
CELLS_TOKEN_SHARED_SECRETNo default in .env.defaultsShared secret for Cells token logicN/A
CELLS_PYDIO_SEGMENTNo default in .env.defaultsCells/Pydio segment configN/A
CELLS_PYDIO_URLNo default in .env.defaultsCells/Pydio base URLN/A
CELLS_S3_BUCKETNo default in .env.defaultsCells S3 bucketN/A
CELLS_S3_REGIONNo default in .env.defaultsCells S3 regionN/A
CELLS_S3_ENDPOINTNo default in .env.defaultsCells S3 endpointN/A
CELLS_WIRE_DOMAINNo default in .env.defaultsCells Wire domain mappingN/A

Telemetry

Environment VariableDefault / SourceUsed forAdditional Conditions
COUNTLY_API_KEYFrom .env.defaultsCountly API keyN/A
COUNTLY_ENABLE_LOGGINGfalseEnable Countly debug loggingN/A
COUNTLY_FORCE_REPORTINGfalseForce Countly reporting on internal environmentsN/A
COUNTLY_ALLOWED_BACKENDempty string ('')Backend allow-list for Countly trackingN/A
DATADOG_APPLICATION_IDundefinedDatadog RUM application idN/A
DATADOG_CLIENT_TOKENundefinedDatadog RUM client tokenN/A
FEATURE_DATADOG_ENVIRONMENTundefinedDatadog environment label in feature configN/A

Uploads and security policy

Environment VariableDefault / SourceUsed forAdditional Conditions
FEATURE_ALLOWED_FILE_UPLOAD_EXTENSIONS*Allowed file upload extensionsN/A
CSP_EXTRA_CONNECT_SRCempty listAdditional connect-src CSP entriesN/A
CSP_EXTRA_DEFAULT_SRCempty listAdditional default-src CSP entriesN/A
CSP_EXTRA_FONT_SRCempty listAdditional font-src CSP entriesN/A
CSP_EXTRA_FRAME_SRCempty listAdditional frame-src CSP entriesN/A
CSP_EXTRA_IMG_SRCempty listAdditional img-src CSP entriesN/A
CSP_EXTRA_MANIFEST_SRCempty listAdditional manifest-src CSP entriesN/A
CSP_EXTRA_MEDIA_SRCempty listAdditional media-src CSP entriesN/A
CSP_EXTRA_OBJECT_SRCempty list (server falls back to object-src 'none')Additional object-src CSP entriesN/A
CSP_EXTRA_SCRIPT_SRCempty listAdditional script-src CSP entriesN/A
CSP_EXTRA_STYLE_SRCempty listAdditional style-src CSP entriesN/A
CSP_EXTRA_WORKER_SRCempty listAdditional worker-src CSP entriesN/A

URL configuration

Environment VariableDefault / SourceUsed forAdditional Conditions
URL_ACCOUNT_BASEFrom .env.defaultsAccount service base URLN/A
URL_MOBILE_BASENo default in .env.defaultsMobile client base URLN/A
URL_PRIVACY_POLICYFrom .env.defaultsPrivacy policy URLN/A
URL_TEAMS_BASEFrom .env.defaultsTeams settings base URLN/A
URL_TEAMS_BILLINGFrom .env.defaultsTeams billing URLN/A
URL_PRICINGFrom .env.defaultsPricing page URLN/A
URL_TEAMS_CREATEFrom .env.defaultsTeam creation URLN/A
URL_TERMS_OF_USE_PERSONALFrom .env.defaultsPersonal terms URLN/A
URL_TERMS_OF_USE_TEAMSFrom .env.defaultsTeams terms URLN/A
URL_WEBSITE_BASEFrom .env.defaultsWebsite base URLN/A
URL_WHATS_NEWFrom .env.defaultsWhat's new page URLN/A
URL_PATH_CREATE_TEAMFrom .env.defaultsPath segment to create teamN/A
URL_PATH_MANAGE_SERVICESFrom .env.defaultsPath segment to manage servicesN/A
URL_PATH_MANAGE_TEAMFrom .env.defaultsPath segment to manage teamN/A
URL_PATH_PASSWORD_RESETFrom .env.defaultsPath segment for password resetN/A
URL_SUPPORT_INDEXFrom .env.defaultsSupport index page URLN/A
URL_SUPPORT_FOLDERSFrom .env.defaultsSupport folders/help URLN/A
URL_SUPPORT_BUG_REPORTFrom .env.defaultsBug report help URLN/A
URL_SUPPORT_CALLINGFrom .env.defaultsCalling support URLN/A
URL_SUPPORT_CAMERA_ACCESS_DENIEDFrom .env.defaultsCamera permission denied help URLN/A
URL_SUPPORT_CONTACTFrom .env.defaultsContact support URLN/A
URL_SUPPORT_DEVICE_ACCESS_DENIEDFrom .env.defaultsDevice access denied help URLN/A
URL_SUPPORT_DEVICE_NOT_FOUNDFrom .env.defaultsDevice not found help URLN/A
URL_SUPPORT_EMAIL_EXISTSFrom .env.defaultsEmail exists help URLN/A
URL_SUPPORT_HISTORYFrom .env.defaultsConversation history help URLN/A
URL_SUPPORT_LEGAL_HOLD_BLOCKFrom .env.defaultsLegal hold block help URLN/A
URL_SUPPORT_MLS_LEARN_MOREFrom .env.defaultsMLS learn more URLN/A
URL_SUPPORT_MLS_MIGRATION_FROM_PROTEUSFrom .env.defaultsMLS migration support URLN/A
URL_SUPPORT_MICROPHONE_ACCESS_DENIEDFrom .env.defaultsMicrophone permission denied help URLN/A
URL_SUPPORT_PRIVACY_VERIFY_FINGERPRINTFrom .env.defaultsPrivacy/fingerprint verification help URLN/A
URL_SUPPORT_SCREEN_ACCESS_DENIEDFrom .env.defaultsScreen access denied help URLN/A
URL_SUPPORT_SYSTEM_KEYCHAIN_ACCESSNo default in .env.defaultsSystem keychain access help URLN/A
URL_SUPPORT_E2E_ENCRYPTIONFrom .env.defaultsEnd-to-end encryption help URLN/A
URL_SUPPORT_FAVORITESFrom .env.defaultsFavorites help URLN/A
URL_LEARN_MORE_ABOUT_GUEST_LINKSNo default in .env.defaultsGuest links learn-more URLN/A
URL_SUPPORT_NON_FEDERATING_INFOFrom .env.defaultsNon-federating info URLN/A
URL_SUPPORT_OAUTH_LEARN_MOREFrom .env.defaultsOAuth learn-more URLN/A
URL_SUPPORT_OFFLINE_BACKENDFrom .env.defaultsOffline backend support URLN/A
URL_SUPPORT_FEDERATION_STOPNo default in .env.defaultsFederation stop support URLN/A
URL_SUPPORT_E2EI_VERIFICATIONFrom .env.defaultsE2EI verification support URLN/A
URL_SUPPORT_E2EI_VERIFICATION_CERTIFICATEFrom .env.defaultsE2EI verification certificate support URLN/A
URL_SUPPORT_DECRYPT_ERRORFrom .env.defaultsDecryption error support URLN/A
URL_SUPPORT_PRIVACY_UNVERIFIED_USERSFrom .env.defaultsPrivacy unverified users support URLN/A
URL_SUPPORT_PRIVACY_WHYFrom .env.defaultsPrivacy explanation support URLN/A
URL_SUPPORT_CHANGE_EMAIL_ADDRESSFrom .env.defaultsChange email support URLN/A
URL_SUPPORT_DELETE_PERSONAL_ACCOUNTFrom .env.defaultsDelete personal account support URLN/A
URL_SUPPORT_REMOVE_TEAM_MEMBERFrom .env.defaultsRemove team member support URLN/A

Development

Build

nx run config-lib:build

Type Check

nx run config-lib:type-check

Lint

nx run config-lib:lint

License

GPL-3.0