# balena-settings-client

> Balena client application shared settings

Latest version **6.0.3** (published 2026-02-12) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install balena-settings-client
pnpm add balena-settings-client
yarn add balena-settings-client
bun add balena-settings-client
```

## Health

**Score 60/100 (C)** — status: stable.

Positive: has types; no vulnerabilities; has provenance; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 6.0.3 |
| Published | 2026-02-12 |
| First published | 2018-10-15 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=20.12.0 |
| Dependencies | 4 |
| Unpacked size | 99.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 5 |
| Author | Balena Ltd. |
| Maintainers | balena.io |
| Keywords | balena, settings, client |

## Links

- npm: https://www.npmjs.com/package/balena-settings-client
- Repository: https://github.com/balena-io-modules/balena-settings-client
- Issues: https://github.com/balena-io-modules/balena-settings-client/issues
- npm.io page: https://npm.io/package/balena-settings-client

## Dependencies (4)

- [js-yaml](https://npm.io/package/js-yaml.md) ^3.4.0
- [hidepath](https://npm.io/package/hidepath.md) ^1.0.0
- [es-toolkit](https://npm.io/package/es-toolkit.md) ^1.42.0
- [home-or-tmp](https://npm.io/package/home-or-tmp.md) ^2.0.0

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 6.0.3 (latest) — 2026-02-12
- 6.0.3-build-no-url-parse-a32c720f830e5448ffbe1eedc118d47e02f70e5d-1 (build-no-url-parse) — 2026-02-12
- 6.0.2-build-internal-type-dependencies-67f59074695dce97dd47ac85548561f83fc2e59a-1 (build-internal-type-dependencies) — 2025-12-23
- 6.0.1-build-fix-node-engine-requirements-435893a6da9eb1efab4504eae5c91259ba834ebc-1 (build-fix-node-engine-requirements) — 2025-12-23
- 6.0.0-build-drop-lodash-b76cf4d77028a5b9105aaa1496e59e31295bea3c-1 (build-drop-lodash) — 2025-12-23
- 5.0.3-build-bump-ts-9127d3d46c063abbd8a55af1a53492de54fb1154-1 (build-bump-ts) — 2023-06-02
- 5.0.2-build-flowzonify-f83a096015ccb7bdd6195c8cc0fbbe16ce62ae5f-1 (build-flowzonify-f83a096015ccb7bdd6195c8cc0fbbe16ce62ae5f) — 2023-04-20
- 6.0.3-build-no-url-parse-5ed9723804b2e541870311858bdca45c91cb1a40-1 — 2026-02-12
- 6.0.2 — 2025-12-23
- 6.0.2-build-internal-type-dependencies-fed3b66db3ea403ab979e0195bf1c37af93a1fb1-1 — 2025-12-23
- 6.0.1-build-internal-type-dependencies-2330eed3e6286b0bc88a9ff7562cc26781334d2f-1 — 2025-12-23
- 6.0.1 — 2025-12-23
- 6.0.0 — 2025-12-23
- 6.0.0-build-drop-lodash-d2fd62889643e07ccfe5925d20bc2110d3496038-1 — 2025-12-23
- 6.0.0-build-drop-lodash-3f51d142e04cd2b1d2924a8c17f39461541e55cb-1 — 2025-12-23
- … 35 more at https://npm.io/package/balena-settings-client/versions

## README

balena-settings-client
---------------------

[![npm version](https://badge.fury.io/js/balena-settings-client.svg)](http://badge.fury.io/js/balena-settings-client)
[![dependencies](https://david-dm.org/balena-io-modules/balena-settings-client.png)](https://david-dm.org/balena-io-modules/balena-settings-client.png)
[![Build Status](https://travis-ci.org/balena-io-modules/balena-settings-client.svg?branch=master)](https://travis-ci.org/balena-io-modules/balena-settings-client)
[![Build status](https://ci.appveyor.com/api/projects/status/a1tfwovw1kp421sa?svg=true)](https://ci.appveyor.com/project/jviotti/balena-settings-client)

Join our online chat at [![Gitter chat](https://badges.gitter.im/balena-io/chat.png)](https://gitter.im/balena-io/chat)

Balena client application shared settings.

Role
----

The intention of this module is to provice low level access to user configurable balena simple settings.

**THIS MODULE IS LOW LEVEL AND IS NOT MEANT TO BE USED BY END USERS DIRECTLY**.

Unless you know what you're doing, use the [balena SDK](https://github.com/balena-io/balena-sdk) instead.

Installation
------------

Install `balena-settings-client` by running:

```sh
$ npm install --save balena-settings-client
```

Documentation
-------------

This module attempts to retrieve configuration from the following places:

**UNIX:**

- Default settings.
- `$HOME/.balenarc.yml`.
- `$PWD/balenarc.yml`.
- Environment variables matching `BALENARC_<SETTING_NAME>`.

**Windows:**

- Default settings.
- `%UserProfile%\_balenarc.yml`.
- `%cd%\balenarc.yml`.
- Environment variables matching `BALENARC_<SETTING_NAME>`.

The values from all locations are merged together, with sources listed below taking precedence.

For example:

```sh
	$ cat $HOME/.balenarc.yml
	balenaUrl: 'balena-staging.com'
	projectsDirectory: '/opt/balena'

	$ cat $PWD/.balenarc.yml
	projectsDirectory: '/Users/balena/Projects'
	dataDirectory: '/opt/balena-data'

	$ echo $BALENARC_DATA_DIRECTORY
	/opt/cache/balena
