# Using Environment Variables to Change Notecard Configuration

**URL:** <https://discuss.blues.com/t/using-environment-variables-to-change-notecard-configuration/2832>\
**Category:** Blog Posts\
**Created:** [February 13, 2025, 4:20pm UTC](https://discuss.blues.com/t/using-environment-variables-to-change-notecard-configuration/2832 "2025-02-13T16:20:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![BluesDevRel](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.blues.com/bluesdevrel/32/899_2.png) [@BluesDevRel](https://discuss.blues.com/u/BluesDevRel)\
**Post date:** [February 13, 2025, 4:20pm UTC](https://discuss.blues.com/t/using-environment-variables-to-change-notecard-configuration/2832/1 "2025-02-13T16:20:45Z")

</div>

Learn how to use environment variables, both built-in and custom, to change Notecard configuration remotely.

* * *
Read the full blog post at [https://blues.dev/blog/changing-notecard-config-with-env-vars](https://blues.dev/blog/changing-notecard-config-with-env-vars) and continue the discussion here.

---

<div class="post-metadata">

**Author:** ![devElert](https://avatars.discourse-cdn.com/v4/letter/d/8e8cbc/32.png) [@devElert](https://discuss.blues.com/u/devElert)\
**Post date:** [February 13, 2025, 7:31pm UTC](https://discuss.blues.com/t/using-environment-variables-to-change-notecard-configuration/2832/2 "2025-02-13T19:31:15Z")

</div>

This is great! I didn’t know about the reserved environment variables for controlling sync behavior.

> For example, if you use a Notecard’s `hub.set` request to set `{"inbound":60}`, and also have a `_sync_inbound_mins` environment variable on the device set to `120`, your Notecard will use `120` as an inbound interval.

> If you [delete](https://dev.blues.io/guides-and-tutorials/notecard-guides/understanding-environment-variables/#deleting-environment-variables) any of these variables your device will **revert back to its default configuration**.

On deleting the environment variable, does that mean the notecard would revert to what was set for `inbound` in the most recent `hub.set` request, (60 in the example), or the default value for the `inbound` parameter, which is `0`?

> Use `-1` to [reset](https://dev.blues.io/notecard/notecard-walkthrough/essential-requests/#resetting-request-argument-values) the value back to its default of `0`.  
> A value of `0` means that the Notecard will never sync inbound data unless explicitly told to do so (e.g. using `hub.sync`).

(from [`hub.set` API docs](https://dev.blues.io/api-reference/notecard-api/hub-requests/latest/?highlight=hub.set#hub-set))

Does that mean that setting `-1` or `0` for the `inbound` property does the same thing, or perhaps that `0` isn’t a valid value to set?

---

<div class="post-metadata">

**Author:** ![tjvantoll](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.blues.com/tjvantoll/32/231_2.png) [@tjvantoll](https://discuss.blues.com/u/tjvantoll)\
**Post date:** [February 13, 2025, 9:13pm UTC](https://discuss.blues.com/t/using-environment-variables-to-change-notecard-configuration/2832/3 "2025-02-13T21:13:03Z")

</div>

Hey @devElert,

> On deleting the environment variable, does that mean the notecard would revert to what was set for `inbound` in the most recent `hub.set` request, (60 in the example), or the default value for the `inbound` parameter, which is `0`?

The environment variable doesn’t change your `hub.set` configuration.

When the Notecard sets its next synchronization interval it checks for the environment variable first. If no variable is present, it falls back to the `hub.set` request’s current `inbound` value. If `inbound` has never been set, it’ll use the default of `0`.

> Does that mean that setting `-1` or `0` for the `inbound` property does the same thing, or perhaps that `0` isn’t a valid value to set?

They do the same thing. The `-1` value is a standard way to reset numeric arguments throughout the Notecard’s API [Essential Requests - Blues Developers](https://dev.blues.io/notecard/notecard-walkthrough/essential-requests/#resetting-numeric-arguments).

TJ
