@bigz-app/booking-widget 1.3.2 → 1.3.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.
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Widget analytics — server-side PostHog tracking via batched sendBeacon.
3
+ *
4
+ * Events are buffered locally and flushed every few seconds (or on page
5
+ * unload) as a single POST to `/api/booking/track`. This avoids extra
6
+ * network requests on every click while still capturing a complete funnel.
7
+ */
8
+ export type WidgetEvent = "widget_loaded" | "event_types_loaded" | "event_type_selected" | "event_instance_selected" | "booking_form_opened" | "booking_completed" | "voucher_card_clicked" | "voucher_purchased" | "upsell_step_viewed" | "promo_dialog_shown" | "promo_cta_clicked";
9
+ /**
10
+ * Initialise the analytics module. Must be called once before `trackEvent`.
11
+ */
12
+ export declare function initAnalytics(apiBaseUrl: string, organizationId: string): void;
13
+ /**
14
+ * Queue a widget event. Non-blocking, fire-and-forget.
15
+ */
16
+ export declare function trackEvent(event: WidgetEvent, properties?: Record<string, unknown>): void;
17
+ //# sourceMappingURL=analytics.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analytics.d.ts","sourceRoot":"","sources":["../../src/utils/analytics.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,MAAM,MAAM,WAAW,GACpB,eAAe,GACf,oBAAoB,GACpB,qBAAqB,GACrB,yBAAyB,GACzB,qBAAqB,GACrB,mBAAmB,GACnB,sBAAsB,GACtB,mBAAmB,GACnB,oBAAoB,GACpB,oBAAoB,GACpB,mBAAmB,CAAC;AA0DvB;;GAEG;AACH,wBAAgB,aAAa,CAAC,UAAU,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,QAUvE;AAED;;GAEG;AACH,wBAAgB,UAAU,CACzB,KAAK,EAAE,WAAW,EAClB,UAAU,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,QAexC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bigz-app/booking-widget",
3
- "version": "1.3.2",
3
+ "version": "1.3.3",
4
4
  "description": "Booking widget for bigZ Booking System @ bigz.app",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",