@stacksee/analytics 0.8.0 → 0.9.0

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.
@@ -8,6 +8,11 @@ interface BentoClient {
8
8
  updateFields(fields: Record<string, unknown>): void;
9
9
  getEmail(): string | null;
10
10
  getName(): string | null;
11
+ showSurveyForm(element: HTMLElement, surveyId: string, type?: "popup" | "inline"): void;
12
+ spamCheck(email: string): Promise<boolean>;
13
+ showChat?(): void;
14
+ hideChat?(): void;
15
+ openChat?(): void;
11
16
  }
12
17
  export interface BentoClientConfig {
13
18
  /**
@@ -43,5 +48,101 @@ export declare class BentoClientProvider extends BaseAnalyticsProvider {
43
48
  pageView(properties?: Record<string, unknown>, context?: EventContext): void;
44
49
  pageLeave(properties?: Record<string, unknown>, context?: EventContext): void;
45
50
  reset(): void;
51
+ /**
52
+ * Add a tag to the current user
53
+ *
54
+ * @example
55
+ * ```typescript
56
+ * bentoProvider.tag('premium_user');
57
+ * bentoProvider.tag('beta_tester');
58
+ * ```
59
+ */
60
+ tag(tag: string): void;
61
+ /**
62
+ * Get the current user's email address
63
+ *
64
+ * @returns The user's email or null if not identified
65
+ *
66
+ * @example
67
+ * ```typescript
68
+ * const email = bentoProvider.getEmail();
69
+ * if (email) {
70
+ * console.log('Current user:', email);
71
+ * }
72
+ * ```
73
+ */
74
+ getEmail(): string | null;
75
+ /**
76
+ * Get the current user's name
77
+ *
78
+ * @returns The user's name or null if not set
79
+ *
80
+ * @example
81
+ * ```typescript
82
+ * const name = bentoProvider.getName();
83
+ * if (name) {
84
+ * console.log('Welcome back,', name);
85
+ * }
86
+ * ```
87
+ */
88
+ getName(): string | null;
89
+ /**
90
+ * Show a Bento survey form
91
+ *
92
+ * @param element - The HTML element to render the survey in
93
+ * @param surveyId - The survey ID from your Bento account
94
+ * @param type - Display type: 'popup' or 'inline' (default: 'popup')
95
+ *
96
+ * @example
97
+ * ```typescript
98
+ * const container = document.getElementById('survey-container');
99
+ * if (container) {
100
+ * bentoProvider.showSurveyForm(container, 'survey-123', 'popup');
101
+ * }
102
+ * ```
103
+ */
104
+ showSurveyForm(element: HTMLElement, surveyId: string, type?: "popup" | "inline"): void;
105
+ /**
106
+ * Validate an email address using Bento's spam check
107
+ *
108
+ * @param email - The email address to validate
109
+ * @returns Promise that resolves to true if email is valid, false if spam
110
+ *
111
+ * @example
112
+ * ```typescript
113
+ * const isValid = await bentoProvider.spamCheck('user@example.com');
114
+ * if (!isValid) {
115
+ * console.log('Invalid or spam email detected');
116
+ * }
117
+ * ```
118
+ */
119
+ spamCheck(email: string): Promise<boolean>;
120
+ /**
121
+ * Show the Bento chat widget
122
+ *
123
+ * @example
124
+ * ```typescript
125
+ * bentoProvider.showChat();
126
+ * ```
127
+ */
128
+ showChat(): void;
129
+ /**
130
+ * Hide the Bento chat widget
131
+ *
132
+ * @example
133
+ * ```typescript
134
+ * bentoProvider.hideChat();
135
+ * ```
136
+ */
137
+ hideChat(): void;
138
+ /**
139
+ * Open the Bento chat widget
140
+ *
141
+ * @example
142
+ * ```typescript
143
+ * bentoProvider.openChat();
144
+ * ```
145
+ */
146
+ openChat(): void;
46
147
  }
47
148
  export {};
