ModuleAnalyticsProvider
When to use
Section titled “When to use”Every Whisker module that emits analytics events. Wrap near module root.
When NOT to use
Section titled “When NOT to use”Host-level platform analytics — use PlatformAnalyticsProvider.
Related stores
Section titled “Related stores”useModuleAnalytics
See also
Section titled “See also”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. Runpnpm docs:propsafter changing source JSDoc.
ModuleAnalyticsProviderProps
Section titled “ModuleAnalyticsProviderProps”| 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. |
AnalyticsScopeProps
Section titled “AnalyticsScopeProps”| 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. |
Examples
Section titled “Examples”Module wrapper
Section titled “Module wrapper”import { ModuleAnalyticsProvider, AnalyticsScope } from '@nike/whisker-component-library';
<ModuleAnalyticsProvider moduleName="sim-pi-upload"> <AnalyticsScope page="upload" feature="csv-import"> <UploadPage /> </AnalyticsScope></ModuleAnalyticsProvider>;