Skip to main content

Node Environment Variables

This is the consolidated reference for node environment variables used by node-core.

Prefix Configuration

The default environment variable prefix is TWIN_, so variables look like TWIN_PORT and TWIN_ENTITY_STORAGE_CONNECTOR_TYPE.

The prefix is configurable for custom node implementations:

  • Set envPrefix in node options when calling run(...).
  • Or pass the CLI option --env-prefix <PREFIX>.

When you change the prefix, all variables in this document use your custom prefix instead of TWIN_.

Core Runtime Variables

VariablePossible ValuesDefaultNotes
TWIN_DEBUGtrue, falsefalseEnables engine debug mode.
TWIN_SILENTtrue, falsefalseSuppresses console output.
TWIN_STORAGE_FILE_ROOTFile system pathNoneRoot directory for file-based state and storage.
TWIN_STATE_FILENAMEFile name or pathengine-state.json (when storage root is set)State file used by node state storage.
TWIN_NODE_IDENTITY_ENABLEDtrue, falsetrueEnables node context identity flow.
TWIN_TENANT_ENABLEDtrue, falsefalseEnables tenant-scoped flow.
TWIN_EXTENSIONSComma-separated module listNoneExtension modules to load. Supports local, npm:, and https: entries.

Connector and Component Selection Variables

VariablePossible ValuesDefaultNotes
TWIN_ENTITY_STORAGE_CONNECTOR_TYPEfile, memory, aws-dynamodb, azure-cosmosdb, gcp-firestoredb, scylladb, mysql, mongodb, postgresqlNoneComma-separated list allowed.
TWIN_ENTITY_STORAGE_CONNECTOR_DEFAULTAny configured entity storage typeFirst configured typeDefault entity storage connector.
TWIN_BLOB_STORAGE_CONNECTOR_TYPEmemory, file, ipfs, aws-s3, azure-storage, gcp-storageNoneComma-separated list allowed.
TWIN_BLOB_STORAGE_CONNECTOR_DEFAULTAny configured blob storage typeFirst configured typeDefault blob storage connector.
TWIN_BLOB_STORAGE_CONNECTOR_PUBLICAny configured blob storage typeNoneMarks the public blob connector feature.
TWIN_VAULT_CONNECTORentity-storage, hashicorpNoneSelects vault backend.
TWIN_LOGGING_CONNECTORconsole, entity-storageNoneComma-separated list allowed.
TWIN_EVENT_BUS_CONNECTORlocalNoneSelects event bus connector.
TWIN_EVENT_BUS_COMPONENTserviceNoneSelects event bus component implementation.
TWIN_MESSAGING_EMAIL_CONNECTORentity-storage, awsNoneMessaging email connector type.
TWIN_MESSAGING_SMS_CONNECTORentity-storage, awsNoneMessaging SMS connector type.
TWIN_MESSAGING_PUSH_NOTIFICATION_CONNECTORentity-storage, awsNoneMessaging push connector type.
TWIN_TELEMETRY_CONNECTORentity-storageNoneTelemetry connector type.
TWIN_FAUCET_CONNECTORentity-storage, iotaNoneFaucet connector type.
TWIN_WALLET_CONNECTORentity-storage, iotaNoneWallet connector type.
TWIN_NFT_CONNECTORentity-storage, iotaNoneNFT connector type.
TWIN_IDENTITY_CONNECTORentity-storage, iotaNoneIdentity connector type.
TWIN_IDENTITY_RESOLVER_CONNECTORentity-storage, iotaNoneIdentity resolver connector type.
TWIN_IDENTITY_PROFILE_CONNECTORentity-storageNoneIdentity profile connector type.
TWIN_VERIFIABLE_STORAGE_CONNECTORentity-storage, iotaNoneVerifiable storage connector type.
TWIN_ATTESTATION_CONNECTORentity-storage, iotaNoneAttestation connector type.
TWIN_DATA_CONVERTER_CONNECTORSjson, xmlNoneComma-separated list allowed.
TWIN_DATA_EXTRACTOR_CONNECTORSjson-pathNoneComma-separated list allowed.

Feature Toggle and Behaviour Variables

