Read variable from external source and set capability through code or any other means


I am using fb-webhook-connector for my messenger bot verification. There is one capability “FBWEBHOOK_APPSECRET”. For my application secrets are stored on aws parameter store, I have a javascript method to read those parameters and corresponding values.

Below are the things I want to achieve.

  1. Before execution gets started, I wanted to execute my js method and read all those parameters and values.
  2. Store it somewhere.
  3. Pass them to “FBWEBHOOK_APPSECRET” capability at run time.

the 3rs step is clear I can use
UPDATE_CUSTOM <cap_name>|<cap_value>
I need some help on achieving first 2 steps and passing <cap_values> in 3rd step.

The main agenda behind this is I don’t want to store my secrets on files and check them in github.

custom hooks is the way to go: Community — Botium documentation

here is an example:

1 Like

thanks @Florian,

I used custom hooks to achieve what I wanted to do. I could successfully fetch parameters.

I am assigning my secret to FBWEBHOOK_APPSECRET like below

container.caps.FBWEBHOOK_APPSECRET = secret;

My botium.json is as below


  "botium": {

    "Capabilities": {

      "PROJECTNAME": "test",

      "CONTAINERMODE": "fbwebhook",

      "FBWEBHOOK_WEBHOOKURL": "<url>",

      "FBWEBHOOK_PAGEID": "<page_id>",

      "FBWEBHOOK_APPSECRET": "mysecret",





      "CUSTOMHOOK_ONBUILD": "./auth.js"




when the request is reaching to my backend, I am not able to see xHubSignature according to secrets assigned in js file but it is taking “mysecret” every time.

this is the code inside index.js of fb-webhook-connector

let xHubSignature

          if (this.caps[Capabilities.FBWEBHOOK_APPSECRET]) {

            const hmac = crypto.createHmac('sha1', this.caps[Capabilities.FBWEBHOOK_APPSECRET])

            hmac.update(JSON.stringify(body), 'utf8')

            xHubSignature = 'sha1=' + hmac.digest('hex')


How can I assign my secrets to FBWEBHOOK_USERID inside Capabilities object???

Try to replace this with:

container.pluginInstance.caps.FBWEBHOOK_APPSECRET = secret;

and tell me if it works

1 Like

@Florian , that worked well. Thanks :slight_smile:

1 Like