@posthog/browser 0.4.0 → 0.4.1

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.
Files changed (151) hide show
  1. package/ARCHITECTURE.md +17 -1
  2. package/dist/{core.d.ts → composition/npm/core.d.ts} +7 -7
  3. package/dist/{core.js → composition/npm/core.js} +6 -6
  4. package/dist/composition/npm/core.mjs +5 -0
  5. package/dist/{index.d.ts → composition/npm/index.d.ts} +11 -11
  6. package/dist/{index.js → composition/npm/index.js} +6 -6
  7. package/dist/{index.mjs → composition/npm/index.mjs} +3 -3
  8. package/dist/{root-composition.d.ts → composition/npm/root-composition.d.ts} +3 -3
  9. package/dist/{root-composition.js → composition/npm/root-composition.js} +13 -13
  10. package/dist/{root-composition.mjs → composition/npm/root-composition.mjs} +9 -9
  11. package/dist/{browser-client.d.ts → core/context/browser-client.d.ts} +7 -7
  12. package/dist/{posthog.d.ts → core/posthog.d.ts} +1 -1
  13. package/dist/{posthog.js → core/posthog.js} +15 -15
  14. package/dist/{posthog.mjs → core/posthog.mjs} +7 -7
  15. package/dist/{remote-config.d.ts → core/remote-config.d.ts} +1 -1
  16. package/dist/{remote-config.js → core/remote-config.js} +2 -2
  17. package/dist/{remote-config.mjs → core/remote-config.mjs} +1 -1
  18. package/dist/{bot-filter.d.ts → core/state/bot-filter.d.ts} +1 -1
  19. package/dist/{key-value-store.d.ts → core/state/key-value-store.d.ts} +1 -1
  20. package/dist/{state.d.ts → core/state/state.d.ts} +1 -1
  21. package/dist/{state.js → core/state/state.js} +6 -6
  22. package/dist/{state.mjs → core/state/state.mjs} +1 -1
  23. package/dist/{types.d.ts → core/types.d.ts} +6 -6
  24. package/dist/{request.d.ts → platform/request.d.ts} +1 -1
  25. package/dist/{version.js → primitives/version.js} +1 -1
  26. package/dist/primitives/version.mjs +2 -0
  27. package/dist/{capture-summary.d.ts → products/analytics/admission/capture-summary.d.ts} +1 -1
  28. package/dist/{capture-summary.js → products/analytics/admission/capture-summary.js} +2 -2
  29. package/dist/{capture-summary.mjs → products/analytics/admission/capture-summary.mjs} +1 -1
  30. package/dist/{analytics-api.d.ts → products/analytics/analytics-api.d.ts} +2 -2
  31. package/dist/{analytics-extension.d.ts → products/analytics/analytics-extension.d.ts} +2 -2
  32. package/dist/{analytics-extension.js → products/analytics/analytics-extension.js} +35 -35
  33. package/dist/{analytics-extension.mjs → products/analytics/analytics-extension.mjs} +11 -11
  34. package/dist/{analytics-internal.d.ts → products/analytics/analytics-internal.d.ts} +7 -7
  35. package/dist/{analytics.js → products/analytics/analytics.js} +2 -2
  36. package/dist/{analytics.mjs → products/analytics/analytics.mjs} +1 -1
  37. package/dist/{automatic-analytics.js → products/analytics/automatic-analytics.js} +1 -1
  38. package/dist/{automatic-analytics.mjs → products/analytics/automatic-analytics.mjs} +1 -1
  39. package/dist/{analytics-delivery.d.ts → products/analytics/delivery/analytics-delivery.d.ts} +1 -1
  40. package/dist/{analytics-delivery.js → products/analytics/delivery/analytics-delivery.js} +2 -2
  41. package/dist/{analytics-delivery.mjs → products/analytics/delivery/analytics-delivery.mjs} +1 -1
  42. package/dist/{capture-v1.d.ts → products/analytics/delivery/capture-v1.d.ts} +2 -2
  43. package/dist/{capture-v1.js → products/analytics/delivery/capture-v1.js} +13 -13
  44. package/dist/{capture-v1.mjs → products/analytics/delivery/capture-v1.mjs} +4 -4
  45. package/dist/{lane.d.ts → products/analytics/delivery/lane.d.ts} +1 -1
  46. package/dist/{person-processing.d.ts → products/analytics/properties/person-processing.d.ts} +1 -1
  47. package/dist/{autocapture.d.ts → products/autocapture/autocapture.d.ts} +1 -1
  48. package/dist/{flags-token.d.ts → products/flags/flags-token.d.ts} +1 -1
  49. package/dist/{logs-internal.d.ts → products/logs/logs-internal.d.ts} +1 -1
  50. package/dist/{surveys-internal.d.ts → products/surveys/surveys-internal.d.ts} +1 -1
  51. package/package.json +25 -25
  52. package/dist/core.mjs +0 -5
  53. package/dist/version.mjs +0 -2
  54. /package/dist/{browser-client.js → core/context/browser-client.js} +0 -0
  55. /package/dist/{browser-client.mjs → core/context/browser-client.mjs} +0 -0
  56. /package/dist/{extensions → core/extensions}/registry.d.ts +0 -0
  57. /package/dist/{extensions → core/extensions}/registry.js +0 -0
  58. /package/dist/{extensions → core/extensions}/registry.mjs +0 -0
  59. /package/dist/{bot-filter.js → core/state/bot-filter.js} +0 -0
  60. /package/dist/{bot-filter.mjs → core/state/bot-filter.mjs} +0 -0
  61. /package/dist/{key-value-store.js → core/state/key-value-store.js} +0 -0
  62. /package/dist/{key-value-store.mjs → core/state/key-value-store.mjs} +0 -0
  63. /package/dist/{types.js → core/types.js} +0 -0
  64. /package/dist/{types.mjs → core/types.mjs} +0 -0
  65. /package/dist/{logger.d.ts → platform/logger.d.ts} +0 -0
  66. /package/dist/{logger.js → platform/logger.js} +0 -0
  67. /package/dist/{logger.mjs → platform/logger.mjs} +0 -0
  68. /package/dist/{request.js → platform/request.js} +0 -0
  69. /package/dist/{request.mjs → platform/request.mjs} +0 -0
  70. /package/dist/{id.d.ts → primitives/id.d.ts} +0 -0
  71. /package/dist/{id.js → primitives/id.js} +0 -0
  72. /package/dist/{id.mjs → primitives/id.mjs} +0 -0
  73. /package/dist/{immutable.d.ts → primitives/immutable.d.ts} +0 -0
  74. /package/dist/{immutable.js → primitives/immutable.js} +0 -0
  75. /package/dist/{immutable.mjs → primitives/immutable.mjs} +0 -0
  76. /package/dist/{named-error.d.ts → primitives/named-error.d.ts} +0 -0
  77. /package/dist/{named-error.js → primitives/named-error.js} +0 -0
  78. /package/dist/{named-error.mjs → primitives/named-error.mjs} +0 -0
  79. /package/dist/{utf8.d.ts → primitives/utf8.d.ts} +0 -0
  80. /package/dist/{utf8.js → primitives/utf8.js} +0 -0
  81. /package/dist/{utf8.mjs → primitives/utf8.mjs} +0 -0
  82. /package/dist/{version.d.ts → primitives/version.d.ts} +0 -0
  83. /package/dist/{capture-properties.d.ts → products/analytics/admission/capture-properties.d.ts} +0 -0
  84. /package/dist/{capture-properties.js → products/analytics/admission/capture-properties.js} +0 -0
  85. /package/dist/{capture-properties.mjs → products/analytics/admission/capture-properties.mjs} +0 -0
  86. /package/dist/{event-buffer.d.ts → products/analytics/admission/event-buffer.d.ts} +0 -0
  87. /package/dist/{event-buffer.js → products/analytics/admission/event-buffer.js} +0 -0
  88. /package/dist/{event-buffer.mjs → products/analytics/admission/event-buffer.mjs} +0 -0
  89. /package/dist/{rate-limiter.d.ts → products/analytics/admission/rate-limiter.d.ts} +0 -0
  90. /package/dist/{rate-limiter.js → products/analytics/admission/rate-limiter.js} +0 -0
  91. /package/dist/{rate-limiter.mjs → products/analytics/admission/rate-limiter.mjs} +0 -0
  92. /package/dist/{analytics-api.js → products/analytics/analytics-api.js} +0 -0
  93. /package/dist/{analytics-api.mjs → products/analytics/analytics-api.mjs} +0 -0
  94. /package/dist/{analytics-buffer.d.ts → products/analytics/analytics-buffer.d.ts} +0 -0
  95. /package/dist/{analytics-buffer.js → products/analytics/analytics-buffer.js} +0 -0
  96. /package/dist/{analytics-buffer.mjs → products/analytics/analytics-buffer.mjs} +0 -0
  97. /package/dist/{analytics-internal.js → products/analytics/analytics-internal.js} +0 -0
  98. /package/dist/{analytics-internal.mjs → products/analytics/analytics-internal.mjs} +0 -0
  99. /package/dist/{analytics-options.d.ts → products/analytics/analytics-options.d.ts} +0 -0
  100. /package/dist/{analytics-options.js → products/analytics/analytics-options.js} +0 -0
  101. /package/dist/{analytics-options.mjs → products/analytics/analytics-options.mjs} +0 -0
  102. /package/dist/{analytics.d.ts → products/analytics/analytics.d.ts} +0 -0
  103. /package/dist/{automatic-analytics.d.ts → products/analytics/automatic-analytics.d.ts} +0 -0
  104. /package/dist/{lane.js → products/analytics/delivery/lane.js} +0 -0
  105. /package/dist/{lane.mjs → products/analytics/delivery/lane.mjs} +0 -0
  106. /package/dist/{analytics-properties.d.ts → products/analytics/properties/analytics-properties.d.ts} +0 -0
  107. /package/dist/{analytics-properties.js → products/analytics/properties/analytics-properties.js} +0 -0
  108. /package/dist/{analytics-properties.mjs → products/analytics/properties/analytics-properties.mjs} +0 -0
  109. /package/dist/{analytics-session-properties.d.ts → products/analytics/properties/analytics-session-properties.d.ts} +0 -0
  110. /package/dist/{analytics-session-properties.js → products/analytics/properties/analytics-session-properties.js} +0 -0
  111. /package/dist/{analytics-session-properties.mjs → products/analytics/properties/analytics-session-properties.mjs} +0 -0
  112. /package/dist/{person-processing.js → products/analytics/properties/person-processing.js} +0 -0
  113. /package/dist/{person-processing.mjs → products/analytics/properties/person-processing.mjs} +0 -0
  114. /package/dist/{autocapture-options.d.ts → products/autocapture/autocapture-options.d.ts} +0 -0
  115. /package/dist/{autocapture-options.js → products/autocapture/autocapture-options.js} +0 -0
  116. /package/dist/{autocapture-options.mjs → products/autocapture/autocapture-options.mjs} +0 -0
  117. /package/dist/{autocapture.js → products/autocapture/autocapture.js} +0 -0
  118. /package/dist/{autocapture.mjs → products/autocapture/autocapture.mjs} +0 -0
  119. /package/dist/{flags-internal.d.ts → products/flags/flags-internal.d.ts} +0 -0
  120. /package/dist/{flags-internal.js → products/flags/flags-internal.js} +0 -0
  121. /package/dist/{flags-internal.mjs → products/flags/flags-internal.mjs} +0 -0
  122. /package/dist/{flags-options.d.ts → products/flags/flags-options.d.ts} +0 -0
  123. /package/dist/{flags-options.js → products/flags/flags-options.js} +0 -0
  124. /package/dist/{flags-options.mjs → products/flags/flags-options.mjs} +0 -0
  125. /package/dist/{flags-token.js → products/flags/flags-token.js} +0 -0
  126. /package/dist/{flags-token.mjs → products/flags/flags-token.mjs} +0 -0
  127. /package/dist/{flags.d.ts → products/flags/flags.d.ts} +0 -0
  128. /package/dist/{flags.js → products/flags/flags.js} +0 -0
  129. /package/dist/{flags.mjs → products/flags/flags.mjs} +0 -0
  130. /package/dist/{logs-internal.js → products/logs/logs-internal.js} +0 -0
  131. /package/dist/{logs-internal.mjs → products/logs/logs-internal.mjs} +0 -0
  132. /package/dist/{logs-options.d.ts → products/logs/logs-options.d.ts} +0 -0
  133. /package/dist/{logs-options.js → products/logs/logs-options.js} +0 -0
  134. /package/dist/{logs-options.mjs → products/logs/logs-options.mjs} +0 -0
  135. /package/dist/{logs.d.ts → products/logs/logs.d.ts} +0 -0
  136. /package/dist/{logs.js → products/logs/logs.js} +0 -0
  137. /package/dist/{logs.mjs → products/logs/logs.mjs} +0 -0
  138. /package/dist/{automatic-surveys.d.ts → products/surveys/automatic-surveys.d.ts} +0 -0
  139. /package/dist/{automatic-surveys.js → products/surveys/automatic-surveys.js} +0 -0
  140. /package/dist/{automatic-surveys.mjs → products/surveys/automatic-surveys.mjs} +0 -0
  141. /package/dist/{surveys-extension.d.ts → products/surveys/surveys-extension.d.ts} +0 -0
  142. /package/dist/{surveys-extension.js → products/surveys/surveys-extension.js} +0 -0
  143. /package/dist/{surveys-extension.mjs → products/surveys/surveys-extension.mjs} +0 -0
  144. /package/dist/{surveys-internal.js → products/surveys/surveys-internal.js} +0 -0
  145. /package/dist/{surveys-internal.mjs → products/surveys/surveys-internal.mjs} +0 -0
  146. /package/dist/{surveys-options.d.ts → products/surveys/surveys-options.d.ts} +0 -0
  147. /package/dist/{surveys-options.js → products/surveys/surveys-options.js} +0 -0
  148. /package/dist/{surveys-options.mjs → products/surveys/surveys-options.mjs} +0 -0
  149. /package/dist/{surveys.d.ts → products/surveys/surveys.d.ts} +0 -0
  150. /package/dist/{surveys.js → products/surveys/surveys.js} +0 -0
  151. /package/dist/{surveys.mjs → products/surveys/surveys.mjs} +0 -0