@@ -1,10 +1,10 @@
1
1
  var u = Object.defineProperty;
2
- var f = (h, n, i) => n in h ? u(h, n, { enumerable: !0, configurable: !0, writable: !0, value: i }) : h[n] = i;
3
- var r = (h, n, i) => f(h, typeof n != "symbol" ? n + "" : n, i);
4
- import { B as o } from "../base.provider-AfFL5W_P.js";
5
- import { i as l } from "../client-DTHZYkxx.js";
2
+ var f = (l, h, i) => h in l ? u(l, h, { enumerable: !0, configurable: !0, writable: !0, value: i }) : l[h] = i;
3
+ var r = (l, h, i) => f(l, typeof h != "symbol" ? h + "" : h, i);
4
+ import { B as d } from "../base.provider-AfFL5W_P.js";
5
+ import { i as a } from "../client-DTHZYkxx.js";
6
6
  import { P as E } from "../client-DTHZYkxx.js";
7
- class y extends o {
7
+ class b extends d {
8
8
  constructor(i) {
9
9
  super({ debug: i.debug, enabled: i.enabled });
10
10
  r(this, "name", "Bento-Client");
@@ -16,7 +16,7 @@ class y extends o {
16
16
  }
17
17
  async initialize() {
18
18
  if (this.isEnabled() && !this.initialized) {
19
- if (!l()) {
19
+ if (!a()) {
20
20
  this.log("Skipping initialization - not in browser environment");
21
21
  return;
22
22
  }
@@ -37,35 +37,35 @@ class y extends o {
37
37
  this.scriptLoaded = !0, i();
38
38
  return;
39
39
  }
40
- const t = document.createElement("script");
41
- t.src = `https://cdn.bentonow.com/v1/${this.config.siteUuid}/bento.js`, t.async = !0, t.onload = () => {
40
+ const s = document.createElement("script");
41
+ s.src = `https://cdn.bentonow.com/v1/${this.config.siteUuid}/bento.js`, s.async = !0, s.onload = () => {
42
42
  this.scriptLoaded = !0, i();
43
- }, t.onerror = () => {
43
+ }, s.onerror = () => {
44
44
  e(new Error("Failed to load Bento script"));
45
- }, document.head.appendChild(t);
45
+ }, document.head.appendChild(s);
46
46
  });
47
47
  }
48
48
  async waitForBento(i = 50, e = 100) {
49
- for (let s = 0; s < i; s++) {
49
+ for (let t = 0; t < i; t++) {
50
50
  if (window.bento)
51
51
  return;
52
- await new Promise((t) => setTimeout(t, e));
52
+ await new Promise((s) => setTimeout(s, e));
53
53
  }
54
54
  throw new Error("Bento SDK not available after loading script");
55
55
  }
56
56
  identify(i, e) {
57
57
  if (!this.isEnabled() || !this.initialized || !this.bento) return;
58
- const s = (e == null ? void 0 : e.email) || i;
59
- if (this.bento.identify(s), e) {
60
- const t = { ...e };
61
- delete t.email, Object.keys(t).length > 0 && this.bento.updateFields(t);
58
+ const t = (e == null ? void 0 : e.email) || i;
59
+ if (this.bento.identify(t), e) {
60
+ const s = { ...e };
61
+ delete s.email, Object.keys(s).length > 0 && this.bento.updateFields(s);
62
62
  }
63
- this.log("Identified user", { userId: i, email: s, traits: e });
63
+ this.log("Identified user", { userId: i, email: t, traits: e });
64
64
  }
65
65
  track(i, e) {
66
- var t, a;
66
+ var s, n;
67
67
  if (!this.isEnabled() || !this.initialized || !this.bento) return;
68
- const s = {
68
+ const t = {
69
69
  ...i.properties,
70
70
  category: i.category,
71
71
  timestamp: i.timestamp || Date.now(),
@@ -81,15 +81,15 @@ class y extends o {
81
81
  ...(e == null ? void 0 : e.device) && { device: e.device },
82
82
  ...(e == null ? void 0 : e.utm) && { utm: e.utm },
83
83
  // Include user email and traits as regular event properties
84
- ...((t = e == null ? void 0 : e.user) == null ? void 0 : t.email) && { user_email: e.user.email },
85
- ...((a = e == null ? void 0 : e.user) == null ? void 0 : a.traits) && { user_traits: e.user.traits }
84
+ ...((s = e == null ? void 0 : e.user) == null ? void 0 : s.email) && { user_email: e.user.email },
85
+ ...((n = e == null ? void 0 : e.user) == null ? void 0 : n.traits) && { user_traits: e.user.traits }
86
86
  };
87
- this.bento.track(i.action, s), this.log("Tracked event", { event: i, context: e });
87
+ this.bento.track(i.action, t), this.log("Tracked event", { event: i, context: e });
88
88
  }
89
89
  pageView(i, e) {
90
- if (!(!this.isEnabled() || !this.initialized || !this.bento || !l())) {
90
+ if (!(!this.isEnabled() || !this.initialized || !this.bento || !a())) {
91
91
  if (this.bento.view(), i || e != null && e.page) {
92
- const s = {
92
+ const t = {
93
93
  ...i,
94
94
  ...(e == null ? void 0 : e.page) && {
95
95
  path: e.page.path,
@@ -97,15 +97,15 @@ class y extends o {
97
97
  referrer: e.page.referrer
98
98
  }
99
99
  };
100
- this.bento.track("$pageview", s);
100
+ this.bento.track("$view", t);
101
101
  }
102
102
  this.log("Tracked page view", { properties: i, context: e });
103
103
  }
104
104
  }
105
105
  pageLeave(i, e) {
106
- if (!this.isEnabled() || !this.initialized || !this.bento || !l())
106
+ if (!this.isEnabled() || !this.initialized || !this.bento || !a())
107
107
  return;
108
- const s = {
108
+ const t = {
109
109
  ...i,
110
110
  ...(e == null ? void 0 : e.page) && {
111
111
  path: e.page.path,
@@ -113,13 +113,147 @@ class y extends o {
113
113
  referrer: e.page.referrer
114
114
  }
115
115
  };
116
- this.bento.track("$pageleave", s), this.log("Tracked page leave", { properties: i, context: e });
116
+ this.bento.track("$pageleave", t), this.log("Tracked page leave", { properties: i, context: e });
117
117
  }
118
118
  reset() {
119
- !this.isEnabled() || !this.initialized || !this.bento || !l() || this.log("Reset user session - Note: Bento doesn't have a native reset method");
119
+ !this.isEnabled() || !this.initialized || !this.bento || !a() || this.log("Reset user session - Note: Bento doesn't have a native reset method");
120
+ }
121
+ // ============================================================================
122
+ // Bento-Specific Utility Methods
123
+ // ============================================================================
124
+ /**
125
+ * Add a tag to the current user
126
+ *
127
+ * @example
128
+ * ```typescript
129
+ * bentoProvider.tag('premium_user');
130
+ * bentoProvider.tag('beta_tester');
131
+ * ```
132
+ */
133
+ tag(i) {
134
+ !this.isEnabled() || !this.initialized || !this.bento || !a() || (this.bento.tag(i), this.log("Added tag to user", { tag: i }));
135
+ }
136
+ /**
137
+ * Get the current user's email address
138
+ *
139
+ * @returns The user's email or null if not identified
140
+ *
141
+ * @example
142
+ * ```typescript
143
+ * const email = bentoProvider.getEmail();
144
+ * if (email) {
145
+ * console.log('Current user:', email);
146
+ * }
147
+ * ```
148
+ */
149
+ getEmail() {
150
+ return !this.isEnabled() || !this.initialized || !this.bento || !a() ? null : this.bento.getEmail();
151
+ }
152
+ /**
153
+ * Get the current user's name
154
+ *
155
+ * @returns The user's name or null if not set
156
+ *
157
+ * @example
158
+ * ```typescript
159
+ * const name = bentoProvider.getName();
160
+ * if (name) {
161
+ * console.log('Welcome back,', name);
162
+ * }
163
+ * ```
164
+ */
165
+ getName() {
166
+ return !this.isEnabled() || !this.initialized || !this.bento || !a() ? null : this.bento.getName();
167
+ }
168
+ // ============================================================================
169
+ // Survey Methods
170
+ // ============================================================================
171
+ /**
172
+ * Show a Bento survey form
173
+ *
174
+ * @param element - The HTML element to render the survey in
175
+ * @param surveyId - The survey ID from your Bento account
176
+ * @param type - Display type: 'popup' or 'inline' (default: 'popup')
177
+ *
178
+ * @example
179
+ * ```typescript
180
+ * const container = document.getElementById('survey-container');
181
+ * if (container) {
182
+ * bentoProvider.showSurveyForm(container, 'survey-123', 'popup');
183
+ * }
184
+ * ```
185
+ */
186
+ showSurveyForm(i, e, t = "popup") {
187
+ !this.isEnabled() || !this.initialized || !this.bento || !a() || (this.bento.showSurveyForm(i, e, t), this.log("Showed survey form", { surveyId: e, type: t }));
188
+ }
189
+ /**
190
+ * Validate an email address using Bento's spam check
191
+ *
192
+ * @param email - The email address to validate
193
+ * @returns Promise that resolves to true if email is valid, false if spam
194
+ *
195
+ * @example
196
+ * ```typescript
197
+ * const isValid = await bentoProvider.spamCheck('user@example.com');
198
+ * if (!isValid) {
199
+ * console.log('Invalid or spam email detected');
200
+ * }
201
+ * ```
202
+ */
203
+ async spamCheck(i) {
204
+ if (!this.isEnabled() || !this.initialized || !this.bento || !a())
205
+ return !1;
206
+ try {
207
+ const e = await this.bento.spamCheck(i);
208
+ return this.log("Spam check completed", { email: i, result: e }), e;
209
+ } catch (e) {
210
+ return console.error("[Bento-Client] Spam check failed:", e), !1;
211
+ }
212
+ }
213
+ // ============================================================================
214
+ // Chat Methods (if chat is enabled in Bento)
215
+ // ============================================================================
216
+ /**
217
+ * Show the Bento chat widget
218
+ *
219
+ * @example
220
+ * ```typescript
221
+ * bentoProvider.showChat();
222
+ * ```
223
+ */
224
+ showChat() {
225
+ !this.isEnabled() || !this.initialized || !this.bento || !a() || (this.bento.showChat ? (this.bento.showChat(), this.log("Showed chat widget")) : console.warn(
226
+ "[Bento-Client] Chat not available. Make sure chat is enabled in your Bento settings."
227
+ ));
228
+ }
229
+ /**
230
+ * Hide the Bento chat widget
231
+ *
232
+ * @example
233
+ * ```typescript
234
+ * bentoProvider.hideChat();
235
+ * ```
236
+ */
237
+ hideChat() {
238
+ !this.isEnabled() || !this.initialized || !this.bento || !a() || (this.bento.hideChat ? (this.bento.hideChat(), this.log("Hid chat widget")) : console.warn(
239
+ "[Bento-Client] Chat not available. Make sure chat is enabled in your Bento settings."
240
+ ));
241
+ }
242
+ /**
243
+ * Open the Bento chat widget
244
+ *
245
+ * @example
246
+ * ```typescript
247
+ * bentoProvider.openChat();
248
+ * ```
249
+ */
250
+ openChat() {
251
+ !this.isEnabled() || !this.initialized || !this.bento || !a() || (this.bento.openChat ? (this.bento.openChat(), this.log("Opened chat widget")) : console.warn(
252
+ "[Bento-Client] Chat not available. Make sure chat is enabled in your Bento settings."
253
+ ));
120
254
  }
121
255
  }
122
- class w extends o {
256
+ class w extends d {
123
257
  constructor(i) {
124
258
  super({ debug: i.debug, enabled: i.enabled });
125
259
  r(this, "name", "Pirsch-Client");
@@ -130,7 +264,7 @@ class w extends o {
130
264
  }
131
265
  async initialize() {
132
266
  if (this.isEnabled() && !this.initialized) {
133
- if (!l()) {
267
+ if (!a()) {
134
268
  this.log("Skipping initialization - not in browser environment");
135
269
  return;
136
270
  }
@@ -154,14 +288,14 @@ class w extends o {
154
288
  !this.isEnabled() || !this.initialized || !this.client || (this.client.event("user_identified", 0, {
155
289
  userId: i,
156
290
  ...e
157
- }).catch((s) => {
158
- console.error("[Pirsch-Client] Failed to track identify event:", s);
291
+ }).catch((t) => {
292
+ console.error("[Pirsch-Client] Failed to track identify event:", t);
159
293
  }), this.log("Identified user via event", { userId: i, traits: e }));
160
294
  }
161
295
  async track(i, e) {
162
- var t, a;
296
+ var s, n;
163
297
  if (!this.isEnabled() || !this.initialized || !this.client) return;
164
- const s = {
298
+ const t = {
165
299
  ...i.properties,
166
300
  category: i.category,
167
301
  ...i.userId && { userId: i.userId },
@@ -173,21 +307,21 @@ class w extends o {
173
307
  },
174
308
  ...(e == null ? void 0 : e.device) && { device: e.device },
175
309
  ...(e == null ? void 0 : e.utm) && { utm: e.utm },
176
- ...((t = e == null ? void 0 : e.user) == null ? void 0 : t.email) && { user_email: e.user.email },
177
- ...((a = e == null ? void 0 : e.user) == null ? void 0 : a.traits) && { user_traits: e.user.traits }
310
+ ...((s = e == null ? void 0 : e.user) == null ? void 0 : s.email) && { user_email: e.user.email },
311
+ ...((n = e == null ? void 0 : e.user) == null ? void 0 : n.traits) && { user_traits: e.user.traits }
178
312
  };
179
313
  try {
180
- await this.client.event(i.action, 0, s), this.log("Tracked event", { event: i, context: e });
181
- } catch (d) {
182
- console.error("[Pirsch-Client] Failed to track event:", d);
314
+ await this.client.event(i.action, 0, t), this.log("Tracked event", { event: i, context: e });
315
+ } catch (o) {
316
+ console.error("[Pirsch-Client] Failed to track event:", o);
183
317
  }
184
318
  }
185
319
  pageView(i, e) {
186
- if (!(!this.isEnabled() || !this.initialized || !this.client || !l())) {
187
- if (this.client.hit().catch((s) => {
188
- console.error("[Pirsch-Client] Failed to track page view:", s);
320
+ if (!(!this.isEnabled() || !this.initialized || !this.client || !a())) {
321
+ if (this.client.hit().catch((t) => {
322
+ console.error("[Pirsch-Client] Failed to track page view:", t);
189
323
  }), i && Object.keys(i).length > 0) {
190
- const s = {
324
+ const t = {
191
325
  ...i,
192
326
  ...(e == null ? void 0 : e.page) && {
193
327
  path: e.page.path,
@@ -195,10 +329,10 @@ class w extends o {
195
329
  referrer: e.page.referrer
196
330
  }
197
331
  };
198
- this.client.event("page_view", 0, s).catch((t) => {
332
+ this.client.event("page_view", 0, t).catch((s) => {
199
333
  console.error(
200
334
  "[Pirsch-Client] Failed to track page view event:",
201
- t
335
+ s
202
336
  );
203
337
  });
204
338
  }
@@ -206,28 +340,28 @@ class w extends o {
206
340
  }
207
341
  }
208
342
  pageLeave(i, e) {
209
- if (!this.isEnabled() || !this.initialized || !this.client || !l())
343
+ if (!this.isEnabled() || !this.initialized || !this.client || !a())
210
344
  return;
211
- const s = {
345
+ const t = {
212
346
  ...i,
213
347
  ...(e == null ? void 0 : e.page) && {
214
348
  path: e.page.path,
215
349
  title: e.page.title
216
350
  }
217
351
  };
218
- this.client.event("page_leave", 0, s).catch((t) => {
219
- console.error("[Pirsch-Client] Failed to track page leave:", t);
352
+ this.client.event("page_leave", 0, t).catch((s) => {
353
+ console.error("[Pirsch-Client] Failed to track page leave:", s);
220
354
  }), this.log("Tracked page leave", { properties: i, context: e });
221
355
  }
222
356
  reset() {
223
- !this.isEnabled() || !this.initialized || !this.client || !l() || (this.client.event("session_reset", 0, {}).catch((i) => {
357
+ !this.isEnabled() || !this.initialized || !this.client || !a() || (this.client.event("session_reset", 0, {}).catch((i) => {
224
358
  console.error("[Pirsch-Client] Failed to track session reset:", i);
225
359
  }), this.log("Reset user session"));
226
360
  }
227
361
  }
228
- class m extends o {
362
+ class y extends d {
229
363
  constructor(i) {
230
- var e, s, t, a, d;
364
+ var e, t, s, n, o;
231
365
  super({ debug: i.debug, enabled: i.enabled });
232
366
  r(this, "name", "Proxy");
233
367
  r(this, "config");
@@ -238,7 +372,7 @@ class m extends o {
238
372
  r(this, "retryAttempts");
239
373
  r(this, "retryBackoff");
240
374
  r(this, "retryInitialDelay");
241
- this.config = i, this.batchSize = ((e = i.batch) == null ? void 0 : e.size) ?? 10, this.batchInterval = ((s = i.batch) == null ? void 0 : s.interval) ?? 5e3, this.retryAttempts = ((t = i.retry) == null ? void 0 : t.attempts) ?? 3, this.retryBackoff = ((a = i.retry) == null ? void 0 : a.backoff) ?? "exponential", this.retryInitialDelay = ((d = i.retry) == null ? void 0 : d.initialDelay) ?? 1e3, typeof window < "u" && (window.addEventListener("beforeunload", () => {
375
+ this.config = i, this.batchSize = ((e = i.batch) == null ? void 0 : e.size) ?? 10, this.batchInterval = ((t = i.batch) == null ? void 0 : t.interval) ?? 5e3, this.retryAttempts = ((s = i.retry) == null ? void 0 : s.attempts) ?? 3, this.retryBackoff = ((n = i.retry) == null ? void 0 : n.backoff) ?? "exponential", this.retryInitialDelay = ((o = i.retry) == null ? void 0 : o.initialDelay) ?? 1e3, typeof window < "u" && (window.addEventListener("beforeunload", () => {
242
376
  this.flush(!0);
243
377
  }), document.addEventListener("visibilitychange", () => {
244
378
  document.visibilityState === "hidden" && this.flush(!0);
@@ -298,19 +432,19 @@ class m extends o {
298
432
  }, this.batchInterval));
299
433
  }
300
434
  async sendEvents(i, e = !1) {
301
- const s = { events: i };
435
+ const t = { events: i };
302
436
  if (e && typeof navigator < "u" && navigator.sendBeacon) {
303
- const t = new Blob([JSON.stringify(s)], {
437
+ const s = new Blob([JSON.stringify(t)], {
304
438
  type: "application/json"
305
439
  });
306
- navigator.sendBeacon(this.config.endpoint, t) || console.warn("[Proxy] Failed to send events via beacon");
440
+ navigator.sendBeacon(this.config.endpoint, s) || console.warn("[Proxy] Failed to send events via beacon");
307
441
  return;
308
442
  }
309
- await this.sendWithRetry(s);
443
+ await this.sendWithRetry(t);
310
444
  }
311
445
  async sendWithRetry(i, e = 0) {
312
446
  try {
313
- const s = await fetch(this.config.endpoint, {
447
+ const t = await fetch(this.config.endpoint, {
314
448
  method: "POST",
315
449
  headers: {
316
450
  "Content-Type": "application/json",
@@ -320,15 +454,15 @@ class m extends o {
320
454
  // Don't include credentials by default
321
455
  credentials: "same-origin"
322
456
  });
323
- if (!s.ok)
324
- throw new Error(`HTTP ${s.status}: ${s.statusText}`);
457
+ if (!t.ok)
458
+ throw new Error(`HTTP ${t.status}: ${t.statusText}`);
325
459
  this.log(`Sent ${i.events.length} events successfully`);
326
- } catch (s) {
460
+ } catch (t) {
327
461
  if (e < this.retryAttempts) {
328
- const t = this.calculateRetryDelay(e);
329
- return this.log(`Retry attempt ${e + 1} after ${t}ms`, { error: s }), await new Promise((a) => setTimeout(a, t)), this.sendWithRetry(i, e + 1);
462
+ const s = this.calculateRetryDelay(e);
463
+ return this.log(`Retry attempt ${e + 1} after ${s}ms`, { error: t }), await new Promise((n) => setTimeout(n, s)), this.sendWithRetry(i, e + 1);
330
464
  }
331
- throw console.error("[Proxy] Failed to send events after retries:", s), s;
465
+ throw console.error("[Proxy] Failed to send events after retries:", t), t;
332
466
  }
333
467
  }
334
468
  calculateRetryDelay(i) {
@@ -365,9 +499,9 @@ class m extends o {
365
499
  }
366
500
  }
367
501
  export {
368
- o as BaseAnalyticsProvider,
369
- y as BentoClientProvider,
502
+ d as BaseAnalyticsProvider,
503
+ b as BentoClientProvider,
370
504
  w as PirschClientProvider,
371
505
  E as PostHogClientProvider,
372
- m as ProxyProvider
506
+ y as ProxyProvider
373
507
  };
@@ -89,7 +89,7 @@ class v extends p {
89
89
  }, t = ((r = e == null ? void 0 : e.user) == null ? void 0 : r.traits) || {};
90
90
  this.client.V1.track({
91
91
  email: s,
92
- type: "$pageview",
92
+ type: "$view",
93
93
  details: a,
94
94
  fields: t
95
95
  }).catch((h) => {
@@ -233,12 +233,14 @@ async function g(l, n, i) {
233
233
  device: {
234
234
  ...(e = r.context) == null ? void 0 : e.device,
235
235
  // Add IP (using type assertion for extended fields)
236
+ // biome-ignore lint/suspicious/noExplicitAny: IP field not in base device type
236
237
  ...t ? { ip: t } : {}
237
238
  }
238
239
  };
239
240
  await n.track(r.event.action, r.event.properties, {
240
241
  userId: r.event.userId,
241
242
  sessionId: r.event.sessionId,
243
+ // biome-ignore lint/suspicious/noExplicitAny: Generic context forwarding requires type assertion
242
244
  context: h
243
245
  });
244
246
  break;
@@ -253,6 +255,7 @@ async function g(l, n, i) {
253
255
  ...o,
254
256
  device: {
255
257
  ...(s = r.context) == null ? void 0 : s.device,
258
+ // biome-ignore lint/suspicious/noExplicitAny: IP field not in base device type
256
259
  // Add IP (using type assertion for extended fields)
257
260
  ...t ? { ip: t } : {}
258
261
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stacksee/analytics",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "description": "A highly typed, provider-agnostic analytics library for TypeScript applications",
5
5
  "type": "module",
6
6
  "exports": {
@@ -70,6 +70,10 @@
70
70
  "pnpm": ">=9.0.0",
71
71
  "node": ">=20"
72
72
  },
73
+ "dependencies": {
74
+ "@tailwindcss/vite": "^4.1.16",
75
+ "tailwindcss": "^4.1.16"
76
+ },
73
77
  "scripts": {
74
78
  "test": "vitest run",
75
79
  "test:watch": "vitest",