• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

yext / search-ui-react / 17986846418

24 Sep 2025 07:05PM UTC coverage: 87.704% (-0.6%) from 88.287%
17986846418

Pull #508

github

web-flow
Merge d9b1f2121 into f4c07d723
Pull Request #508: ksearch: upgrade to Events API

817 of 1029 branches covered (79.4%)

Branch coverage included in aggregate %.

40 of 67 new or added lines in 8 files covered. (59.7%)

3 existing lines in 3 files now uncovered.

2086 of 2281 relevant lines covered (91.45%)

134.74 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

57.14
/src/components/AnalyticsProvider.tsx
1
import React, {PropsWithChildren} from 'react';
5✔
2
import {analytics, AnalyticsConfig} from '@yext/analytics';
3
import {AnalyticsContext} from '../hooks/useAnalytics';
5✔
4
import {CloudRegion, Environment} from "@yext/search-core";
5
import {SearchAnalyticsEventServiceImpl} from "../models/SearchAnalyticsEventServiceImpl";
5✔
6

7
/**
8
 * A higher-order component which provides analytics for its children.
9
 *
10
 * @public
11
 *
12
 * @param props - The configuration for the analytics service
13
 * @returns A React element that provides analytics context
14
 */
15
export function AnalyticsProvider(props: PropsWithChildren<SearchAnalyticsConfig>): JSX.Element {
5✔
NEW
16
  const {children, ...searchAnalyticsConfig} = props;
×
17
  const analyticsReporter =
NEW
18
      new SearchAnalyticsEventServiceImpl(searchAnalyticsConfig)
×
19

20
  return (
×
21
      <AnalyticsContext.Provider value={analyticsReporter}>
22
        {children}
23
      </AnalyticsContext.Provider>
24
  );
25
}
26

27
/**
28
 * An interface representing the configuration for search analytics reporting.
29
 *
30
 * @public
31
 */
32
export interface SearchAnalyticsConfig {
33
  /** The apiKey of the App with Events SDK access. */
34
  apiKey: string
35
  /** The Yext environment to send requests to. Defaults to 'PRODUCTION'. */
36
  environment?: Environment
37
  /** The region to send requests to. Defaults to 'US'. */
38
  cloudRegion?: CloudRegion;
39
  /** Whether to enable session tracking for analytics events. */
40
  sessionTrackingEnabled?: boolean;
41
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc