Skip to main content

Runtime Environment Variables

Environment variables provide a way to configure the runtime without needing to redeploy.

VariableDescriptionValues
USER_STORAGE_TABLEName of the DynamoDB tableString value, name of the DynamoDB table
STENTOR_LOG_LEVELConfigurable logging"debug", "info", "warn", "error" (default)
STUDIO_TOKENAccess token to OC StudioGenerated token specific to the APP ID
STUDIO_ORG_TOKENAccess token to OC Studio, which has access to all the apps within an organizationContact customer support for this token
STUDIO_SECRET_NAMEOptional, name of the secret within AWS Secrets Manager to useThe name of the secret, see below for more information
STUDIO_APP_IDThe application ID within studioString
STUDIO_BASE_URLConfigure the Studio Service to point to another environmentDefaults to "https://api.xapp.ai"
STENTOR_LOG_PIIFor development, no redaction of PII (such as phone numbers) will be performedDefaults to "false"
STENTOR_LOG_PII_MASK_PARTIALSimilar to STENTOR_LOG_PII, this instead will only do a partial mask of PIIDefaults to "false"
STUDIO_MAX_HISTORYMax number of items in request history & transcripts to maintainDefaults to 20

Using AWS Secrets Manager

AWS Secrets Manager allows you to securely store API credentials, access tokens, and other sensitive information for use at runtime. This is the recommended approach for production environments as opposed to storing this type of information in environment variables.

If you provide STUDIO_SECRET_NAME as an environment variable, then before every request all the key value based information from the provided secret name will be loaded as environment variables to the runtime and can be access from:

process.env[`NAME_OF_VALUE_IN_SECRET`]
caution

Do not print out this information to the console.

important

Make sure your runtime Lambda has the proper IAM policy to read the secret.