VariablePossible ValuesDefaultNotes
TWIN_MESSAGING_ENABLEDtrue, falsefalseEnables messaging components.
TWIN_DATA_PROCESSING_ENABLEDtrue, falsefalseEnables data processing.
TWIN_AUDITABLE_ITEM_GRAPH_ENABLEDtrue, falsefalseEnables auditable item graph.
TWIN_AUDITABLE_ITEM_STREAM_ENABLEDtrue, falsefalseEnables auditable item stream.
TWIN_DOCUMENT_MANAGEMENT_ENABLEDtrue, falsefalseEnables document management.
TWIN_SYNCHRONISED_STORAGE_ENABLEDtrue, falsefalseEnables synchronised storage.
TWIN_FEDERATED_CATALOGUE_ENABLEDtrue, falsefalseEnables federated catalogue.
TWIN_TRUST_ENABLEDtrue, falsefalseEnables trust features.
TWIN_RIGHTS_MANAGEMENT_ENABLEDtrue, falsefalseEnables rights management.
TWIN_BACKGROUND_TASKS_ENABLEDtrue, falsefalseEnables background tasks.
TWIN_TASK_SCHEDULER_ENABLEDtrue, falsefalseEnables task scheduler.
TWIN_DATASPACE_ENABLEDtrue, falsefalseEnables dataspace features.
TWIN_BLOB_STORAGE_ENABLE_ENCRYPTIONtrue, falsefalseEnables blob encryption in blob storage component flow.
TWIN_IDENTITY_WALLET_ADDRESS_INDEXInteger0Wallet address index used by identity workflows.
TWIN_TRUST_JWT_TTL_SECONDSInteger secondsNoneLeave unset for non-expiring JWT generation.
TWIN_SYNCHRONISED_STORAGE_ENTITY_UPDATE_INTERVAL_MINUTESInteger minutes5Polling interval for synchronised updates.
TWIN_SYNCHRONISED_STORAGE_CONSOLIDATION_INTERVAL_MINUTESInteger minutes60Trusted-node consolidation interval.
TWIN_SYNCHRONISED_STORAGE_CONSOLIDATION_BATCH_SIZEInteger1000Trusted-node consolidation batch size.
TWIN_SYNCHRONISED_STORAGE_MAX_CONSOLIDATIONSInteger5Number of consolidations retained.
TWIN_DATASPACE_RETAIN_ACTIVITY_LOGS_FORInteger minutes, -110Dataspace activity retention period.
TWIN_DATASPACE_ACTIVITY_LOGS_CLEAN_UP_INTERVALInteger minutes60Dataspace clean-up interval.

Server and API Variables

VariablePossible ValuesDefaultNotes
TWIN_PORTInteger3000 (web server fallback)API server port.
TWIN_HOSTHost name or IPlocalhost (web server fallback)API server host.
TWIN_PUBLIC_ORIGINURLNonePublic API origin, for example https://api.example.com:443.
TWIN_CORS_ORIGINSComma-separated origins* (if not set by runtime config)CORS allow list.
TWIN_HTTP_METHODSComma-separated HTTP methodsGET,POST,PUT,DELETE,OPTIONSCORS methods.
TWIN_HTTP_ALLOWED_HEADERSComma-separated headersRuntime dependentCORS allowed headers.
TWIN_HTTP_EXPOSED_HEADERSComma-separated headersRuntime dependentCORS exposed headers.
TWIN_AUTH_ADMIN_PROCESSOR_TYPEentity-storageNoneAuthentication admin processor type.
TWIN_AUTH_PROCESSOR_TYPEentity-storageNoneAuthentication processor type.
TWIN_AUTH_SIGNING_KEY_IDVault key identifierauth-signingKey used for auth signing operations.
TWIN_MIME_TYPE_PROCESSORSComma-separated processor typesNoneAdditional MIME processor registrations.
TWIN_ROUTE_LOGGING_INCLUDE_BODYtrue, falseUses debug valueIncludes body in route logging.
TWIN_ROUTE_LOGGING_FULL_BASE64true, falsefalseIncludes full base64 payloads in route logging.
TWIN_ROUTE_LOGGING_OBFUSCATE_PROPERTIESComma-separated property namesNoneProperties to obfuscate in route logs.

Extension Module Loading Variables

VariablePossible ValuesDefaultNotes
TWIN_EXTENSIONS_MAX_SIZE_MBInteger MB10Maximum HTTPS extension download size.
TWIN_EXTENSIONS_CLEAR_CACHEtrue, falsefalseClears extension cache on startup.
TWIN_EXTENSIONS_CACHE_DIRECTORYRelative or absolute path.tmpRoot cache directory for extension modules.
TWIN_EXTENSIONS_CACHE_TTL_HOURSInteger hours24HTTPS extension cache TTL.
TWIN_EXTENSIONS_FORCE_REFRESHtrue, falsefalseForces extension cache refresh.

Provider and Backend Variables

