@eventra_dev/eventra-sdk 1.0.2 → 1.0.4

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