---
editLink: false
lastUpdated: false
---

[@salesforce/b2c-tooling-sdk](../../../modules.md) / [operations/metrics](../index.md) / METRICS\_DEFAULT\_WINDOW\_MS

# Variable: METRICS\_DEFAULT\_WINDOW\_MS

> `const` **METRICS\_DEFAULT\_WINDOW\_MS**: `number`

Defined in: [packages/b2c-tooling-sdk/src/operations/metrics/index.ts:164](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/67fb8580ac3c5b372617ee3ec3fc8f2bc9f16174/packages/b2c-tooling-sdk/src/operations/metrics/index.ts#L164)

Default (and maximum) width of a metrics time window: 24 hours.

The Metrics API pairs a request that omits `to` with its own `now` and then
enforces a maximum window of `to - from ≤ 24h`, rejecting anything wider with a
400. An open-ended `from` older than 24h therefore always fails. To make the
behavior predictable, [resolveMetricsWindow](../functions/resolveMetricsWindow.md) fills in a 24-hour window
(clamped so `to` never exceeds `now`) for any bound the caller leaves open, and
always sends both `from` and `to`. This is only a *default* for derivation — an
explicit `from`+`to` range wider than 24h is still sent as-is, letting the API
remain authoritative and return its own error.
