@getlimelight/sdk 0.4.0 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +42 -420
- package/dist/index.d.mts +46 -2
- package/dist/index.d.ts +46 -2
- package/dist/index.js +235 -31
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +235 -31
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,25 +1,23 @@
|
|
|
1
1
|
# Limelight SDK
|
|
2
2
|
|
|
3
|
-
> **Chrome DevTools for React Native** - Real-time debugging with
|
|
3
|
+
> **Chrome DevTools for React Native** - Real-time debugging with state inspection, network monitoring, console streaming, and render tracking.
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@getlimelight/sdk)
|
|
6
6
|
[](https://opensource.org/licenses/MIT)
|
|
7
7
|
[](https://www.typescriptlang.org/)
|
|
8
8
|
|
|
9
|
-
##
|
|
9
|
+
## Documentation
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
📚 **Full documentation at [docs.getlimelight.io](https://docs.getlimelight.io)**
|
|
12
12
|
|
|
13
13
|
## Features
|
|
14
14
|
|
|
15
|
-
-
|
|
16
|
-
- 🔍 **Network
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
- 🛡️ **Privacy-First** - Automatic redaction of sensitive
|
|
20
|
-
-
|
|
21
|
-
- 🎨 **Type Safe** - Full TypeScript support with comprehensive type definitions
|
|
22
|
-
- 🔌 **Framework Agnostic** - Works with React Native, Expo, and web applications
|
|
15
|
+
- 🔮 **State Inspection** - Debug Zustand and Redux stores in real-time
|
|
16
|
+
- 🔍 **Network Monitoring** - Inspect all HTTP requests with GraphQL-first support
|
|
17
|
+
- 📊 **Console Streaming** - View logs with stack traces and source detection
|
|
18
|
+
- ⚡ **Render Tracking** - Find why components re-render
|
|
19
|
+
- 🛡️ **Privacy-First** - Automatic redaction of sensitive data
|
|
20
|
+
- 🎨 **Zero Config** - Works out of the box
|
|
23
21
|
|
|
24
22
|
## Installation
|
|
25
23
|
|
|
@@ -27,460 +25,84 @@ Read the full docs at **[docs.getlimelight.io](https://docs.getlimelight.io)**.
|
|
|
27
25
|
npm install @getlimelight/sdk
|
|
28
26
|
```
|
|
29
27
|
|
|
30
|
-
```bash
|
|
31
|
-
yarn add @getlimelight/sdk
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
```bash
|
|
35
|
-
pnpm add @getlimelight/sdk
|
|
36
|
-
```
|
|
37
|
-
|
|
38
28
|
## Quick Start
|
|
39
29
|
|
|
40
|
-
###
|
|
30
|
+
### Desktop App
|
|
41
31
|
|
|
42
32
|
```typescript
|
|
43
33
|
import { Limelight } from "@getlimelight/sdk";
|
|
44
34
|
|
|
45
|
-
// That's it! One line to start debugging
|
|
46
35
|
Limelight.connect();
|
|
47
36
|
```
|
|
48
37
|
|
|
49
|
-
###
|
|
50
|
-
|
|
51
|
-
```typescript
|
|
52
|
-
import { Limelight } from "@getlimelight/sdk";
|
|
53
|
-
|
|
54
|
-
Limelight.connect({ projectKey: "project-123" });
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
## Configuration
|
|
58
|
-
|
|
59
|
-
### Configuration Options
|
|
60
|
-
|
|
61
|
-
```typescript
|
|
62
|
-
import { Limelight } from '@getlimelight/sdk';
|
|
63
|
-
|
|
64
|
-
Limelight.connect({
|
|
65
|
-
// Required to connect to the Limelight web app. Your project key can be found in organization settings.
|
|
66
|
-
projectKey?: string;
|
|
67
|
-
|
|
68
|
-
// Optional: Platform identifier (auto-detected)
|
|
69
|
-
platform?: string;
|
|
70
|
-
|
|
71
|
-
// Optional: Custom server URL (defaults to ws://localhost:8080)
|
|
72
|
-
serverUrl?: string;
|
|
73
|
-
|
|
74
|
-
// Optional: Your app name
|
|
75
|
-
appName?: string;
|
|
76
|
-
|
|
77
|
-
// Optional: Enable/disable the SDK (defaults to true)
|
|
78
|
-
enabled?: boolean;
|
|
79
|
-
|
|
80
|
-
// Optional: Enable network request interception (defaults to true)
|
|
81
|
-
enableNetworkInspector?: boolean;
|
|
82
|
-
|
|
83
|
-
// Optional: Enable console log capture (defaults to true)
|
|
84
|
-
enableConsole?: boolean;
|
|
85
|
-
|
|
86
|
-
// Optional: Enable GraphQL operation detection (defaults to true)
|
|
87
|
-
enableGraphQL?: boolean;
|
|
88
|
-
|
|
89
|
-
// Optional: Disable request/response body capture (defaults to false)
|
|
90
|
-
disableBodyCapture?: boolean;
|
|
91
|
-
|
|
92
|
-
// Optional: Filter or modify events before sending
|
|
93
|
-
beforeSend?: (event: LimelightMessage) => LimelightMessage | null;
|
|
94
|
-
});
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
### Example: Production-Safe Setup
|
|
38
|
+
### Web App (with project key)
|
|
98
39
|
|
|
99
40
|
```typescript
|
|
100
41
|
import { Limelight } from "@getlimelight/sdk";
|
|
101
42
|
|
|
102
43
|
Limelight.connect({
|
|
103
|
-
projectKey: "project-
|
|
104
|
-
enabled: __DEV__, // Only enable in development
|
|
105
|
-
appName: "MyAwesomeApp",
|
|
44
|
+
projectKey: "your-project-key",
|
|
106
45
|
});
|
|
107
46
|
```
|
|
108
47
|
|
|
109
|
-
###
|
|
48
|
+
### With State Inspection
|
|
110
49
|
|
|
111
50
|
```typescript
|
|
112
51
|
import { Limelight } from "@getlimelight/sdk";
|
|
52
|
+
import { useUserStore } from "./stores/user";
|
|
53
|
+
import { useCartStore } from "./stores/cart";
|
|
113
54
|
|
|
114
55
|
Limelight.connect({
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
### beforeSend Hook
|
|
121
|
-
|
|
122
|
-
Filter or modify events before they're sent to the server:
|
|
123
|
-
|
|
124
|
-
```typescript
|
|
125
|
-
import { Limelight } from "@getlimelight/sdk";
|
|
126
|
-
|
|
127
|
-
Limelight.connect({
|
|
128
|
-
beforeSend: (event) => {
|
|
129
|
-
// Filter out specific URLs
|
|
130
|
-
if (event.phase === "NETWORK" && event.url.includes("/analytics")) {
|
|
131
|
-
return null; // Don't send this event
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
// Redact sensitive data from console logs
|
|
135
|
-
if (event.phase === "CONSOLE") {
|
|
136
|
-
event.args = event.args.map((arg) =>
|
|
137
|
-
typeof arg === "string"
|
|
138
|
-
? arg.replace(/password=\w+/g, "password=***")
|
|
139
|
-
: arg
|
|
140
|
-
);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
return event;
|
|
56
|
+
stores: {
|
|
57
|
+
user: useUserStore,
|
|
58
|
+
cart: useCartStore,
|
|
144
59
|
},
|
|
145
60
|
});
|
|
146
61
|
```
|
|
147
62
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
### Network Requests
|
|
151
|
-
|
|
152
|
-
- ✅ Fetch API requests
|
|
153
|
-
- ✅ XMLHttpRequest (XHR)
|
|
154
|
-
- ✅ Request/response headers
|
|
155
|
-
- ✅ Request/response bodies
|
|
156
|
-
- ✅ GraphQL operations (queries, mutations, subscriptions)
|
|
157
|
-
- ✅ GraphQL complexity analysis
|
|
158
|
-
- ✅ Request timing and duration
|
|
159
|
-
- ✅ Error responses
|
|
160
|
-
|
|
161
|
-
**Automatically Redacted Headers:**
|
|
162
|
-
|
|
163
|
-
- `authorization`
|
|
164
|
-
- `cookie`
|
|
165
|
-
- `x-api-key`
|
|
166
|
-
- `x-auth-token`
|
|
167
|
-
- And more...
|
|
168
|
-
|
|
169
|
-
### Console Logs
|
|
170
|
-
|
|
171
|
-
- ✅ All console methods (log, warn, error, info, debug, trace)
|
|
172
|
-
- ✅ Stack traces
|
|
173
|
-
- ✅ Source detection (app, library, React Native, native)
|
|
174
|
-
- ✅ Timestamps
|
|
175
|
-
- ✅ Argument serialization (with circular reference handling)
|
|
176
|
-
|
|
177
|
-
### GraphQL Support
|
|
178
|
-
|
|
179
|
-
Limelight automatically detects and parses GraphQL operations:
|
|
180
|
-
|
|
181
|
-
```typescript
|
|
182
|
-
// This request will be detected as a GraphQL query
|
|
183
|
-
fetch("/graphql", {
|
|
184
|
-
method: "POST",
|
|
185
|
-
body: JSON.stringify({
|
|
186
|
-
query: `
|
|
187
|
-
query GetUser($id: ID!) {
|
|
188
|
-
user(id: $id) {
|
|
189
|
-
name
|
|
190
|
-
email
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
`,
|
|
194
|
-
variables: { id: "123" },
|
|
195
|
-
}),
|
|
196
|
-
});
|
|
197
|
-
|
|
198
|
-
// Limelight captures:
|
|
199
|
-
// - Operation type (query/mutation/subscription)
|
|
200
|
-
// - Operation name (GetUser)
|
|
201
|
-
// - Query complexity
|
|
202
|
-
// - Variables
|
|
203
|
-
// - Response data
|
|
204
|
-
```
|
|
205
|
-
|
|
206
|
-
## API Reference
|
|
207
|
-
|
|
208
|
-
### Limelight
|
|
209
|
-
|
|
210
|
-
#### Methods
|
|
211
|
-
|
|
212
|
-
##### `Limelight.connect(config?: LimelightConfig): void`
|
|
213
|
-
|
|
214
|
-
Connects to the Limelight server and starts intercepting network requests and console logs.
|
|
215
|
-
|
|
216
|
-
```typescript
|
|
217
|
-
import { Limelight } from "@getlimelight/sdk";
|
|
218
|
-
|
|
219
|
-
// Minimal usage
|
|
220
|
-
Limelight.connect({ projectKey: "project-123" });
|
|
221
|
-
|
|
222
|
-
// With configuration
|
|
223
|
-
Limelight.connect({
|
|
224
|
-
enabled: __DEV__,
|
|
225
|
-
appName: "MyApp",
|
|
226
|
-
projectKey: "project-123",
|
|
227
|
-
});
|
|
228
|
-
```
|
|
229
|
-
|
|
230
|
-
##### `Limelight.disconnect(): void`
|
|
231
|
-
|
|
232
|
-
Disconnects from the Limelight server and stops all interception.
|
|
233
|
-
|
|
234
|
-
```typescript
|
|
235
|
-
Limelight.disconnect();
|
|
236
|
-
```
|
|
237
|
-
|
|
238
|
-
## Event Types
|
|
239
|
-
|
|
240
|
-
### Network Events
|
|
241
|
-
|
|
242
|
-
```typescript
|
|
243
|
-
interface NetworkEvent {
|
|
244
|
-
id: string;
|
|
245
|
-
phase: "NETWORK_REQUEST" | "NETWORK_RESPONSE";
|
|
246
|
-
type: "NETWORK";
|
|
247
|
-
timestamp: number;
|
|
248
|
-
sessionId: string;
|
|
249
|
-
url: string;
|
|
250
|
-
method: string;
|
|
251
|
-
headers: Record<string, string>;
|
|
252
|
-
body?: string;
|
|
253
|
-
status?: number;
|
|
254
|
-
duration?: number;
|
|
255
|
-
isGraphQL?: boolean;
|
|
256
|
-
graphQLOperation?: {
|
|
257
|
-
type: "query" | "mutation" | "subscription";
|
|
258
|
-
name: string;
|
|
259
|
-
complexity: number;
|
|
260
|
-
};
|
|
261
|
-
}
|
|
262
|
-
```
|
|
263
|
-
|
|
264
|
-
### Console Events
|
|
265
|
-
|
|
266
|
-
```typescript
|
|
267
|
-
interface ConsoleEvent {
|
|
268
|
-
id: string;
|
|
269
|
-
phase: "CONSOLE";
|
|
270
|
-
type: "CONSOLE";
|
|
271
|
-
level: "log" | "warn" | "error" | "info" | "debug" | "trace";
|
|
272
|
-
timestamp: number;
|
|
273
|
-
sessionId: string;
|
|
274
|
-
source: "APP" | "LIBRARY" | "REACT_NATIVE" | "NATIVE";
|
|
275
|
-
args: string[];
|
|
276
|
-
stackTrace?: string;
|
|
277
|
-
}
|
|
278
|
-
```
|
|
279
|
-
|
|
280
|
-
## Advanced Usage
|
|
281
|
-
|
|
282
|
-
### Disable Specific Features
|
|
283
|
-
|
|
284
|
-
```typescript
|
|
285
|
-
import { Limelight } from "@getlimelight/sdk";
|
|
286
|
-
|
|
287
|
-
Limelight.connect({
|
|
288
|
-
projectKey: "project-123",
|
|
289
|
-
enableNetworkInspector: true, // Capture network requests
|
|
290
|
-
enableConsole: true, // Capture console logs
|
|
291
|
-
enableGraphQL: false, // Disable GraphQL parsing
|
|
292
|
-
disableBodyCapture: false, // Capture request/response bodies
|
|
293
|
-
});
|
|
294
|
-
```
|
|
295
|
-
|
|
296
|
-
### Environment-Specific Configuration
|
|
297
|
-
|
|
298
|
-
```typescript
|
|
299
|
-
import { Limelight } from "@getlimelight/sdk";
|
|
300
|
-
|
|
301
|
-
const getConfig = () => {
|
|
302
|
-
if (process.env.NODE_ENV === "production") {
|
|
303
|
-
return { enabled: false };
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
if (process.env.STAGING === "true") {
|
|
307
|
-
return {
|
|
308
|
-
serverUrl: "wss://limelight-staging.yourcompany.com",
|
|
309
|
-
enabled: true,
|
|
310
|
-
};
|
|
311
|
-
}
|
|
63
|
+
Works with **Zustand** and **Redux** out of the box.
|
|
312
64
|
|
|
313
|
-
|
|
314
|
-
projectKey: "project-123",
|
|
315
|
-
serverUrl: "ws://localhost:8080",
|
|
316
|
-
enabled: true,
|
|
317
|
-
};
|
|
318
|
-
};
|
|
319
|
-
|
|
320
|
-
Limelight.connect(getConfig());
|
|
321
|
-
```
|
|
322
|
-
|
|
323
|
-
### Filtering Sensitive Routes
|
|
65
|
+
## Configuration
|
|
324
66
|
|
|
325
67
|
```typescript
|
|
326
|
-
import { Limelight } from "@getlimelight/sdk";
|
|
327
|
-
|
|
328
|
-
const SENSITIVE_ROUTES = ["/auth", "/payment", "/checkout"];
|
|
329
|
-
|
|
330
68
|
Limelight.connect({
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
const isSensitive = SENSITIVE_ROUTES.some((route) =>
|
|
334
|
-
event.url.includes(route)
|
|
335
|
-
);
|
|
69
|
+
// Connect to web app (optional for desktop)
|
|
70
|
+
projectKey: "your-project-key",
|
|
336
71
|
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
return event;
|
|
72
|
+
// State stores to inspect
|
|
73
|
+
stores: {
|
|
74
|
+
user: useUserStore,
|
|
75
|
+
cart: useCartStore,
|
|
343
76
|
},
|
|
344
|
-
});
|
|
345
|
-
```
|
|
346
|
-
|
|
347
|
-
## TypeScript Support
|
|
348
|
-
|
|
349
|
-
Limelight is written in TypeScript and provides full type definitions:
|
|
350
|
-
|
|
351
|
-
```typescript
|
|
352
|
-
import {
|
|
353
|
-
Limelight,
|
|
354
|
-
LimelightConfig,
|
|
355
|
-
LimelightMessage,
|
|
356
|
-
NetworkEvent,
|
|
357
|
-
ConsoleEvent,
|
|
358
|
-
} from "@getlimelight/sdk";
|
|
359
77
|
|
|
360
|
-
|
|
78
|
+
// Feature flags (all default to true)
|
|
361
79
|
enabled: __DEV__,
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
console.log(event.url); // TypeScript knows this exists
|
|
367
|
-
}
|
|
80
|
+
enableNetworkInspector: true,
|
|
81
|
+
enableConsole: true,
|
|
82
|
+
enableStateInspector: true,
|
|
83
|
+
enableRenderInspector: true,
|
|
368
84
|
|
|
369
|
-
|
|
370
|
-
},
|
|
371
|
-
};
|
|
372
|
-
|
|
373
|
-
Limelight.connect(config);
|
|
374
|
-
```
|
|
375
|
-
|
|
376
|
-
## Performance
|
|
377
|
-
|
|
378
|
-
Limelight is designed to have minimal performance impact:
|
|
379
|
-
|
|
380
|
-
- **Non-blocking**: All network interception happens asynchronously
|
|
381
|
-
- **Efficient serialization**: Smart stringification with circular reference handling
|
|
382
|
-
- **Message queuing**: Buffers messages when disconnected to prevent blocking
|
|
383
|
-
- **Configurable depth limits**: Prevents deep object traversal overhead
|
|
384
|
-
- **Production safe**: Easy to disable in production builds
|
|
385
|
-
|
|
386
|
-
## Security & Privacy
|
|
387
|
-
|
|
388
|
-
### Automatic Redaction
|
|
389
|
-
|
|
390
|
-
Limelight automatically redacts sensitive headers:
|
|
391
|
-
|
|
392
|
-
- Authorization tokens
|
|
393
|
-
- API keys
|
|
394
|
-
- Cookies
|
|
395
|
-
- Session tokens
|
|
396
|
-
|
|
397
|
-
### Custom Filtering
|
|
398
|
-
|
|
399
|
-
Use the `beforeSend` hook to implement custom privacy rules:
|
|
400
|
-
|
|
401
|
-
```typescript
|
|
402
|
-
import { Limelight } from "@getlimelight/sdk";
|
|
403
|
-
|
|
404
|
-
Limelight.connect({
|
|
85
|
+
// Filter or modify events
|
|
405
86
|
beforeSend: (event) => {
|
|
406
|
-
//
|
|
407
|
-
if (event.phase === "NETWORK_REQUEST" && event.body) {
|
|
408
|
-
try {
|
|
409
|
-
const body = JSON.parse(event.body);
|
|
410
|
-
delete body.ssn;
|
|
411
|
-
delete body.creditCard;
|
|
412
|
-
event.body = JSON.stringify(body);
|
|
413
|
-
} catch {
|
|
414
|
-
// Not JSON, leave as-is
|
|
415
|
-
}
|
|
416
|
-
}
|
|
87
|
+
// Return null to filter out, or modify and return
|
|
417
88
|
return event;
|
|
418
89
|
},
|
|
419
90
|
});
|
|
420
91
|
```
|
|
421
92
|
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
For maximum privacy, disable request/response body capture entirely:
|
|
425
|
-
|
|
426
|
-
```typescript
|
|
427
|
-
Limelight.connect({
|
|
428
|
-
projectKey: "project-123",
|
|
429
|
-
disableBodyCapture: true, // Only capture headers and metadata
|
|
430
|
-
});
|
|
431
|
-
```
|
|
93
|
+
## Learn More
|
|
432
94
|
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
1. **Check your server is running** - Make sure the Limelight server is running on the specified port
|
|
440
|
-
2. **Verify the URL** - Default is `ws://localhost:8080`, but you may need your computer's IP address for physical devices
|
|
441
|
-
3. **Enable in config** - Ensure `enabled: true` (or omit it, as it defaults to true)
|
|
442
|
-
|
|
443
|
-
```typescript
|
|
444
|
-
import { Limelight } from "@getlimelight/sdk";
|
|
445
|
-
|
|
446
|
-
// For physical devices, use your computer's IP
|
|
447
|
-
Limelight.connect({
|
|
448
|
-
projectKey: "project-123",
|
|
449
|
-
serverUrl: "ws://192.168.1.100:8080", // Replace with your IP
|
|
450
|
-
enabled: true,
|
|
451
|
-
});
|
|
452
|
-
```
|
|
453
|
-
|
|
454
|
-
### Not Seeing Network Requests
|
|
455
|
-
|
|
456
|
-
1. Make sure `enableNetworkInspector` is not set to `false`
|
|
457
|
-
2. Ensure `Limelight.connect()` is called early in your app
|
|
458
|
-
3. Check if `beforeSend` is filtering out requests
|
|
459
|
-
|
|
460
|
-
### Console Logs Not Appearing
|
|
461
|
-
|
|
462
|
-
1. Ensure `enableConsole` is not set to `false`
|
|
463
|
-
2. Verify `Limelight.connect()` is called before logs occur
|
|
464
|
-
3. Check the WebSocket connection is established
|
|
465
|
-
|
|
466
|
-
## Examples
|
|
467
|
-
|
|
468
|
-
See the `/examples` directory for complete working examples:
|
|
469
|
-
|
|
470
|
-
- Basic React Native app
|
|
471
|
-
- Expo app with environment configuration
|
|
472
|
-
- Next.js web application
|
|
473
|
-
- Custom filtering and privacy controls
|
|
95
|
+
- [Quick Start Guide](https://docs.getlimelight.io/quickstart)
|
|
96
|
+
- [State Inspection](https://docs.getlimelight.io/features/state)
|
|
97
|
+
- [Network Monitoring](https://docs.getlimelight.io/features/network)
|
|
98
|
+
- [Console Streaming](https://docs.getlimelight.io/features/console)
|
|
99
|
+
- [Render Tracking](https://docs.getlimelight.io/features/renders)
|
|
100
|
+
- [Configuration Reference](https://docs.getlimelight.io/configuration)
|
|
474
101
|
|
|
475
102
|
## License
|
|
476
103
|
|
|
477
|
-
MIT ©
|
|
478
|
-
|
|
479
|
-
## Support
|
|
480
|
-
|
|
481
|
-
- 📧 Email: hello@getlimelight.io
|
|
482
|
-
- 🐛 Issues: [GitHub Issues](https://github.com/getlimelight/limelight/issues)
|
|
104
|
+
MIT © Limelight
|
|
483
105
|
|
|
484
106
|
---
|
|
485
107
|
|
|
486
|
-
|
|
108
|
+
[Documentation](https://docs.getlimelight.io) · [GitHub](https://github.com/getlimelight/limelight) · [Issues](https://github.com/getlimelight/limelight/issues)
|
package/dist/index.d.mts
CHANGED
|
@@ -426,7 +426,7 @@ interface LimelightConfig {
|
|
|
426
426
|
/**
|
|
427
427
|
* Flag to enable or disable internal logging for the Limelight SDK
|
|
428
428
|
*/
|
|
429
|
-
|
|
429
|
+
enableInternalLogging?: boolean;
|
|
430
430
|
/**
|
|
431
431
|
* A callback function to modify or filter events before they are sent to the server
|
|
432
432
|
*/
|
|
@@ -470,6 +470,26 @@ interface ParsedStackTrace {
|
|
|
470
470
|
raw: string;
|
|
471
471
|
}
|
|
472
472
|
|
|
473
|
+
interface RequestBridgeConfig {
|
|
474
|
+
url: string;
|
|
475
|
+
method?: HttpMethod | string;
|
|
476
|
+
headers?: Record<string, string>;
|
|
477
|
+
body?: any;
|
|
478
|
+
name?: string;
|
|
479
|
+
graphql?: {
|
|
480
|
+
operationName?: string;
|
|
481
|
+
operationType?: GraphqlOprtation | "query" | "mutation" | "subscription";
|
|
482
|
+
variables?: any;
|
|
483
|
+
query?: string;
|
|
484
|
+
};
|
|
485
|
+
}
|
|
486
|
+
interface ResponseBridgeConfig {
|
|
487
|
+
status: number;
|
|
488
|
+
statusText?: string;
|
|
489
|
+
headers?: Record<string, string>;
|
|
490
|
+
body?: any;
|
|
491
|
+
}
|
|
492
|
+
|
|
473
493
|
declare class LimelightClient {
|
|
474
494
|
private ws;
|
|
475
495
|
private config;
|
|
@@ -485,6 +505,7 @@ declare class LimelightClient {
|
|
|
485
505
|
private consoleInterceptor;
|
|
486
506
|
private renderInterceptor;
|
|
487
507
|
private stateInterceptor;
|
|
508
|
+
private requestBridge;
|
|
488
509
|
constructor();
|
|
489
510
|
/**
|
|
490
511
|
* Configures the Limelight client with the provided settings.
|
|
@@ -545,6 +566,29 @@ declare class LimelightClient {
|
|
|
545
566
|
* @returns {void}
|
|
546
567
|
*/
|
|
547
568
|
reset(): void;
|
|
569
|
+
/**
|
|
570
|
+
* Manually register a request with Limelight.
|
|
571
|
+
* Use this when your app makes network requests outside of fetch/XHR
|
|
572
|
+
* (e.g., through native modules).
|
|
573
|
+
*
|
|
574
|
+
* @param config - Request configuration
|
|
575
|
+
* @returns A request ID to use with endRequest() or failRequest()
|
|
576
|
+
*/
|
|
577
|
+
startRequest(config: RequestBridgeConfig): string;
|
|
578
|
+
/**
|
|
579
|
+
* Complete a manually tracked request with a successful response.
|
|
580
|
+
*
|
|
581
|
+
* @param requestId - The ID returned from startRequest()
|
|
582
|
+
* @param response - Response data
|
|
583
|
+
*/
|
|
584
|
+
endRequest(requestId: string, response: ResponseBridgeConfig): void;
|
|
585
|
+
/**
|
|
586
|
+
* Complete a manually tracked request with an error.
|
|
587
|
+
*
|
|
588
|
+
* @param requestId - The ID returned from startRequest()
|
|
589
|
+
* @param error - The error that occurred
|
|
590
|
+
*/
|
|
591
|
+
failRequest(requestId: string, error: Error | string): void;
|
|
548
592
|
}
|
|
549
593
|
declare const Limelight: LimelightClient;
|
|
550
594
|
|
|
@@ -562,4 +606,4 @@ declare global {
|
|
|
562
606
|
}
|
|
563
607
|
}
|
|
564
608
|
|
|
565
|
-
export { type BaseNetworkEvent, BodyFormat, type ConnectEvent, type ConnectionEvent, type ConsoleEvent, ConsoleLevel, ConsoleSource, ConsoleType, EventType, type GraphQLRequest, type GraphQLResponse, GraphqlOprtation, HttpMethod, HttpStatusClass, Limelight, type LimelightConfig, type LimelightEvent, type LimelightMessage, type NetworkErrorEvent, type NetworkEvent, NetworkPhase, type NetworkRequest, type NetworkRequestWithResponse, type NetworkResponse, NetworkType, type ParsedStackTrace, type SerializedBody, type Session, type StackFrame };
|
|
609
|
+
export { type BaseNetworkEvent, BodyFormat, type ConnectEvent, type ConnectionEvent, type ConsoleEvent, ConsoleLevel, ConsoleSource, ConsoleType, EventType, type GraphQLRequest, type GraphQLResponse, GraphqlOprtation, HttpMethod, HttpStatusClass, Limelight, type LimelightConfig, type LimelightEvent, type LimelightMessage, type NetworkErrorEvent, type NetworkEvent, NetworkPhase, type NetworkRequest, type NetworkRequestWithResponse, type NetworkResponse, NetworkType, type ParsedStackTrace, type RequestBridgeConfig, type ResponseBridgeConfig, type SerializedBody, type Session, type StackFrame };
|
package/dist/index.d.ts
CHANGED
|
@@ -426,7 +426,7 @@ interface LimelightConfig {
|
|
|
426
426
|
/**
|
|
427
427
|
* Flag to enable or disable internal logging for the Limelight SDK
|
|
428
428
|
*/
|
|
429
|
-
|
|
429
|
+
enableInternalLogging?: boolean;
|
|
430
430
|
/**
|
|
431
431
|
* A callback function to modify or filter events before they are sent to the server
|
|
432
432
|
*/
|
|
@@ -470,6 +470,26 @@ interface ParsedStackTrace {
|
|
|
470
470
|
raw: string;
|
|
471
471
|
}
|
|
472
472
|
|
|
473
|
+
interface RequestBridgeConfig {
|
|
474
|
+
url: string;
|
|
475
|
+
method?: HttpMethod | string;
|
|
476
|
+
headers?: Record<string, string>;
|
|
477
|
+
body?: any;
|
|
478
|
+
name?: string;
|
|
479
|
+
graphql?: {
|
|
480
|
+
operationName?: string;
|
|
481
|
+
operationType?: GraphqlOprtation | "query" | "mutation" | "subscription";
|
|
482
|
+
variables?: any;
|
|
483
|
+
query?: string;
|
|
484
|
+
};
|
|
485
|
+
}
|
|
486
|
+
interface ResponseBridgeConfig {
|
|
487
|
+
status: number;
|
|
488
|
+
statusText?: string;
|
|
489
|
+
headers?: Record<string, string>;
|
|
490
|
+
body?: any;
|
|
491
|
+
}
|
|
492
|
+
|
|
473
493
|
declare class LimelightClient {
|
|
474
494
|
private ws;
|
|
475
495
|
private config;
|
|
@@ -485,6 +505,7 @@ declare class LimelightClient {
|
|
|
485
505
|
private consoleInterceptor;
|
|
486
506
|
private renderInterceptor;
|
|
487
507
|
private stateInterceptor;
|
|
508
|
+
private requestBridge;
|
|
488
509
|
constructor();
|
|
489
510
|
/**
|
|
490
511
|
* Configures the Limelight client with the provided settings.
|
|
@@ -545,6 +566,29 @@ declare class LimelightClient {
|
|
|
545
566
|
* @returns {void}
|
|
546
567
|
*/
|
|
547
568
|
reset(): void;
|
|
569
|
+
/**
|
|
570
|
+
* Manually register a request with Limelight.
|
|
571
|
+
* Use this when your app makes network requests outside of fetch/XHR
|
|
572
|
+
* (e.g., through native modules).
|
|
573
|
+
*
|
|
574
|
+
* @param config - Request configuration
|
|
575
|
+
* @returns A request ID to use with endRequest() or failRequest()
|
|
576
|
+
*/
|
|
577
|
+
startRequest(config: RequestBridgeConfig): string;
|
|
578
|
+
/**
|
|
579
|
+
* Complete a manually tracked request with a successful response.
|
|
580
|
+
*
|
|
581
|
+
* @param requestId - The ID returned from startRequest()
|
|
582
|
+
* @param response - Response data
|
|
583
|
+
*/
|
|
584
|
+
endRequest(requestId: string, response: ResponseBridgeConfig): void;
|
|
585
|
+
/**
|
|
586
|
+
* Complete a manually tracked request with an error.
|
|
587
|
+
*
|
|
588
|
+
* @param requestId - The ID returned from startRequest()
|
|
589
|
+
* @param error - The error that occurred
|
|
590
|
+
*/
|
|
591
|
+
failRequest(requestId: string, error: Error | string): void;
|
|
548
592
|
}
|
|
549
593
|
declare const Limelight: LimelightClient;
|
|
550
594
|
|
|
@@ -562,4 +606,4 @@ declare global {
|
|
|
562
606
|
}
|
|
563
607
|
}
|
|
564
608
|
|
|
565
|
-
export { type BaseNetworkEvent, BodyFormat, type ConnectEvent, type ConnectionEvent, type ConsoleEvent, ConsoleLevel, ConsoleSource, ConsoleType, EventType, type GraphQLRequest, type GraphQLResponse, GraphqlOprtation, HttpMethod, HttpStatusClass, Limelight, type LimelightConfig, type LimelightEvent, type LimelightMessage, type NetworkErrorEvent, type NetworkEvent, NetworkPhase, type NetworkRequest, type NetworkRequestWithResponse, type NetworkResponse, NetworkType, type ParsedStackTrace, type SerializedBody, type Session, type StackFrame };
|
|
609
|
+
export { type BaseNetworkEvent, BodyFormat, type ConnectEvent, type ConnectionEvent, type ConsoleEvent, ConsoleLevel, ConsoleSource, ConsoleType, EventType, type GraphQLRequest, type GraphQLResponse, GraphqlOprtation, HttpMethod, HttpStatusClass, Limelight, type LimelightConfig, type LimelightEvent, type LimelightMessage, type NetworkErrorEvent, type NetworkEvent, NetworkPhase, type NetworkRequest, type NetworkRequestWithResponse, type NetworkResponse, NetworkType, type ParsedStackTrace, type RequestBridgeConfig, type ResponseBridgeConfig, type SerializedBody, type Session, type StackFrame };
|