Bots Development Environment Setup
    • Dark
    • PDF

    Bots Development Environment Setup

    • Dark
    • PDF

    Article summary


    Developing bots on RocketChat requires you to get and customize our boilerplate code. To do that, you need to have the following on your machine.

    Bot configuration

    Regardless of bot type, the Rocket.Chat SDK requires you to create a configuration with some variables for your environment. This configuration can be stored in a .env file, for local development, while in production, they would need to be set on server startup.

    Bot environmental variables

    The following is a list of all the environmental variables you can use in your project.

    Variables marked with an asterisk (*) are mandatory.

    Environment variable



    URL of the Rocket.Chat instance to connect to. Can be specified as host:port, http://host:port or https://host:port.


    Force bot to connect with SSL. If unset, it will try and detect from URL protocol.


    Authorization method for a bot. Default: password. Set to ldap to enable LDAP login for bot users.


    The bot's username (account name users will summon the bot with). Must be registered on your Rocket.Chat server and granted bot role.


    The bot user's password.


    Stream callbacks receive messages from the listed channel name/s. Default: GENERAL. Accepts a comma-separated list. Allows the bot to listen and respond to messages from all newly created private groups where the bot's user has been added as a member. Should be empty if LISTEN_ON_ALL_PUBLIC=true

    Responding to channels and DMs


    Stream callbacks receive messages from Livechat (true/false). Default: false.


    Stream callbacks receive DMs with bot (true/false). Default: false.


    Stream callbacks receive edited messages (true/false). Default: false.

    SDK development


    Size of cache (LRU) for room (ID or name) lookups.


    Max age of cache for room lookups.


    Size of cache for Direct Message room lookups.


    Max age of cache for DM lookups.


    ID applied to message object to integration source. Default: js.SDK


    Admin user name for API calls used in SDK tests.


    Admin user password for API calls used in SDK tests.

    Hubot specific


    Name of the bot. Hubot listeners can respond to this.


    Another name to respond to. If unset, the adapter sets the ROCKETCHAT_USER as an alias, to ensure bots respond when addressed using their username.


    Hubot scripts to require as NPM modules. Used only in some Docker instances.


    debug, info, warning or error. Default: info.

    Common set of variables

    The common set for the majority of bots is to listen and respond to direct messages and all new public channels and private groups:

    • RESPOND_TO_DM=true


    Note that you must add the bot's user as a member of a channel before the bot can respond.

    Was this article helpful?

    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.

    Eddy AI, facilitating knowledge discovery through conversational intelligence