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

yext / search-ui-react / 20833106319

08 Jan 2026 09:56PM UTC coverage: 85.47% (-0.4%) from 85.844%
20833106319

Pull #508

github

web-flow
Merge 6ee2d1878 into 1c7946c79
Pull Request #508: ksearch: upgrade to Events API

1012 of 1385 branches covered (73.07%)

Branch coverage included in aggregate %.

46 of 67 new or added lines in 8 files covered. (68.66%)

2 existing lines in 2 files now uncovered.

2235 of 2414 relevant lines covered (92.58%)

138.0 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>): React.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