MCPcopy Create free account
hub / github.com/BuilderIO/mitosis / track

Function track

examples/basic/src/functions/track.ts:4–17  ·  view source on GitHub ↗
(event: string, properties: Record<string, any>)

Source from the content-addressed store, hash-verified

2import { isReactNative } from './is-react-native';
3
4export function track(event: string, properties: Record<string, any>) {
5 if (!(isBrowser() || isReactNative())) {
6 return;
7 }
8
9 return fetch(`http://example.com/api/track`, {
10 method: 'POST',
11 body: JSON.stringify({ events: [{ type: event, data: properties }] }),
12 headers: {
13 'content-type': 'application/json',
14 },
15 mode: 'cors',
16 });
17}

Callers 2

code-editor.tsxFile · 0.85
index.tsxFile · 0.85

Calls 2

isBrowserFunction · 0.90
isReactNativeFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…