Skip to content

ModuleAnalyticsProvider

Every Whisker module that emits analytics events. Wrap near module root.

Host-level platform analytics — use PlatformAnalyticsProvider.

  • useModuleAnalytics

For the full three-layer architecture (Platform → Module → Scope → component), OpenTelemetry attribute conventions, merge order, and a worked example of what lands in the analytics backend, see Analytics architecture.

Auto-generated from src/providers/SharedAnalyticsProvider/SharedAnalyticsProvider.types.ts. Do not edit by hand. Run pnpm docs:props after changing source JSDoc.

Prop Type Required Description
baselineAttributes Record<string, boolean | number | string> No Baseline attributes for this module (applied to all events)
children ReactNode Yes Children
feature string No Feature sub-context (e.g. ‘export’, ‘filter’, ‘search’). Automatically included on every event from this subtree.
moduleName string No Module name (e.g., ‘sim-shipping’, ‘sim-pi-upload’). Optional when baselineAttributes['service.name'] is provided. If both are provided, they must represent the same module identity.
page string No Route / screen name. Automatically included on every event from this subtree. Inherited by nested AnalyticsScope components.
Prop Type Required Description
children ReactNode Yes
feature string No Feature sub-context. Overrides the parent scope’s feature value for this subtree. Omit to inherit from the parent.
page string No Route / screen name. Overrides the parent scope’s page value for this subtree. Omit to inherit from the parent.
import { ModuleAnalyticsProvider, AnalyticsScope } from '@nike/whisker-component-library';
<ModuleAnalyticsProvider moduleName="sim-pi-upload">
<AnalyticsScope page="upload" feature="csv-import">
<UploadPage />
</AnalyticsScope>
</ModuleAnalyticsProvider>;