Skip to content

Passing additional environment variables to bot instance #20

Description

@ppauel

Summary

I would like to propose a change that would make it possible to pass additional environment variables to a BotInstance’s process. Right now, when forking, only selected variables are passed to options.env. The current implementation overrides the NodeJS default value process.env, which contains the values of the main process.

Motivation

The bot instance may need to access additional environment variables defined externally, e.g., in a docker-compose.yaml, that get lost during the fork.

Proposed Solution

Introduce a new constructor option for BotInstance (and ManagedInstance / StandaloneInstance) that accepts key-value pairs and will get merged into the options.env object when forking.

Alternatives Considered

It is possible to call process.loadEnvFile() inside the bot instance, but can be inconvenient if environment variables are defined elsewhere.

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions