# Access environment variables from forge event callback

**URL:** <https://community.developer.atlassian.com/t/access-environment-variables-from-forge-event-callback/64249>\
**Category:** Forge Modules and Product Triggers\
**Tags:** custom-ui\
**Created:** [December 12, 2022, 4:24pm UTC](https://community.developer.atlassian.com/t/access-environment-variables-from-forge-event-callback/64249 "2022-12-12T16:24:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![justindujardin](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/justindujardin/32/46837_2.png) [@justindujardin](https://community.developer.atlassian.com/u/justindujardin)\
**Post date:** [December 12, 2022, 4:24pm UTC](https://community.developer.atlassian.com/t/access-environment-variables-from-forge-event-callback/64249/1 "2022-12-12T16:24:46Z")

</div>

I have a Forge app that uses the trigger module to get callbacks when issues change. I’m trying to access a set environment variable from the function that’s run from one of these event triggers, and it’s consistently undefined.

My `manifest.yml` looks like this:

```auto
modules:
  trigger:
    - key: issue-update-trigger
      function: app-issue-events-func
      events:
        - avi:jira:updated:issue
  function:
    - key: main
      handler: index.run
    - key: app-issue-events-func
      handler: index.issueUpdate

```

I set the variable with:

```auto
forge variables set FORGE_USER_VAR_NAME value 

```

And my function looks like:

```auto
import * as process from 'process';

export async function issueUpdate(data) {
  const nameVar = process.env.FORGE_USER_VAR_NAME;
  console.log(nameVar);
  // undefined
}

```

Is it not possible to access environment variables from trigger functions?

---

<div class="post-metadata">

**Author:** ![AlexeyKotlyarov](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/alexeykotlyarov/32/45643_2.png) [@AlexeyKotlyarov](https://community.developer.atlassian.com/u/AlexeyKotlyarov)\
**Post date:** [December 16, 2022, 12:52am UTC](https://community.developer.atlassian.com/t/access-environment-variables-from-forge-event-callback/64249/2 "2022-12-16T00:52:52Z")

</div>

The `process` object is available globally within Node.js and the [Forge environment](https://developer.atlassian.com/platform/forge/runtime-reference/#javascript-environment). Can you please try removing the `process` import - perhaps it is interfering with the one Forge provides?

---

<div class="post-metadata">

**Author:** ![JustinChase](https://avatars.discourse-cdn.com/v4/letter/j/45deac/32.png) [@JustinChase](https://community.developer.atlassian.com/u/JustinChase)\
**Post date:** [November 25, 2024, 5:12pm UTC](https://community.developer.atlassian.com/t/access-environment-variables-from-forge-event-callback/64249/3 "2024-11-25T17:12:21Z")

</div>

The `proccess.env` is available but it is not populated with any environment variables. There appears to be no documentation on how to _read_ environment variables specified in the manifest at runtime.

Any help would be appreciated!

---

<div class="post-metadata">

**Author:** ![AlexeyKotlyarov](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/alexeykotlyarov/32/45643_2.png) [@AlexeyKotlyarov](https://community.developer.atlassian.com/u/AlexeyKotlyarov)\
**Post date:** [November 26, 2024, 9:59pm UTC](https://community.developer.atlassian.com/t/access-environment-variables-from-forge-event-callback/64249/4 "2024-11-26T21:59:50Z")

</div>

@JustinChase do you mind creating a new topic for this? Paste your app’s manifest and what you are doing as well so we can help you better.

---

<div class="post-metadata">

**Author:** ![JustinChase](https://avatars.discourse-cdn.com/v4/letter/j/45deac/32.png) [@JustinChase](https://community.developer.atlassian.com/u/JustinChase)\
**Post date:** [January 2, 2025, 3:40pm UTC](https://community.developer.atlassian.com/t/access-environment-variables-from-forge-event-callback/64249/5 "2025-01-02T15:40:11Z")

</div>

I managed to figure it out the properties need to be set per environment, when we were running locally you just had the env vars set locally and since the manifest file lists the env vars so I thought it was pulling them at deploy time but I found out you need to run a seperate command to set the parameters.

I do think it would help a lot for the apps page to at the very least display the parameters set per environment, its really confusing that they’re hidden.