VariablePossible ValuesDefaultNotes
TWIN_ENTITY_STORAGE_TABLE_PREFIXStringNonePrefix for entity-storage tables.
TWIN_BLOB_STORAGE_PREFIXStringNonePrefix for blob paths/keys.
TWIN_BLOB_STORAGE_ENCRYPTION_KEY_IDVault key identifierblob-encryptionBlob encryption key identifier.
TWIN_VAULT_PREFIXStringNonePrefix prepended to vault entries.
TWIN_HASHICORP_VAULT_TOKENToken stringNoneHashiCorp Vault token.
TWIN_HASHICORP_VAULT_ENDPOINTURLNoneHashiCorp Vault endpoint.
TWIN_AWS_DYNAMODB_AUTH_MODEcredentials, podNoneDynamoDB auth mode.
TWIN_AWS_DYNAMODB_ACCESS_KEY_IDStringNoneDynamoDB access key id.
TWIN_AWS_DYNAMODB_SECRET_ACCESS_KEYStringNoneDynamoDB secret key.
TWIN_AWS_DYNAMODB_REGIONRegion stringNoneDynamoDB region.
TWIN_AWS_DYNAMODB_ENDPOINTURLNoneDynamoDB endpoint.
TWIN_AWS_DYNAMODB_CONNECTION_TIMEOUT_MSInteger msNoneDynamoDB timeout.
TWIN_AZURE_COSMOSDB_ENDPOINTURLNoneCosmos DB endpoint.
TWIN_AZURE_COSMOSDB_KEYStringNoneCosmos DB key.
TWIN_AZURE_COSMOSDB_DATABASE_IDStringNoneCosmos DB database id.
TWIN_AZURE_COSMOSDB_CONTAINER_IDStringNoneCosmos DB container id.
TWIN_GCP_FIRESTORE_PROJECT_IDStringNoneFirestore project id.
TWIN_GCP_FIRESTORE_CREDENTIALSString or @json: file expansionNoneFirestore credentials.
TWIN_GCP_FIRESTORE_DATABASE_IDStringNoneFirestore database id.
TWIN_GCP_FIRESTORE_COLLECTION_NAMEStringNoneFirestore collection name.
TWIN_GCP_FIRESTORE_API_ENDPOINTURLNoneFirestore API endpoint.
TWIN_SCYLLADB_HOSTSComma-separated hostsNoneScylla hosts list.
TWIN_SCYLLADB_LOCAL_DATA_CENTERStringNoneScylla local data centre.
TWIN_SCYLLADB_KEYSPACEStringNoneScylla keyspace.
TWIN_SCYLLADB_PORTIntegerNoneScylla port.
TWIN_MY_SQL_HOSTStringNoneMySQL host.
TWIN_MY_SQL_PORTIntegerNoneMySQL port.
TWIN_MY_SQL_USERStringNoneMySQL user.
TWIN_MY_SQL_PASSWORDStringNoneMySQL password.
TWIN_MY_SQL_DATABASEStringNoneMySQL database.
TWIN_MONGO_DB_HOSTStringNoneMongoDB host.
TWIN_MONGO_DB_PORTIntegerNoneMongoDB port.
TWIN_MONGO_DB_USERStringNoneMongoDB user.
TWIN_MONGO_DB_PASSWORDStringNoneMongoDB password.
TWIN_MONGO_DB_DATABASEStringNoneMongoDB database.
TWIN_POSTGRE_SQL_HOSTStringNonePostgreSQL host.
TWIN_POSTGRE_SQL_PORTIntegerNonePostgreSQL port.
TWIN_POSTGRE_SQL_USERStringNonePostgreSQL user.
TWIN_POSTGRE_SQL_PASSWORDStringNonePostgreSQL password.
TWIN_POSTGRE_SQL_DATABASEStringNonePostgreSQL database.
TWIN_IPFS_API_URLURLNoneIPFS API URL.
TWIN_IPFS_BEARER_TOKENStringNoneIPFS bearer token.
TWIN_AWS_S3_AUTH_MODEcredentials, podcredentialsAWS S3 auth mode.
TWIN_AWS_S3_ACCESS_KEY_IDStringNoneAWS S3 access key id.
TWIN_AWS_S3_SECRET_ACCESS_KEYStringNoneAWS S3 secret key.
TWIN_AWS_S3_REGIONRegion stringNoneAWS S3 region.
TWIN_AWS_S3_BUCKET_NAMEStringNoneAWS S3 bucket name.
TWIN_AWS_S3_ENDPOINTURLNoneAWS S3 endpoint.
TWIN_AZURE_STORAGE_ACCOUNT_NAMEStringNoneAzure Storage account name.
TWIN_AZURE_STORAGE_ACCOUNT_KEYStringNoneAzure Storage account key.
TWIN_AZURE_STORAGE_CONTAINER_NAMEStringNoneAzure Storage container name.
TWIN_AZURE_STORAGE_ENDPOINTURLNoneAzure Storage endpoint.
TWIN_GCP_STORAGE_PROJECT_IDStringNoneGCP Storage project id.
TWIN_GCP_STORAGE_CREDENTIALSString or @json: file expansionNoneGCP Storage credentials.
TWIN_GCP_STORAGE_BUCKET_NAMEStringNoneGCP Storage bucket name.
TWIN_GCP_STORAGE_ENDPOINTURLNoneGCP Storage endpoint.
TWIN_AWS_SES_AUTH_MODEcredentials, podcredentialsAWS SES auth mode.
TWIN_AWS_SES_ACCESS_KEY_IDStringNoneAWS SES access key id.
TWIN_AWS_SES_SECRET_ACCESS_KEYStringNoneAWS SES secret key.
TWIN_AWS_SES_REGIONRegion stringNoneAWS SES region.
TWIN_AWS_SES_ENDPOINTURLNoneAWS SES endpoint.
TWIN_AWS_MESSAGING_PUSH_NOTIFICATION_APPLICATIONSJSON string or @json: file expansionNonePush notification application definitions.
TWIN_IOTA_NODE_ENDPOINTURLNoneIOTA node endpoint.
TWIN_IOTA_FAUCET_ENDPOINTURLNoneIOTA faucet endpoint.
TWIN_IOTA_NETWORKNetwork nameNoneIOTA network identifier.
TWIN_IOTA_COIN_TYPEIntegerNoneIOTA coin type.
TWIN_IOTA_EXPLORER_ENDPOINTURLNoneIOTA explorer endpoint.
TWIN_IOTA_GAS_STATION_ENDPOINTURLNoneIOTA gas station endpoint.
TWIN_IOTA_GAS_STATION_AUTH_TOKENStringNoneIOTA gas station auth token.
TWIN_UNIVERSAL_RESOLVER_ENDPOINTURLNoneUniversal resolver endpoint.
TWIN_ATTESTATION_VERIFICATION_METHOD_IDMethod id stringattestation-assertionDefault injected by node defaults.
TWIN_IMMUTABLE_PROOF_VERIFICATION_METHOD_IDMethod id stringimmutable-proof-assertionDefault injected by node defaults.
TWIN_TRUST_VERIFICATION_METHOD_IDMethod id stringtrust-assertionDefault injected by node defaults.
TWIN_DATASPACE_DATA_PLANE_PATHPathNoneDataspace PULL transfer path (path only).
TWIN_FEDERATED_CATALOGUE_FILTERSComma-separated filtersNoneFederated catalogue filters.
TWIN_TRUST_GENERATORSComma-separated generator typesNoneTrust generator registrations.
TWIN_TRUST_VERIFIERSComma-separated verifier typesNoneTrust verifier registrations.
TWIN_RIGHTS_MANAGEMENT_CALLBACK_PATHPathNoneCallback path used by rights management.
TWIN_RIGHTS_MANAGEMENT_POLICY_INFORMATION_SOURCESComma-separated typesNoneRights policy information source registrations.
TWIN_RIGHTS_MANAGEMENT_POLICY_NEGOTIATORSComma-separated typesNoneRights policy negotiator registrations.
TWIN_RIGHTS_MANAGEMENT_POLICY_REQUESTERSComma-separated typesNoneRights policy requester registrations.
TWIN_RIGHTS_MANAGEMENT_POLICY_EXECUTION_ACTIONSComma-separated typesNoneRights policy execution action registrations.
TWIN_RIGHTS_MANAGEMENT_POLICY_ENFORCEMENT_PROCESSORSComma-separated typesNoneRights policy enforcement processor registrations.
TWIN_RIGHTS_MANAGEMENT_POLICY_ARBITERSComma-separated typesNoneRights policy arbiter registrations.
TWIN_RIGHTS_MANAGEMENT_POLICY_OBLIGATION_ENFORCERSComma-separated typesNoneRights policy obligation enforcer registrations.
TWIN_SYNCHRONISED_STORAGE_TRUSTED_URLURLNoneTrusted synchronised storage node URL.
TWIN_SYNCHRONISED_STORAGE_VERIFIABLE_STORAGE_KEY_IDStringNoneKey id for synchronised verifiable storage pointers.
TWIN_SYNCHRONISED_STORAGE_BLOB_STORAGE_ENCRYPTION_KEY_IDVault key identifiersynchronised-storage-blob-encryptionEncryption key id for synchronised blobs.
TWIN_SYNCHRONISED_STORAGE_BLOB_STORAGE_KEYBase64 key valueNoneSymmetric key used for synchronised blob encryption.