@eventra_dev/eventra-sdk 0.1.9 → 0.1.11

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
@@ -6,6 +6,14 @@
6
6
 
7
7
  Eventra SDK allows you to send **feature usage and product analytics events** to the Eventra platform.
8
8
 
9
+ Eventra helps you:
10
+
11
+ - Track feature adoption
12
+ - Detect unused features
13
+ - Understand user behavior
14
+ - Monitor backend usage
15
+ - Analyze product growth
16
+
9
17
  It is designed to be:
10
18
 
11
19
  * lightweight
@@ -54,6 +62,94 @@ tracker.track("checkout.completed", {
54
62
  });
55
63
  ```
56
64
 
65
+ That's it. Events are automatically:
66
+
67
+ - batched
68
+ - retried
69
+ - flushed
70
+
71
+ ---
72
+
73
+ # Event Properties
74
+
75
+ Eventra allows you to pass **optional properties** with every event.
76
+
77
+ Properties are completely flexible — you can send **any JSON-compatible data**.
78
+
79
+ ```ts
80
+ tracker.track("checkout.completed", {
81
+ userId: "user_123",
82
+ properties: {
83
+ plan: "pro",
84
+ price: 29,
85
+ currency: "USD"
86
+ }
87
+ });
88
+ ```
89
+
90
+ Properties are optional:
91
+
92
+ ```ts
93
+ tracker.track("app.loaded");
94
+ ```
95
+
96
+ Or with userId only:
97
+
98
+ ```ts
99
+ tracker.track("user.login", {
100
+ userId: "user_123"
101
+ });
102
+ ```
103
+
104
+ ---
105
+
106
+ # Common Examples
107
+
108
+ ## Feature Usage
109
+
110
+ ```ts
111
+ tracker.track("feature.used", {
112
+ userId: "user_123",
113
+ properties: {
114
+ feature: "dashboard",
115
+ section: "analytics"
116
+ }
117
+ });
118
+ ```
119
+
120
+ ## Page View
121
+
122
+ ```ts
123
+ tracker.track("page.viewed", {
124
+ properties: {
125
+ path: window.location.pathname
126
+ }
127
+ });
128
+ ```
129
+
130
+ ## API Usage
131
+
132
+ ```ts
133
+ tracker.track("api.request", {
134
+ properties: {
135
+ endpoint: "/checkout",
136
+ method: "POST",
137
+ status: 200
138
+ }
139
+ });
140
+ ```
141
+
142
+ ## Error Tracking
143
+
144
+ ```ts
145
+ tracker.track("error.occurred", {
146
+ properties: {
147
+ message: "Payment failed",
148
+ code: "PAYMENT_ERROR"
149
+ }
150
+ });
151
+ ```
152
+
57
153
  ---
58
154
 
59
155
  # Where You Can Use Eventra SDK
@@ -208,8 +304,6 @@ app.post("/checkout", (req, res) => {
208
304
 
209
305
  # Vanilla JavaScript (CDN)
210
306
 
211
- You can use Eventra without a bundler.
212
-
213
307
  ```html
214
308
  <script type="module">
215
309
 
@@ -228,8 +322,6 @@ tracker.track("page.viewed");
228
322
 
229
323
  # Configuration
230
324
 
231
- You can configure the SDK behaviour.
232
-
233
325
  ```ts
234
326
  const eventra = new Eventra({
235
327
 
@@ -261,8 +353,6 @@ const eventra = new Eventra({
261
353
 
262
354
  # Multi-Tab Mode (Browser)
263
355
 
264
- To avoid duplicate event sending across multiple tabs:
265
-
266
356
  ```ts
267
357
  const tracker = new Eventra({
268
358
  apiKey: "YOUR_PROJECT_API_KEY",
@@ -314,7 +404,7 @@ Events are sent in batches:
314
404
  "sentAt": "2026-03-12T10:00:00Z",
315
405
  "sdk": {
316
406
  "name": "@eventra_dev/eventra-sdk",
317
- "version": "0.1.9",
407
+ "version": "0.1.10",
318
408
  "runtime": "node"
319
409
  },
320
410
  "events": [
@@ -330,14 +420,6 @@ Events are sent in batches:
330
420
 
331
421
  ---
332
422
 
333
- # Error Handling
334
-
335
- Client errors (4xx) are **not retried**.
336
-
337
- Server errors (5xx) are retried using **exponential backoff**.
338
-
339
- ---
340
-
341
423
  # Documentation
342
424
 
343
425
  Full documentation:
package/dist/index.cjs CHANGED
@@ -25,9 +25,9 @@ __export(index_exports, {
25
25
  module.exports = __toCommonJS(index_exports);
26
26
 
27
27
  // src/client.ts
28
- var SDK_VERSION = "0.1.9";
28
+ var SDK_VERSION = "0.1.11";
29
29
  var DEFAULTS = {
30
- endpoint: "http://api.eventra.dev/api/v1/ingest/batch",
30
+ endpoint: "https://api.eventra.dev/api/v1/ingest/batch",
31
31
  flushInterval: 2e3,
32
32
  maxBatchSize: 50,
33
33
  maxQueueSize: 1e4,
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  // src/client.ts
2
- var SDK_VERSION = "0.1.9";
2
+ var SDK_VERSION = "0.1.11";
3
3
  var DEFAULTS = {
4
- endpoint: "http://api.eventra.dev/api/v1/ingest/batch",
4
+ endpoint: "https://api.eventra.dev/api/v1/ingest/batch",
5
5
  flushInterval: 2e3,
6
6
  maxBatchSize: 50,
7
7
  maxQueueSize: 1e4,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eventra_dev/eventra-sdk",
3
- "version": "0.1.9",
3
+ "version": "0.1.11",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"