@@ -1,6 +1,6 @@
1
1
  import type { CaptureOptions, CapturedEventInfo, Disposable, Listener } from '@posthog/browser-common';
2
- import type { BrowserExtension } from './browser-client';
3
- import type { CaptureSummary } from './types';
2
+ import type { BrowserExtension } from '../../core/context/browser-client';
3
+ import type { CaptureSummary } from '../../core/types';
4
4
  /** Application-facing analytics operations on one installed product instance. */
5
5
  export interface IAnalytics extends BrowserExtension {
6
6
  readonly isRateLimited: boolean;
@@ -1,8 +1,8 @@
1
1
  import type { CaptureOptions, CapturedEventInfo, Disposable, Listener } from '@posthog/browser-common';
2
2
  import { type AnalyticsCaptureHost, type AnalyticsDeliveryFactory, type IAnalyticsExtension, type CaptureHost } from './analytics-internal';
3
- import type { IPostHogInternal } from './browser-client';
3
+ import type { IPostHogInternal } from '../../core/context/browser-client';
4
4
  import type { AutomaticAnalyticsOptions } from './analytics-options';
5
- import type { CaptureSummary } from './types';
5
+ import type { CaptureSummary } from '../../core/types';
6
6
  /** One product instance owns analytics operations, admission, buffering and delivery coordination. */
7
7
  export declare class Analytics implements IAnalyticsExtension {
8
8
  readonly name: import("@posthog/browser-common").ExtensionToken<IAnalyticsExtension>;
@@ -31,17 +31,17 @@ __webpack_require__.d(__webpack_exports__, {
31
31
  Analytics: ()=>Analytics
32
32
  });
33
33
  const external_analytics_internal_js_namespaceObject = require("./analytics-internal.js");
34
- const external_event_buffer_js_namespaceObject = require("./event-buffer.js");
35
- const external_capture_summary_js_namespaceObject = require("./capture-summary.js");
36
- const external_id_js_namespaceObject = require("./id.js");
37
- const external_immutable_js_namespaceObject = require("./immutable.js");
38
- const external_rate_limiter_js_namespaceObject = require("./rate-limiter.js");
39
- const external_capture_properties_js_namespaceObject = require("./capture-properties.js");
40
- const external_analytics_session_properties_js_namespaceObject = require("./analytics-session-properties.js");
41
- const external_analytics_properties_js_namespaceObject = require("./analytics-properties.js");
42
- const external_person_processing_js_namespaceObject = require("./person-processing.js");
43
- const external_version_js_namespaceObject = require("./version.js");
44
- const external_utf8_js_namespaceObject = require("./utf8.js");
34
+ const event_buffer_js_namespaceObject = require("./admission/event-buffer.js");
35
+ const capture_summary_js_namespaceObject = require("./admission/capture-summary.js");
36
+ const id_js_namespaceObject = require("../../primitives/id.js");
37
+ const immutable_js_namespaceObject = require("../../primitives/immutable.js");
38
+ const rate_limiter_js_namespaceObject = require("./admission/rate-limiter.js");
39
+ const capture_properties_js_namespaceObject = require("./admission/capture-properties.js");
40
+ const analytics_session_properties_js_namespaceObject = require("./properties/analytics-session-properties.js");
41
+ const analytics_properties_js_namespaceObject = require("./properties/analytics-properties.js");
42
+ const person_processing_js_namespaceObject = require("./properties/person-processing.js");
43
+ const version_js_namespaceObject = require("../../primitives/version.js");
44
+ const utf8_js_namespaceObject = require("../../primitives/utf8.js");
45
45
  const numberOption = (read, fallback, minimum, maximum)=>{
46
46
  try {
47
47
  const value = read();
@@ -78,12 +78,12 @@ class Analytics {
78
78
  this._teardownCallbacks = new Set();
79
79
  this.bindCaptureHost = (host)=>{
80
80
  this._host = host;
81
- this._sessionProperties = new external_analytics_session_properties_js_namespaceObject.SessionRegisteredProperties(host.sessionKv);
81
+ this._sessionProperties = new analytics_session_properties_js_namespaceObject.SessionRegisteredProperties(host.sessionKv);
82
82
  };
83
83
  this.setup = (value)=>{
84
84
  this._client = value.sharedClient;
85
85
  this._kv = value.kv;
86
- this._registeredProperties = new external_analytics_properties_js_namespaceObject.RegisteredProperties(value.kv);
86
+ this._registeredProperties = new analytics_properties_js_namespaceObject.RegisteredProperties(value.kv);
87
87
  };
88
88
  this.initialize = (host)=>{
89
89
  this._deliveryHost = host;
@@ -151,10 +151,10 @@ class Analytics {
151
151
  try {
152
152
  const authority = this._host?.authority();
153
153
  const message = this._admitCapture(event, properties, options, false, true);
154
- if (!message) return external_capture_summary_js_namespaceObject.EMPTY_CAPTURE_SUMMARY;
154
+ if (!message) return capture_summary_js_namespaceObject.EMPTY_CAPTURE_SUMMARY;
155
155
  return await this._deliverImmediate(message, ()=>this._host?.authority() === authority);
156
156
  } catch (error) {
157
- return (0, external_capture_summary_js_namespaceObject.captureFailure)(error);
157
+ return (0, capture_summary_js_namespaceObject.captureFailure)(error);
158
158
  }
159
159
  };
160
160
  this.createPersonProfile = ()=>{
@@ -162,14 +162,14 @@ class Analytics {
162
162
  if (this._disposed || !host?.canMutate()) return;
163
163
  host.state.prepare();
164
164
  if (this._hasPersonProcessing()) return;
165
- const properties = (0, external_person_processing_js_namespaceObject.snapshotPersonProperties)(host.state.distinctId, {}, {});
165
+ const properties = (0, person_processing_js_namespaceObject.snapshotPersonProperties)(host.state.distinctId, {}, {});
166
166
  if (properties) this._setPersonProperties(properties);
167
167
  };
168
168
  this.setPersonProperties = (set, setOnce)=>{
169
169
  const host = this._host;
170
170
  if (this._disposed || !host?.canMutate()) return;
171
171
  host.state.prepare();
172
- const properties = (0, external_person_processing_js_namespaceObject.snapshotPersonProperties)(host.state.distinctId, set, setOnce);
172
+ const properties = (0, person_processing_js_namespaceObject.snapshotPersonProperties)(host.state.distinctId, set, setOnce);
173
173
  if (!properties) return void host.logger.warn('Person properties must be JSON-serializable objects');
174
174
  if (!(Object.keys(properties.set).length || Object.keys(properties.setOnce).length)) return;
175
175
  this._setPersonProperties(properties);
@@ -177,7 +177,7 @@ class Analytics {
177
177
  this.unsetPersonProperties = (names)=>{
178
178
  const host = this._host;
179
179
  if (this._disposed || !host?.canMutate()) return;
180
- const properties = (0, external_person_processing_js_namespaceObject.personPropertyNames)(names);
180
+ const properties = (0, person_processing_js_namespaceObject.personPropertyNames)(names);
181
181
  if (!properties.length || !this._requirePersonProcessing()) return;
182
182
  host.state.prepare();
183
183
  this._lastPersonProperties = void 0;
@@ -204,7 +204,7 @@ class Analytics {
204
204
  const wasIdentified = host.state.isIdentified;
205
205
  const hasProperties = !!set || !!setOnce;
206
206
  if (distinctId !== previousDistinctId || !wasIdentified) host.state.identify(distinctId);
207
- const properties = (0, external_person_processing_js_namespaceObject.snapshotPersonProperties)(distinctId, set, setOnce);
207
+ const properties = (0, person_processing_js_namespaceObject.snapshotPersonProperties)(distinctId, set, setOnce);
208
208
  if (!properties) {
209
209
  host.logger.warn('Person properties must be JSON-serializable objects');
210
210
  if (distinctId !== previousDistinctId || !wasIdentified || hasProperties) host.publishIdentify({
@@ -340,9 +340,9 @@ class Analytics {
340
340
  flushAt: numberOption(()=>options.flushAt, 20, 1, external_analytics_internal_js_namespaceObject.MAX_ANALYTICS_BATCH_EVENTS),
341
341
  flushInterval: numberOption(()=>options.flushInterval, 3000, 0, Number.MAX_SAFE_INTEGER)
342
342
  };
343
- this._buffer = new external_event_buffer_js_namespaceObject.EventBuffer(1000, (total, count = 1, reason = 'overflow')=>this._deliveryHost.reportWarning(`Analytics queue dropped ${count} ${reason} event${1 === count ? '' : 's'} (${total} total)`), external_analytics_internal_js_namespaceObject.MAX_ANALYTICS_BYTES, 3600000);
344
- this._personProfiles = (0, external_person_processing_js_namespaceObject.snapshotPersonProfileMode)(()=>options.personProfiles);
345
- this._rateLimiter = new external_rate_limiter_js_namespaceObject.ClientRateLimiter();
343
+ this._buffer = new event_buffer_js_namespaceObject.EventBuffer(1000, (total, count = 1, reason = 'overflow')=>this._deliveryHost.reportWarning(`Analytics queue dropped ${count} ${reason} event${1 === count ? '' : 's'} (${total} total)`), external_analytics_internal_js_namespaceObject.MAX_ANALYTICS_BYTES, 3600000);
344
+ this._personProfiles = (0, person_processing_js_namespaceObject.snapshotPersonProfileMode)(()=>options.personProfiles);
345
+ this._rateLimiter = new rate_limiter_js_namespaceObject.ClientRateLimiter();
346
346
  Object.defineProperty(this, 'isRateLimited', {
347
347
  configurable: true,
348
348
  enumerable: true,
@@ -399,8 +399,8 @@ class Analytics {
399
399
  } catch {
400
400
  deliverImmediate = void 0;
401
401
  }
402
- if (!canContinue()) return (0, external_capture_summary_js_namespaceObject.captureFailure)(new Error('Immediate analytics delivery was cancelled'));
403
- if (!this._driver || 'function' != typeof deliverImmediate || this._disposed) return (0, external_capture_summary_js_namespaceObject.captureFailure)(new Error('Immediate analytics delivery is unavailable'));
402
+ if (!canContinue()) return (0, capture_summary_js_namespaceObject.captureFailure)(new Error('Immediate analytics delivery was cancelled'));
403
+ if (!this._driver || 'function' != typeof deliverImmediate || this._disposed) return (0, capture_summary_js_namespaceObject.captureFailure)(new Error('Immediate analytics delivery is unavailable'));
404
404
  return deliverImmediate.call(this._driver, [
405
405
  message
406
406
  ], canContinue);
@@ -462,7 +462,7 @@ class Analytics {
462
462
  _snapshotProperties(properties, options) {
463
463
  const dynamic = this._dynamicProperties();
464
464
  try {
465
- return (0, external_capture_properties_js_namespaceObject.snapshotCaptureProperties)(this._registeredProperties?.values(), dynamic, properties, options);
465
+ return (0, capture_properties_js_namespaceObject.snapshotCaptureProperties)(this._registeredProperties?.values(), dynamic, properties, options);
466
466
  } catch (error) {
467
467
  this._host?.logger.error('Event properties are not JSON-serializable', error);
468
468
  return;
@@ -484,11 +484,11 @@ class Analytics {
484
484
  $session_id: session.sessionId,
485
485
  $window_id: session.windowId,
486
486
  $lib: 'web',
487
- $lib_version: external_version_js_namespaceObject.version,
487
+ $lib_version: version_js_namespaceObject.version,
488
488
  $process_person_profile: processPersonProfile
489
489
  };
490
490
  const message = {
491
- uuid: snapshot.uuid ?? (0, external_id_js_namespaceObject.createId)(),
491
+ uuid: snapshot.uuid ?? (0, id_js_namespaceObject.createId)(),
492
492
  event,
493
493
  distinct_id: distinctId,
494
494
  properties: {
@@ -514,14 +514,14 @@ class Analytics {
514
514
  }
515
515
  _enrichAndMeasure(message, snapshot, metadata, sessionId) {
516
516
  try {
517
- let bytes = (0, external_utf8_js_namespaceObject.utf8Bytes)(JSON.stringify(message));
517
+ let bytes = (0, utf8_js_namespaceObject.utf8Bytes)(JSON.stringify(message));
518
518
  if (!this._fitsUnavoidableProperties(message, snapshot, metadata, bytes)) return;
519
- const changed = (0, external_capture_properties_js_namespaceObject.applySessionProperties)(snapshot, this._sessionProperties?.values(sessionId) ?? {});
519
+ const changed = (0, capture_properties_js_namespaceObject.applySessionProperties)(snapshot, this._sessionProperties?.values(sessionId) ?? {});
520
520
  message.properties = {
521
521
  ...snapshot.message,
522
522
  ...metadata
523
523
  };
524
- if (changed) bytes = (0, external_utf8_js_namespaceObject.utf8Bytes)(JSON.stringify(message));
524
+ if (changed) bytes = (0, utf8_js_namespaceObject.utf8Bytes)(JSON.stringify(message));
525
525
  return bytes;
526
526
  } catch (error) {
527
527
  this._host?.logger.error('The finalized event could not be measured', error);
@@ -530,9 +530,9 @@ class Analytics {
530
530
  }
531
531
  _fitsUnavoidableProperties(message, snapshot, metadata, bytes) {
532
532
  if (bytes <= external_analytics_internal_js_namespaceObject.MAX_ANALYTICS_BYTES) return true;
533
- const minimum = (0, external_utf8_js_namespaceObject.utf8Bytes)(JSON.stringify({
533
+ const minimum = (0, utf8_js_namespaceObject.utf8Bytes)(JSON.stringify({
534
534
  ...message,
535
- properties: (0, external_capture_properties_js_namespaceObject.unavoidableProperties)(snapshot, metadata)
535
+ properties: (0, capture_properties_js_namespaceObject.unavoidableProperties)(snapshot, metadata)
536
536
  }));
537
537
  if (minimum <= external_analytics_internal_js_namespaceObject.MAX_ANALYTICS_BYTES) return true;
538
538
  this._warnOversized(message.event, bytes);
@@ -569,7 +569,7 @@ class Analytics {
569
569
  ...session,
570
570
  reason: preparedSession.reason
571
571
  });
572
- host.publishEvent((0, external_immutable_js_namespaceObject.deepFreeze)({
572
+ host.publishEvent((0, immutable_js_namespaceObject.deepFreeze)({
573
573
  event: message.event,
574
574
  properties: observedProperties
575
575
  }));
@@ -578,7 +578,7 @@ class Analytics {
578
578
  const host = this._host;
579
579
  if (!host) return false;
580
580
  const enabled = this._kv?.get('personProcessingEnabled') === true;
581
- return (0, external_person_processing_js_namespaceObject.shouldProcessPerson)(this._personProfiles, host.state.isIdentified, Object.keys(host.state.groups).length > 0, enabled);
581
+ return (0, person_processing_js_namespaceObject.shouldProcessPerson)(this._personProfiles, host.state.isIdentified, Object.keys(host.state.groups).length > 0, enabled);
582
582
  }
583
583
  _requirePersonProcessing() {
584
584
  if ('never' === this._personProfiles) {
@@ -631,7 +631,7 @@ class Analytics {
631
631
  _prepareRegistration(properties) {
632
632
  const store = this._propertyStore();
633
633
  if (!store) return;
634
- const snapshot = (0, external_analytics_properties_js_namespaceObject.snapshotRegisteredProperties)(properties);
634
+ const snapshot = (0, analytics_properties_js_namespaceObject.snapshotRegisteredProperties)(properties);
635
635
  if (this._propertyStore() !== store) return;
636
636
  if (!snapshot) return void this._host?.logger.warn('Super properties must serialize to an object');
637
637
  return {
@@ -1,15 +1,15 @@
1
1
  import { Analytics, MAX_ANALYTICS_BATCH_EVENTS, MAX_ANALYTICS_BYTES } from "./analytics-internal.mjs";
2
- import { EventBuffer } from "./event-buffer.mjs";
3
- import { EMPTY_CAPTURE_SUMMARY, captureFailure } from "./capture-summary.mjs";
4
- import { createId } from "./id.mjs";
5
- import { deepFreeze } from "./immutable.mjs";
6
- import { ClientRateLimiter } from "./rate-limiter.mjs";
7
- import { applySessionProperties, snapshotCaptureProperties, unavoidableProperties } from "./capture-properties.mjs";
8
- import { SessionRegisteredProperties } from "./analytics-session-properties.mjs";
9
- import { RegisteredProperties, snapshotRegisteredProperties } from "./analytics-properties.mjs";
10
- import { personPropertyNames, shouldProcessPerson, snapshotPersonProfileMode, snapshotPersonProperties } from "./person-processing.mjs";
11
- import { version } from "./version.mjs";
12
- import { utf8Bytes } from "./utf8.mjs";
2
+ import { EventBuffer } from "./admission/event-buffer.mjs";
3
+ import { EMPTY_CAPTURE_SUMMARY, captureFailure } from "./admission/capture-summary.mjs";
4
+ import { createId } from "../../primitives/id.mjs";
5
+ import { deepFreeze } from "../../primitives/immutable.mjs";
6
+ import { ClientRateLimiter } from "./admission/rate-limiter.mjs";
7
+ import { applySessionProperties, snapshotCaptureProperties, unavoidableProperties } from "./admission/capture-properties.mjs";
8
+ import { SessionRegisteredProperties } from "./properties/analytics-session-properties.mjs";
9
+ import { RegisteredProperties, snapshotRegisteredProperties } from "./properties/analytics-properties.mjs";
10
+ import { personPropertyNames, shouldProcessPerson, snapshotPersonProfileMode, snapshotPersonProperties } from "./properties/person-processing.mjs";
11
+ import { version } from "../../primitives/version.mjs";
12
+ import { utf8Bytes } from "../../primitives/utf8.mjs";
13
13
  const numberOption = (read, fallback, minimum, maximum)=>{
14
14
  try {
15
15
  const value = read();
@@ -1,13 +1,13 @@
1
1
  import type { Client, CapturedEventInfo, ExtensionToken, Listener } from '@posthog/browser-common';
2
- import type { BrowserExtension, ChangePropertiesInfo, GroupInfo, IdentifyInfo } from './browser-client';
2
+ import type { BrowserExtension, ChangePropertiesInfo, GroupInfo, IdentifyInfo } from '../../core/context/browser-client';
3
3
  import type { IAnalytics } from './analytics-api';
4
- import type { BrowserState } from './state';
5
- import type { NewSessionInfo } from './types';
4
+ import type { BrowserState } from '../../core/state/state';
5
+ import type { NewSessionInfo } from '../../core/types';
6
6
  import type { AnalyticsOptions } from './analytics-options';
7
- import type { EventBuffer } from './event-buffer';
8
- import type { LaneDelivery } from './lane';
9
- import type { RequestRuntime } from './request';
10
- import type { CaptureSummary } from './types';
7
+ import type { EventBuffer } from './admission/event-buffer';
8
+ import type { LaneDelivery } from './delivery/lane';
9
+ import type { RequestRuntime } from '../../platform/request';
10
+ import type { CaptureSummary } from '../../core/types';
11
11
  export interface AnalyticsMessage {
12
12
  event: string;
13
13
  uuid: string;
@@ -31,8 +31,8 @@ __webpack_require__.d(__webpack_exports__, {
31
31
  analytics: ()=>analytics
32
32
  });
33
33
  const external_analytics_buffer_js_namespaceObject = require("./analytics-buffer.js");
34
- const external_analytics_delivery_js_namespaceObject = require("./analytics-delivery.js");
35
- const analytics = (options = {})=>(0, external_analytics_buffer_js_namespaceObject.createAnalyticsExtension)(options, void 0, external_analytics_delivery_js_namespaceObject.createAnalyticsDelivery);
34
+ const analytics_delivery_js_namespaceObject = require("./delivery/analytics-delivery.js");
35
+ const analytics = (options = {})=>(0, external_analytics_buffer_js_namespaceObject.createAnalyticsExtension)(options, void 0, analytics_delivery_js_namespaceObject.createAnalyticsDelivery);
36
36
  exports.analytics = __webpack_exports__.analytics;
37
37
  for(var __rspack_i in __webpack_exports__)if (-1 === [
38
38
  "analytics"
@@ -1,4 +1,4 @@
1
1
  import { createAnalyticsExtension } from "./analytics-buffer.mjs";
2
- import { createAnalyticsDelivery } from "./analytics-delivery.mjs";
2
+ import { createAnalyticsDelivery } from "./delivery/analytics-delivery.mjs";
3
3
  const analytics = (options = {})=>createAnalyticsExtension(options, void 0, createAnalyticsDelivery);
4
4
  export { analytics };
@@ -32,7 +32,7 @@ __webpack_require__.d(__webpack_exports__, {
32
32
  });
33
33
  const external_analytics_buffer_js_namespaceObject = require("./analytics-buffer.js");
34
34
  const analytics = (options)=>(0, external_analytics_buffer_js_namespaceObject.createAnalyticsExtension)(options, async ()=>{
35
- const { createAnalyticsDelivery } = await import("./analytics-delivery.js");
35
+ const { createAnalyticsDelivery } = await import("./delivery/analytics-delivery.js");
36
36
  return createAnalyticsDelivery;
37
37
  });
38
38
  exports.analytics = __webpack_exports__.analytics;
@@ -1,6 +1,6 @@
1
1
  import { createAnalyticsExtension } from "./analytics-buffer.mjs";
2
2
  const analytics = (options)=>createAnalyticsExtension(options, async ()=>{
3
- const { createAnalyticsDelivery } = await import("./analytics-delivery.mjs");
3
+ const { createAnalyticsDelivery } = await import("./delivery/analytics-delivery.mjs");
4
4
  return createAnalyticsDelivery;
5
5
  });
6
6
  export { analytics };
@@ -1,3 +1,3 @@
1
- import type { AnalyticsDeliveryFactory } from './analytics-internal';
1
+ import type { AnalyticsDeliveryFactory } from '../analytics-internal';
2
2
  /** Attaches delivery machinery to the analytics extension's existing event buffer. */
3
3
  export declare const createAnalyticsDelivery: AnalyticsDeliveryFactory;
@@ -31,7 +31,7 @@ __webpack_require__.d(__webpack_exports__, {
31
31
  createAnalyticsDelivery: ()=>createAnalyticsDelivery
32
32
  });
33
33
  const external_lane_js_namespaceObject = require("./lane.js");
34
- const external_capture_summary_js_namespaceObject = require("./capture-summary.js");
34
+ const capture_summary_js_namespaceObject = require("../admission/capture-summary.js");
35
35
  const external_capture_v1_js_namespaceObject = require("./capture-v1.js");
36
36
  const isOnline = (context)=>{
37
37
  try {
@@ -196,7 +196,7 @@ const createAnalyticsDelivery = (buffer, client, host, options, beforeTeardown)=
196
196
  } : {}
197
197
  });
198
198
  const summary = summarizeCapture(messages, result.outcomes);
199
- if (void 0 !== result.terminalError) return (0, external_capture_summary_js_namespaceObject.captureFailure)(result.terminalError, summary);
199
+ if (void 0 !== result.terminalError) return (0, capture_summary_js_namespaceObject.captureFailure)(result.terminalError, summary);
200
200
  return summary;
201
201
  } finally{
202
202
  if (controller) immediateControllers.delete(controller);
@@ -1,5 +1,5 @@
1
1
  import { Lane } from "./lane.mjs";
2
- import { captureFailure } from "./capture-summary.mjs";
2
+ import { captureFailure } from "../admission/capture-summary.mjs";
3
3
  import { CAPTURE_V1_MAX_BATCH_EVENTS, CAPTURE_V1_TEARDOWN_BUDGET_BYTES, sendCaptureV1Batches, sendCaptureV1TeardownBatches } from "./capture-v1.mjs";
4
4
  const isOnline = (context)=>{
5
5
  try {
@@ -1,6 +1,6 @@
1
1
  import type { ApiResponse } from '@posthog/browser-common';
2
- import { type AnalyticsMessage } from './analytics-internal';
3
- import type { RequestRuntime } from './request';
2
+ import { type AnalyticsMessage } from '../analytics-internal';
3
+ import type { RequestRuntime } from '../../../platform/request';
4
4
  export declare const CAPTURE_V1_MAX_BATCH_EVENTS = 100;
5
5
  export declare const CAPTURE_V1_BATCH_TARGET_BYTES: number;
6
6
  export declare const CAPTURE_V1_COMPRESSION_THRESHOLD_BYTES = 1024;
@@ -37,10 +37,10 @@ __webpack_require__.d(__webpack_exports__, {
37
37
  sendCaptureV1Batches: ()=>sendCaptureV1Batches,
38
38
  sendCaptureV1TeardownBatches: ()=>sendCaptureV1TeardownBatches
39
39
  });
40
- const external_analytics_internal_js_namespaceObject = require("./analytics-internal.js");
41
- const external_id_js_namespaceObject = require("./id.js");
42
- const external_named_error_js_namespaceObject = require("./named-error.js");
43
- const external_utf8_js_namespaceObject = require("./utf8.js");
40
+ const external_analytics_internal_js_namespaceObject = require("../analytics-internal.js");
41
+ const id_js_namespaceObject = require("../../../primitives/id.js");
42
+ const named_error_js_namespaceObject = require("../../../primitives/named-error.js");
43
+ const utf8_js_namespaceObject = require("../../../primitives/utf8.js");
44
44
  const RETRYABLE_STATUSES = [
45
45
  408,
46
46
  500,
@@ -82,13 +82,13 @@ const prepareEvents = (messages)=>messages.map((source)=>{
82
82
  event,
83
83
  uuid: event.uuid,
84
84
  json,
85
- bytes: (0, external_utf8_js_namespaceObject.utf8Bytes)(json)
85
+ bytes: (0, utf8_js_namespaceObject.utf8Bytes)(json)
86
86
  };
87
87
  });
88
88
  const serializeEnvelope = (createdAt, events)=>`{"created_at":${JSON.stringify(createdAt)},"batch":[${events.map(({ json })=>json).join(',')}]}`;
89
89
  const partitionEvents = (events, createdAt, maxBatchEvents, targetBatchBytes)=>{
90
90
  const batches = [];
91
- const emptyBytes = (0, external_utf8_js_namespaceObject.utf8Bytes)(serializeEnvelope(createdAt, []));
91
+ const emptyBytes = (0, utf8_js_namespaceObject.utf8Bytes)(serializeEnvelope(createdAt, []));
92
92
  let batch = [];
93
93
  let bytes = emptyBytes;
94
94
  for (const event of events){
@@ -344,14 +344,14 @@ const attemptOnce = async (runtime, events, libraryVersion, createdAt, requestId
344
344
  'PostHog-Request-Timestamp': isoNow(now)
345
345
  };
346
346
  let requestBody = body;
347
- if (compressionEnabled && (0, external_utf8_js_namespaceObject.utf8Bytes)(body) >= compressionThresholdBytes) {
347
+ if (compressionEnabled && (0, utf8_js_namespaceObject.utf8Bytes)(body) >= compressionThresholdBytes) {
348
348
  const compressed = await compressWithDeadline(body, Math.max(1, Math.min(compressionTimeoutMs, remainingTime())), signal, compress);
349
349
  if (signal?.aborted || !canContinue(continuationCheck)) return [
350
350
  failedResult(events, cancellationError()),
351
351
  events,
352
352
  void 0
353
353
  ];
354
- if (compressed && compressed.size < (0, external_utf8_js_namespaceObject.utf8Bytes)(body)) {
354
+ if (compressed && compressed.size < (0, utf8_js_namespaceObject.utf8Bytes)(body)) {
355
355
  requestBody = compressed;
356
356
  headers['Content-Encoding'] = 'gzip';
357
357
  }
@@ -386,7 +386,7 @@ const attemptOnce = async (runtime, events, libraryVersion, createdAt, requestId
386
386
  timer = globalThis.setTimeout(()=>{
387
387
  timedOut = true;
388
388
  const error = new Error(`Capture V1 request timed out ${timeoutPhase} after ${attemptTimeoutMs}ms`);
389
- (0, external_named_error_js_namespaceObject.defineErrorName)(error, 'AbortError');
389
+ (0, named_error_js_namespaceObject.defineErrorName)(error, 'AbortError');
390
390
  reject(error);
391
391
  try {
392
392
  controller?.abort(error);
@@ -527,7 +527,7 @@ const sendCaptureV1Batch = async (runtime, messages, libraryVersion, options = {
527
527
  const remainingTime = ()=>maxElapsedMs - Math.max(0, safeNow(elapsedNow) - startedAt);
528
528
  let requestId;
529
529
  try {
530
- requestId = (options.generateRequestId ?? external_id_js_namespaceObject.createId)();
530
+ requestId = (options.generateRequestId ?? id_js_namespaceObject.createId)();
531
531
  } catch {
532
532
  requestId = `capture-${isoNow(now)}`;
533
533
  }
@@ -620,14 +620,14 @@ const sendCaptureV1TeardownBatches = (runtime, messages, libraryVersion, options
620
620
  const createdAt = isoNow(now);
621
621
  const batch = [];
622
622
  let body = serializeEnvelope(createdAt, batch);
623
- let bodyBytes = (0, external_utf8_js_namespaceObject.utf8Bytes)(body);
623
+ let bodyBytes = (0, utf8_js_namespaceObject.utf8Bytes)(body);
624
624
  while(index + batch.length < prepared.length && batch.length < CAPTURE_V1_MAX_BATCH_EVENTS){
625
625
  const candidate = prepared[index + batch.length];
626
626
  const candidateBody = serializeEnvelope(createdAt, [
627
627
  ...batch,
628
628
  candidate
629
629
  ]);
630
- const candidateBytes = (0, external_utf8_js_namespaceObject.utf8Bytes)(candidateBody);
630
+ const candidateBytes = (0, utf8_js_namespaceObject.utf8Bytes)(candidateBody);
631
631
  if (candidateBytes > remaining || batch.length > 0 && candidateBytes > CAPTURE_V1_BATCH_TARGET_BYTES) break;
632
632
  batch.push(candidate);
633
633
  body = candidateBody;
@@ -643,7 +643,7 @@ const sendCaptureV1TeardownBatches = (runtime, messages, libraryVersion, options
643
643
  index += batch.length;
644
644
  let requestId;
645
645
  try {
646
- requestId = (options.generateRequestId ?? external_id_js_namespaceObject.createId)();
646
+ requestId = (options.generateRequestId ?? id_js_namespaceObject.createId)();
647
647
  } catch {
648
648
  requestId = `capture-${createdAt}`;
649
649
  }
@@ -1,7 +1,7 @@
1
- import { MAX_ANALYTICS_BATCH_EVENTS } from "./analytics-internal.mjs";
2
- import { createId } from "./id.mjs";
3
- import { defineErrorName } from "./named-error.mjs";
4
- import { utf8Bytes } from "./utf8.mjs";
1
+ import { MAX_ANALYTICS_BATCH_EVENTS } from "../analytics-internal.mjs";
2
+ import { createId } from "../../../primitives/id.mjs";
3
+ import { defineErrorName } from "../../../primitives/named-error.mjs";
4
+ import { utf8Bytes } from "../../../primitives/utf8.mjs";
5
5
  const RETRYABLE_STATUSES = [
6
6
  408,
7
7
  500,
@@ -1,4 +1,4 @@
1
- import type { EventBuffer } from './event-buffer';
1
+ import type { EventBuffer } from '../admission/event-buffer';
2
2
  export interface LaneDeliveryContext {
3
3
  readonly signal: AbortSignal | undefined;
4
4
  canContinue(): boolean;
@@ -1,4 +1,4 @@
1
- import type { PersonProfileMode } from './analytics-options';
1
+ import type { PersonProfileMode } from '../analytics-options';
2
2
  export declare const snapshotPersonProfileMode: (read: () => unknown) => PersonProfileMode;
3
3
  export declare const shouldProcessPerson: (mode: PersonProfileMode, identified: boolean, grouped: boolean, explicitlyEnabled: boolean) => boolean;
4
4
  export interface PersonProperties {
@@ -1,4 +1,4 @@
1
- import type { BrowserProducts } from './browser-client';
1
+ import type { BrowserProducts } from '../../core/context/browser-client';
2
2
  import { type AutocaptureOptions } from './autocapture-options';
3
3
  export type { AutocaptureOptions, RageclickOptions } from './autocapture-options';
4
4
  /** Include DOM autocapture statically instead of loading it during initialization. */
@@ -1,6 +1,6 @@
1
1
  import type { Disposable, ExtensionToken } from '@posthog/browser-common';
2
2
  import type { FeatureFlagResult, FeatureFlagsReloadResult, FlagsCallback, JsonType } from './flags-options';
3
- import type { IPostHogInternal, BrowserExtension } from './browser-client';
3
+ import type { IPostHogInternal, BrowserExtension } from '../../core/context/browser-client';
4
4
  export interface FeatureFlags extends BrowserExtension {
5
5
  setup(client: IPostHogInternal): void | Promise<void>;
6
6
  getFeatureFlag(key: string): FeatureFlagResult | undefined;
@@ -1,4 +1,4 @@
1
- import type { BrowserExtension } from './browser-client';
1
+ import type { BrowserExtension } from '../../core/context/browser-client';
2
2
  import type { CaptureLogOptions } from '@posthog/types';
3
3
  export interface LogsExtension extends BrowserExtension {
4
4
  captureLog(options: CaptureLogOptions): void;
@@ -1,5 +1,5 @@
1
1
  import type { Disposable } from '@posthog/browser-common';
2
- import type { BrowserExtension } from './browser-client';
2
+ import type { BrowserExtension } from '../../core/context/browser-client';
3
3
  import type { SurveyCallback, DisplaySurveyOptions, SurveyRenderReason } from './surveys-options';
4
4
  export interface SurveysExtension extends BrowserExtension {
5
5
  getElementSelectors(): Set<string>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@posthog/browser",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "A small, extension-based PostHog client for modern browsers",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -14,44 +14,44 @@
14
14
  "ARCHITECTURE.md",
15
15
  "README.md"
16
16
  ],
17
- "main": "dist/index.js",
18
- "module": "dist/index.mjs",
19
- "types": "dist/index.d.ts",
17
+ "main": "dist/composition/npm/index.js",
18
+ "module": "dist/composition/npm/index.mjs",
19
+ "types": "dist/composition/npm/index.d.ts",
20
20
  "exports": {
21
21
  ".": {
22
- "types": "./dist/index.d.ts",
23
- "require": "./dist/index.js",
24
- "import": "./dist/index.mjs"
22
+ "types": "./dist/composition/npm/index.d.ts",
23
+ "require": "./dist/composition/npm/index.js",
24
+ "import": "./dist/composition/npm/index.mjs"
25
25
  },
26
26
  "./core": {
27
- "types": "./dist/core.d.ts",
28
- "require": "./dist/core.js",
29
- "import": "./dist/core.mjs"
27
+ "types": "./dist/composition/npm/core.d.ts",
28
+ "require": "./dist/composition/npm/core.js",
29
+ "import": "./dist/composition/npm/core.mjs"
30
30
  },
31
31
  "./flags": {
32
- "types": "./dist/flags.d.ts",
33
- "require": "./dist/flags.js",
34
- "import": "./dist/flags.mjs"
32
+ "types": "./dist/products/flags/flags.d.ts",
33
+ "require": "./dist/products/flags/flags.js",
34
+ "import": "./dist/products/flags/flags.mjs"
35
35
  },
36
36
  "./analytics": {
37
- "types": "./dist/analytics.d.ts",
38
- "require": "./dist/analytics.js",
39
- "import": "./dist/analytics.mjs"
37
+ "types": "./dist/products/analytics/analytics.d.ts",
38
+ "require": "./dist/products/analytics/analytics.js",
39
+ "import": "./dist/products/analytics/analytics.mjs"
40
40
  },
41
41
  "./logs": {
42
- "types": "./dist/logs.d.ts",
43
- "import": "./dist/logs.mjs",
44
- "require": "./dist/logs.js"
42
+ "types": "./dist/products/logs/logs.d.ts",
43
+ "import": "./dist/products/logs/logs.mjs",
44
+ "require": "./dist/products/logs/logs.js"
45
45
  },
46
46
  "./surveys": {
47
- "types": "./dist/surveys.d.ts",
48
- "require": "./dist/surveys.js",
49
- "import": "./dist/surveys.mjs"
47
+ "types": "./dist/products/surveys/surveys.d.ts",
48
+ "require": "./dist/products/surveys/surveys.js",
49
+ "import": "./dist/products/surveys/surveys.mjs"
50
50
  },
51
51
  "./autocapture": {
52
- "types": "./dist/autocapture.d.ts",
53
- "require": "./dist/autocapture.js",
54
- "import": "./dist/autocapture.mjs"
52
+ "types": "./dist/products/autocapture/autocapture.d.ts",
53
+ "require": "./dist/products/autocapture/autocapture.js",
54
+ "import": "./dist/products/autocapture/autocapture.mjs"
55
55
  }
56
56
  },
57
57
  "dependencies": {
package/dist/core.mjs DELETED
@@ -1,5 +0,0 @@
1
- import { createPostHogCore } from "./posthog.mjs";
2
- const createPostHog = async (options)=>createPostHogCore(options);
3
- export { version } from "./version.mjs";
4
- export { FeatureFlagsExtension } from "./flags-token.mjs";
5
- export { createPostHog };
package/dist/version.mjs DELETED
@@ -1,2 +0,0 @@
1
- const version = "0.4.0";
2
- export { version };
File without changes