MCPcopy Index your code
hub / github.com/msgbyte/tianji / initApplication

Function initApplication

packages/client-sdk/src/application.ts:95–113  ·  view source on GitHub ↗
(_options: ApplicationTrackingOptions)

Source from the content-addressed store, hash-verified

93> | null = null;
94
95export function initApplication(_options: ApplicationTrackingOptions) {
96 options = _options;
97
98 // Initialize batch manager
99 batchManager = new BatchManager({
100 batchDelay: _options.batchDelay,
101 disableBatch: _options.disableBatch,
102 onBatchSend: async (items) => {
103 await sendBatchRequest(_options.serverUrl, items);
104 },
105 onSingleSend: async (item) => {
106 await sendSingleRequest(
107 _options.serverUrl,
108 item.type as 'event' | 'identify',
109 item.payload
110 );
111 },
112 });
113}
114
115let currentScreenName: string | undefined = undefined;
116let currentScreenParams: Record<string, any> | undefined = undefined;

Callers

nothing calls this directly

Calls 2

sendBatchRequestFunction · 0.70
sendSingleRequestFunction · 0.70

Tested by

no test coverage detected