MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / emitAnalyticsEvent

Function emitAnalyticsEvent

packages/core/src/runtime/analytics.ts:34–50  ·  view source on GitHub ↗
(
  event: RuntimeAnalyticsEvent,
  properties?: RuntimeAnalyticsProperties,
)

Source from the content-addressed store, hash-verified

32 * The host app receives it via postMessage and forwards to its analytics provider.
33 */
34export function emitAnalyticsEvent(
35 event: RuntimeAnalyticsEvent,
36 properties?: RuntimeAnalyticsProperties,
37): void {
38 if (!_postMessage) return;
39 try {
40 _postMessage({
41 source: "hf-preview",
42 type: "analytics",
43 event,
44 properties: properties ?? {},
45 });
46 } catch (err) {
47 // Never let analytics failures affect the runtime
48 swallow("runtime.analytics.site1", err);
49 }
50}

Callers 2

analytics.test.tsFile · 0.90

Calls 1

swallowFunction · 0.90

Tested by

no test coverage detected