Skip to content
View as Markdown
View as Markdown

@salesforce/b2c-tooling-sdk / operations/metrics / 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

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 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.

Released under the Apache-2.0 License.