@eventra_dev/eventra-sdk 1.0.2 → 1.0.3

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 CHANGED
@@ -1,28 +1,38 @@
1
+ ```{=html}
2
+ <p align="center">
3
+ ```
4
+ `<img src="https://eventra.dev/eventra-icon-animated.svg" width="120" />`{=html}
5
+ ```{=html}
6
+ </p>
7
+ ```
1
8
  # Eventra SDK
2
9
 
3
- [![npm version](https://img.shields.io/npm/v/@eventra_dev/eventra-sdk.svg)](https://www.npmjs.com/package/@eventra_dev/eventra-sdk)
4
- [![npm downloads](https://img.shields.io/npm/dm/@eventra_dev/eventra-sdk.svg)](https://www.npmjs.com/package/@eventra_dev/eventra-sdk)
10
+ [![npm
11
+ version](https://img.shields.io/npm/v/@eventra_dev/eventra-sdk.svg)](https://www.npmjs.com/package/@eventra_dev/eventra-sdk)
12
+ [![npm
13
+ downloads](https://img.shields.io/npm/dm/@eventra_dev/eventra-sdk.svg)](https://www.npmjs.com/package/@eventra_dev/eventra-sdk)
5
14
  [![TypeScript](https://img.shields.io/badge/typescript-ready-blue.svg)](https://www.typescriptlang.org/)
6
15
 
7
- Eventra SDK allows you to send **feature usage and product analytics events** to the Eventra platform.
16
+ Eventra SDK allows you to send **feature usage and product analytics
17
+ events** to the Eventra platform.
8
18
 
9
19
  Eventra helps you:
10
20
 
11
- - Track feature adoption
12
- - Detect unused features
13
- - Understand user behavior
14
- - Monitor backend usage
15
- - Analyze product growth
21
+ - Track feature adoption
22
+ - Detect unused features
23
+ - Understand user behavior
24
+ - Monitor backend usage
25
+ - Analyze product growth
16
26
 
17
27
  It is designed to be:
18
28
 
19
- * lightweight
20
- * runtime-agnostic
21
- * resilient (batching + retry)
22
- * production-safe
23
- * TypeScript-first
29
+ - lightweight
30
+ - runtime-agnostic
31
+ - resilient (batching + retry)
32
+ - production-safe
33
+ - TypeScript-first
24
34
 
25
- ---
35
+ ------------------------------------------------------------------------
26
36
 
27
37
  # Installation
28
38
 
@@ -30,27 +40,27 @@ Install the SDK using your preferred package manager.
30
40
 
31
41
  ### npm
32
42
 
33
- ```bash
43
+ ``` bash
34
44
  npm i @eventra_dev/eventra-sdk
35
45
  ```
36
46
 
37
47
  ### pnpm
38
48
 
39
- ```bash
49
+ ``` bash
40
50
  pnpm add @eventra_dev/eventra-sdk
41
51
  ```
42
52
 
43
53
  ### yarn
44
54
 
45
- ```bash
55
+ ``` bash
46
56
  yarn add @eventra_dev/eventra-sdk
47
57
  ```
48
58
 
49
- ---
59
+ ------------------------------------------------------------------------
50
60
 
51
61
  # Quick Start
52
62
 
53
- ```ts
63
+ ``` ts
54
64
  import { Eventra } from "@eventra_dev/eventra-sdk";
55
65
 
56
66
  const tracker = new Eventra({
@@ -64,11 +74,11 @@ tracker.track("checkout.completed", {
64
74
 
65
75
  That's it. Events are automatically:
66
76
 
67
- - batched
68
- - retried
69
- - flushed
77
+ - batched
78
+ - retried
79
+ - flushed
70
80
 
71
- ---
81
+ ------------------------------------------------------------------------
72
82
 
73
83
  # Event Properties
74
84
 
@@ -101,7 +111,7 @@ tracker.track("user.login", {
101
111
  });
102
112
  ```
103
113
 
104
- ---
114
+ ------------------------------------------------------------------------
105
115
 
106
116
  # Common Examples
107
117
 
@@ -150,7 +160,7 @@ tracker.track("error.occurred", {
150
160
  });
151
161
  ```
152
162
 
153
- ---
163
+ ------------------------------------------------------------------------
154
164
 
155
165
  # Where You Can Use Eventra SDK
156
166
 
@@ -167,7 +177,7 @@ Eventra SDK works in many environments:
167
177
  * Bun
168
178
  * Deno
169
179
 
170
- ---
180
+ ------------------------------------------------------------------------
171
181
 
172
182
  # Browser Usage
173
183
 
@@ -191,7 +201,7 @@ The SDK automatically:
191
201
  * retries failed requests
192
202
  * flushes on page exit
193
203
 
194
- ---
204
+ ------------------------------------------------------------------------
195
205
 
196
206
  # React Usage
197
207
 
@@ -213,7 +223,7 @@ export function App() {
213
223
  }
214
224
  ```
215
225
 
216
- ---
226
+ ------------------------------------------------------------------------
217
227
 
218
228
  # Next.js Usage
219
229
 
@@ -239,7 +249,7 @@ export function CheckoutButton() {
239
249
  }
240
250
  ```
241
251
 
242
- ---
252
+ ------------------------------------------------------------------------
243
253
 
244
254
  # Node.js Usage
245
255
 
@@ -255,7 +265,7 @@ tracker.track("invoice.created", {
255
265
  });
256
266
  ```
257
267
 
258
- ---
268
+ ------------------------------------------------------------------------
259
269
 
260
270
  # NestJS Usage
261
271
 
@@ -278,7 +288,7 @@ export class BillingService {
278
288
  }
279
289
  ```
280
290
 
281
- ---
291
+ ------------------------------------------------------------------------
282
292
 
283
293
  # Express Usage
284
294
 
@@ -300,7 +310,7 @@ app.post("/checkout", (req, res) => {
300
310
  });
301
311
  ```
302
312
 
303
- ---
313
+ ------------------------------------------------------------------------
304
314
 
305
315
  # Vanilla JavaScript (CDN)
306
316
 
@@ -318,7 +328,7 @@ tracker.track("page.viewed");
318
328
  </script>
319
329
  ```
320
330
 
321
- ---
331
+ ------------------------------------------------------------------------
322
332
 
323
333
  # Configuration
324
334
 
@@ -335,7 +345,7 @@ const eventra = new Eventra({
335
345
  });
336
346
  ```
337
347
 
338
- ---
348
+ ------------------------------------------------------------------------
339
349
 
340
350
  # Options
341
351
 
@@ -349,7 +359,7 @@ const eventra = new Eventra({
349
359
  | maxRetries | Retry attempts for failed requests |
350
360
  | multiTabMode | Browser tab coordination mode |
351
361
 
352
- ---
362
+ ------------------------------------------------------------------------
353
363
 
354
364
  # Multi-Tab Mode (Browser)
355
365
 
@@ -370,7 +380,7 @@ Only one tab will send events.
370
380
  await tracker.flush();
371
381
  ```
372
382
 
373
- ---
383
+ ------------------------------------------------------------------------
374
384
 
375
385
  # Shutdown / Cleanup
376
386
 
@@ -380,7 +390,7 @@ tracker.destroy();
380
390
 
381
391
  Stops timers and prevents further event sending.
382
392
 
383
- ---
393
+ ------------------------------------------------------------------------
384
394
 
385
395
  # Runtime Support
386
396
 
@@ -393,7 +403,7 @@ Eventra SDK works in:
393
403
  * Edge runtimes
394
404
  * Serverless environments
395
405
 
396
- ---
406
+ ------------------------------------------------------------------------
397
407
 
398
408
  # Event Format
399
409
 
@@ -418,7 +428,7 @@ Events are sent in batches:
418
428
  }
419
429
  ```
420
430
 
421
- ---
431
+ ------------------------------------------------------------------------
422
432
 
423
433
  # Documentation
424
434
 
@@ -426,7 +436,7 @@ Full documentation:
426
436
 
427
437
  https://eventra.dev/docs
428
438
 
429
- ---
439
+ ------------------------------------------------------------------------
430
440
 
431
441
  # License
432
442
 
package/dist/index.cjs CHANGED
@@ -25,7 +25,7 @@ __export(index_exports, {
25
25
  module.exports = __toCommonJS(index_exports);
26
26
 
27
27
  // src/client.ts
28
- var SDK_VERSION = "1.0.2";
28
+ var SDK_VERSION = "1.0.3";
29
29
  var DEFAULTS = {
30
30
  endpoint: "https://api.eventra.dev/api/v1/ingest/batch",
31
31
  flushInterval: 2e3,
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  // src/client.ts
2
- var SDK_VERSION = "1.0.2";
2
+ var SDK_VERSION = "1.0.3";
3
3
  var DEFAULTS = {
4
4
  endpoint: "https://api.eventra.dev/api/v1/ingest/batch",
5
5
  flushInterval: 2e3,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eventra_dev/eventra-sdk",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"