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

Function send

packages/studio/src/telemetry/client.ts:106–127  ·  view source on GitHub ↗
(url: string, payload: string)

Source from the content-addressed store, hash-verified

104}
105
106function send(url: string, payload: string): void {
107 // Prefer fetch with keepalive (survives page navigation). sendBeacon is a
108 // fallback for older runtimes where fetch isn't available.
109 try {
110 void fetch(url, {
111 method: "POST",
112 headers: { "Content-Type": "application/json" },
113 body: payload,
114 keepalive: true,
115 }).catch(() => {
116 /* silent */
117 });
118 return;
119 } catch {
120 /* fall through */
121 }
122 try {
123 navigator.sendBeacon(url, new Blob([payload], { type: "application/json" }));
124 } catch {
125 /* silent */
126 }
127}
128
129function showNoticeOnce(): void {
130 if (hasShownNotice()) return;

Callers 1

flushFunction · 0.70

Calls 1

fetchFunction · 0.85

Tested by

no test coverage detected