Environment Variables
Environment Variables
Section titled “Environment Variables”Evolution API Lite is configured through environment variables defined in your .env file. This guide provides a comprehensive overview of all available configuration options, organized by category.
Server Configuration
Section titled “Server Configuration”Basic Server Settings
Section titled “Basic Server Settings”| Variable | Type | Default | Description |
|---|---|---|---|
| SERVER_TYPE | http | https | http | Protocol type for the server |
| SERVER_PORT | number | 8080 | Port number where the server will listen |
| SERVER_URL | string | http://localhost:8080 | Full URL where your application is accessible |
CORS Configuration
Section titled “CORS Configuration”| Variable | Type | Default | Description |
|---|---|---|---|
| CORS_ORIGIN | string | * | Allowed origins for CORS. Use * for all or comma-separated domains |
| CORS_METHODS | string | GET,POST,PUT,DELETE | Allowed HTTP methods for CORS |
| CORS_CREDENTIALS | boolean | true | Whether to allow credentials in CORS requests |
SERVER_TYPE=httpSERVER_PORT=8080SERVER_URL=http://localhost:8080CORS_ORIGIN=*SERVER_TYPE=httpsSERVER_PORT=443SERVER_URL=https://api.yourdomain.comCORS_ORIGIN=https://yourdomain.com,https://app.yourdomain.comLogging Configuration
Section titled “Logging Configuration”Log Levels and Output
Section titled “Log Levels and Output”| Variable | Type | Default | Description |
|---|---|---|---|
| LOG_LEVEL | string | ERROR,WARN,DEBUG,INFO,LOG,VERBOSE,DARK,WEBHOOKS,WEBSOCKET | Comma-separated list of log levels to display |
| LOG_COLOR | boolean | true | Enable colored log output |
| LOG_BAILEYS | string | error | Baileys library log level: fatal, error, warn, info, debug, trace |
Event Emitter Configuration
Section titled “Event Emitter Configuration”| Variable | Type | Default | Description |
|---|---|---|---|
| EVENT_EMITTER_MAX_LISTENERS | number | 50 | Maximum number of event listeners per event |
Instance Management
Section titled “Instance Management”| Variable | Type | Default | Description |
|---|---|---|---|
| DEL_INSTANCE | boolean | number | false | Auto-delete inactive instances. Set to false to disable, or number of minutes for timeout |
Database Configuration
Section titled “Database Configuration”Connection Settings
Section titled “Connection Settings”| Variable | Type | Default | Description |
|---|---|---|---|
| DATABASE_PROVIDER | postgresql | mysql | postgresql | Database provider to use |
| DATABASE_CONNECTION_URI | string | postgresql://user:pass@postgres:5432/evolution?schema=public | Full database connection string |
| DATABASE_CONNECTION_CLIENT_NAME | string | evolution_exchange | Client name for database connection separation |
Data Persistence Options
Section titled “Data Persistence Options”| Variable | Type | Default | Description |
|---|---|---|---|
| DATABASE_SAVE_DATA_INSTANCE | boolean | true | Save instance data to database |
| DATABASE_SAVE_DATA_NEW_MESSAGE | boolean | true | Save new messages to database |
| DATABASE_SAVE_MESSAGE_UPDATE | boolean | true | Save message updates to database |
| DATABASE_SAVE_DATA_CONTACTS | boolean | true | Save contact information to database |
| DATABASE_SAVE_DATA_CHATS | boolean | true | Save chat information to database |
| DATABASE_SAVE_DATA_LABELS | boolean | true | Save label information to database |
| DATABASE_SAVE_DATA_HISTORIC | boolean | true | Save message history to database |
| DATABASE_SAVE_IS_ON_WHATSAPP | boolean | true | Save WhatsApp presence status |
| DATABASE_SAVE_IS_ON_WHATSAPP_DAYS | number | 7 | Days to keep WhatsApp presence data |
| DATABASE_DELETE_MESSAGE | boolean | true | Enable logical message deletion |
DATABASE_PROVIDER=postgresqlDATABASE_CONNECTION_URI=postgresql://username:password@localhost:5432/evolution_db?schema=publicDATABASE_CONNECTION_CLIENT_NAME=evolution_prodDATABASE_PROVIDER=mysqlDATABASE_CONNECTION_URI=mysql://username:password@localhost:3306/evolution_dbDATABASE_CONNECTION_CLIENT_NAME=evolution_prodCache Configuration
Section titled “Cache Configuration”Redis Cache
Section titled “Redis Cache”| Variable | Type | Default | Description |
|---|---|---|---|
| CACHE_REDIS_ENABLED | boolean | true | Enable Redis caching |
| CACHE_REDIS_URI | string | redis://localhost:6379/6 | Redis connection string |
| CACHE_REDIS_TTL | number | 604800 | Cache TTL in seconds (default: 7 days) |
| CACHE_REDIS_PREFIX_KEY | string | evolution | Prefix for Redis keys |
| CACHE_REDIS_SAVE_INSTANCES | boolean | false | Save instance data in Redis instead of database |
Local Cache
Section titled “Local Cache”| Variable | Type | Default | Description |
|---|---|---|---|
| CACHE_LOCAL_ENABLED | boolean | false | Enable local memory caching |
Event Integration
Section titled “Event Integration”RabbitMQ Configuration
Section titled “RabbitMQ Configuration”| Variable | Type | Default | Description |
|---|---|---|---|
| RABBITMQ_ENABLED | boolean | false | Enable RabbitMQ integration |
| RABBITMQ_URI | string | amqp://localhost | RabbitMQ connection string |
| RABBITMQ_EXCHANGE_NAME | string | evolution | Exchange name for RabbitMQ |
| RABBITMQ_GLOBAL_ENABLED | boolean | false | Send events from all instances to same queue |
RabbitMQ Events
Section titled “RabbitMQ Events”All RabbitMQ events are disabled by default. Enable specific events by setting them to true:
- RABBITMQ_EVENTS_APPLICATION_STARTUP
- RABBITMQ_EVENTS_INSTANCE_CREATE
- RABBITMQ_EVENTS_INSTANCE_DELETE
- RABBITMQ_EVENTS_QRCODE_UPDATED
- RABBITMQ_EVENTS_MESSAGES_SET
- RABBITMQ_EVENTS_MESSAGES_UPSERT
- RABBITMQ_EVENTS_MESSAGES_EDITED
- RABBITMQ_EVENTS_MESSAGES_UPDATE
- RABBITMQ_EVENTS_MESSAGES_DELETE
- RABBITMQ_EVENTS_SEND_MESSAGE
- RABBITMQ_EVENTS_CONTACTS_SET
- RABBITMQ_EVENTS_CONTACTS_UPSERT
- RABBITMQ_EVENTS_CONTACTS_UPDATE
- RABBITMQ_EVENTS_PRESENCE_UPDATE
- RABBITMQ_EVENTS_CHATS_SET
- RABBITMQ_EVENTS_CHATS_UPSERT
- RABBITMQ_EVENTS_CHATS_UPDATE
- RABBITMQ_EVENTS_CHATS_DELETE
- RABBITMQ_EVENTS_GROUPS_UPSERT
- RABBITMQ_EVENTS_GROUP_UPDATE
- RABBITMQ_EVENTS_GROUP_PARTICIPANTS_UPDATE
- RABBITMQ_EVENTS_CONNECTION_UPDATE
- RABBITMQ_EVENTS_REMOVE_INSTANCE
- RABBITMQ_EVENTS_LOGOUT_INSTANCE
- RABBITMQ_EVENTS_CALL
- RABBITMQ_EVENTS_TYPEBOT_START
- RABBITMQ_EVENTS_TYPEBOT_CHANGE_STATUS
Amazon SQS Configuration
Section titled “Amazon SQS Configuration”| Variable | Type | Default | Description |
|---|---|---|---|
| SQS_ENABLED | boolean | false | Enable Amazon SQS integration |
| SQS_ACCESS_KEY_ID | string | - | AWS access key ID |
| SQS_SECRET_ACCESS_KEY | string | - | AWS secret access key |
| SQS_ACCOUNT_ID | string | - | AWS account ID |
| SQS_REGION | string | - | AWS region |
WebSocket Configuration
Section titled “WebSocket Configuration”| Variable | Type | Default | Description |
|---|---|---|---|
| WEBSOCKET_ENABLED | boolean | false | Enable WebSocket support |
| WEBSOCKET_GLOBAL_EVENTS | boolean | false | Send global events via WebSocket |
Pusher Configuration
Section titled “Pusher Configuration”| Variable | Type | Default | Description |
|---|---|---|---|
| PUSHER_ENABLED | boolean | false | Enable Pusher integration |