# Elastic Synthetics Environment Variables

**URL:** https://discuss.elastic.co/t/elastic-synthetics-environment-variables/355621
**Category:** Synthetics
**Created:** [March 18, 2024, 3:59pm UTC](https://discuss.elastic.co/t/elastic-synthetics-environment-variables/355621 "2024-03-18T15:59:50Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![DougR](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dougr/32/48095_2.png) [@DougR](https://discuss.elastic.co/u/DougR)
#### Post date: [March 18, 2024, 3:59pm UTC](https://discuss.elastic.co/t/elastic-synthetics-environment-variables/355621/1 "2024-03-18T15:59:50Z")

</div>

A quick question.

At one point, when writing an `@elastic/synthetics` journey and pushing it to Elastic Synthetics via `npx @elastic/synthetics push`, Elastic Synthetics would push the local values of any environment variables and would ignore the environment variables defined on the agent when running tests, even if no local values were pushed.

It appears that this has changed at some point (which is a good thing, IMO). However, I can't find any reference to this in either the changelog or the documentation.

Can you please confirm whether this has, in fact, change and point me to the changelog entry or documentation showing this (preferably both)?

This will certainly make it easier for me to allow my users to manage their own tests via a CI/CD pipeline.

Thx.

---

<div class="post-metadata">

### Author: ![vigneshshanmugam](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vigneshshanmugam/32/40324_2.png) [@vigneshshanmugam](https://discuss.elastic.co/u/vigneshshanmugam)
#### Post date: [March 18, 2024, 10:01pm UTC](https://discuss.elastic.co/t/elastic-synthetics-environment-variables/355621/2 "2024-03-18T22:01:59Z")

</div>

Hi @DougR,

When running `npx @elastic/synthetics push` command, The environment variables defined in the `params` field of `synthetics.config.ts` file only gets pushed to the remote Kibana instance as part of the monitor configuration. Any other environment variables are dropped and never gets pushed.

```ts
// synthetics.config.ts

export default () => {
  return {
    params: {
      enable: process.env["ENABLED"]
    }
  }
};

```

I am not sure when we resorted to pushing everything vs what we are doing right now. As far as I can remember, it always worked this way. Please let us know if you have any other questions.

Thanks,  
Vignesh

---

<div class="post-metadata">

### Author: ![DougR](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dougr/32/48095_2.png) [@DougR](https://discuss.elastic.co/u/DougR)
#### Post date: [March 19, 2024, 7:45pm UTC](https://discuss.elastic.co/t/elastic-synthetics-environment-variables/355621/3 "2024-03-19T19:45:01Z")

</div>

There must have been an issue at the time I validated this then. The only thing that matters is that it's not happening now.

Thanks!

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [April 16, 2024, 7:45pm UTC](https://discuss.elastic.co/t/elastic-synthetics-environment-variables/355621/4 "2024-04-16T19:45:55Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
