# @ledgerhq/live-network

> Ledger Live network and cache utilities

Latest version **3.0.0** (published 2026-08-04) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @ledgerhq/live-network
pnpm add @ledgerhq/live-network
yarn add @ledgerhq/live-network
bun add @ledgerhq/live-network
```

## Health

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

Positive: esm support; no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2026-08-04 |
| First published | 2023-05-30 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 161.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 618 |
| Maintainers | phenry-ledger, sergii-shkolin, gbrahm-ledger, thomas.coudray, ldg-github-ci, vbouzon, ledger-releaser |
| Keywords | Ledger |

## Links

- npm: https://www.npmjs.com/package/@ledgerhq/live-network
- Repository: https://github.com/LedgerHQ/ledger-live
- Homepage: https://github.com/LedgerHQ/ledger-live/tree/develop/libs/network
- Issues: https://github.com/LedgerHQ/ledger-live/issues
- npm.io page: https://npm.io/package/@ledgerhq/live-network

## Dependencies (3)

- [lru-cache](https://npm.io/package/lru-cache.md) ^7.14.1
- [@ledgerhq/logs](https://npm.io/package/@ledgerhq/logs.md) ^6.17.0
- [@ledgerhq/live-promise](https://npm.io/package/@ledgerhq/live-promise.md) ^0.3.0

## Recent versions

- 3.0.0 (latest) — 2026-08-04
- 3.0.0-nightly.20260804030101 (nightly) — 2026-08-04
- 2.0.11-next.0 (next) — 2025-06-17
- 2.0.3-next-new-cdn.0 (next-new-cdn) — 2024-11-13
- 2.0.3-ios-build-number.0 (ios-build-number) — 2024-11-07
- 2.0.3-fix-build-number-pre.0 (fix-build-number-pre) — 2024-11-07
- 2.0.3-ios-build-number-fix.0 (ios-build-number-fix) — 2024-11-07
- 2.0.3-spl-tokens-test.0 (spl-tokens-test) — 2024-11-04
- 2.0.3-spl-test.0 (spl-test) — 2024-10-29
- 1.3.0-windows-certificate.0 (windows-certificate) — 2024-05-28
- 1.1.13-hotfix.0 (hotfix) — 2024-02-21
- 1.1.12-new-wc.0 (new-wc) — 2024-02-20
- 1.1.12-new-wc-test.0 (new-wc-test) — 2024-02-20
- 1.1.12-wc-test.0 (wc-test) — 2024-02-14
- 1.1.11-custom-exchange.0 (custom-exchange) — 2024-01-09
- … 452 more at https://npm.io/package/@ledgerhq/live-network/versions

## README

# live-network

> [!NOTE]
> **Status: STABLE** — Production-ready; API is considered stable.

`@ledgerhq/live-network` is the shared network layer for Ledger Live. It wraps the underlying HTTP client with Ledger-specific logging, error normalisation, and request optimisation utilities so all services in the monorepo make network calls consistently.

## What it does

- Exposes a `network()` helper that wraps `axios` with automatic logging (via `@ledgerhq/logs`) and maps HTTP errors into typed Ledger errors.
- Provides a **request batcher** (`batcher/`) that coalesces concurrent requests for the same resource into a single in-flight call, reducing redundant network traffic.
- Provides a **cache layer** (`cache.ts`) for memoising responses with configurable TTL.

## Key exports / concepts

- Default export `network(options)` — drop-in replacement for `axios` with logging and error handling.
- `seconds(n) / minutes(n) / hours(n)` — helpers that produce `CacheOptions` for use with `lru-cache`.
- `makeBatcher(request, params)` — batches concurrent calls within the same event-loop tick into a single upstream request (via `@ledgerhq/live-network/batcher`).

## Usage context

Used throughout `libs/ledger-live-common`, coin modules, and service clients. Both desktop and mobile depend on it transitively. It is the single place to configure global request behaviour (timeouts, base URLs via `@ledgerhq/live-env`).

---
_Source: https://npm.io/package/@ledgerhq/live-network · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