```

That specific environment will have the following configuration:

```yaml
	balenaUrl: 'balena-staging.com'
	projectsDirectory: '/Users/balena/Projects'
	dataDirectory: '/opt/cache/balena'
```


* [settings](#module_settings)
    * [~get(name)](#module_settings..get) ⇒ <code>\*</code>
    * [~getAll()](#module_settings..getAll) ⇒ <code>Object</code>

<a name="module_settings..get"></a>

### settings~get(name) ⇒ <code>\*</code>
**Kind**: inner method of [<code>settings</code>](#module_settings)  
**Summary**: Get a setting  
**Returns**: <code>\*</code> - setting value  
**Access**: public  

| Param | Type | Description |
| --- | --- | --- |
| name | <code>String</code> | setting name |

**Example**  
```js
settings.get('dataDirectory')
```
<a name="module_settings..getAll"></a>

### settings~getAll() ⇒ <code>Object</code>
**Kind**: inner method of [<code>settings</code>](#module_settings)  
**Summary**: Get all settings  
**Returns**: <code>Object</code> - all settings  
**Access**: public  
**Example**  
```js
settings.getAll()
```

Modifying settings
------------------

This module is intended to only provide *read only* access to the settings. Balena settings client reads settings from various locations, like a local `balenarc` file and a per user `config` file, therefore the module doesn't know where to write changes back.

If you want to persist data related to balena, consider using [balena settings storage](https://github.com/balena-io-modules/balena-settings-storage) instead.

Support
-------

If you're having any problem, please [raise an issue](https://github.com/balena-io-modules/balena-settings-client/issues/new) on GitHub and the balena team will be happy to help.

Tests
-----

Run the test suite by doing:

```sh
$ npm test
```

Contribute
----------

- Issue Tracker: [github.com/balena-io-modules/balena-settings-client/issues](https://github.com/balena-io-modules/balena-settings-client/issues)
- Source Code: [github.com/balena-io-modules/balena-settings-client](https://github.com/balena-io-modules/balena-settings-client)

Before submitting a PR, please make sure that you include tests, and that [coffeelint](http://www.coffeelint.org/) runs without any warning:

```sh
$ npm run lint
```

License
-------

The project is licensed under the Apache 2.0 license.

---
_Source: https://npm.io/package/balena-settings-client · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
