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

yext / search-ui-react / 20970077140

13 Jan 2026 07:38PM UTC coverage: 85.288% (-0.5%) from 85.752%
20970077140

push

github

web-flow
ksearch: upgrade to Events API (#508)

* ksearch: upgrade to Events API

This PR upgrades our analytics calls to the next major
version, also called the Events API. As part of this
work, analytics calls have changed shape, and some deprecated
properties have been dropped.
J=WAT-4651
TEST=auto,manual

Updated auto tests. Ran test site locally and saw events all the
way to snowflake.

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>

1019 of 1401 branches covered (72.73%)

Branch coverage included in aggregate %.

104 of 127 new or added lines in 19 files covered. (81.89%)

2 existing lines in 2 files now uncovered.

2239 of 2419 relevant lines covered (92.56%)

141.11 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