@posthog/browser 0.1.0 → 0.2.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.
Files changed (72) hide show
  1. package/ARCHITECTURE.md +29 -23
  2. package/README.md +66 -30
  3. package/dist/analytics-api.d.ts +26 -0
  4. package/dist/analytics-api.js +18 -0
  5. package/dist/analytics-api.mjs +1 -0
  6. package/dist/analytics-buffer.d.ts +3 -3
  7. package/dist/analytics-buffer.js +2 -161
  8. package/dist/analytics-buffer.mjs +2 -161
  9. package/dist/analytics-extension.d.ts +76 -0
  10. package/dist/analytics-extension.js +589 -0
  11. package/dist/analytics-extension.mjs +551 -0
  12. package/dist/analytics-internal.d.ts +32 -18
  13. package/dist/analytics-options.d.ts +7 -2
  14. package/dist/analytics-options.js +38 -1
  15. package/dist/analytics-options.mjs +17 -1
  16. package/dist/analytics.d.ts +4 -3
  17. package/dist/autocapture.d.ts +2 -2
  18. package/dist/autocapture.js +21 -10
  19. package/dist/autocapture.mjs +21 -10
  20. package/dist/automatic-analytics.d.ts +2 -2
  21. package/dist/browser-client.d.ts +44 -4
  22. package/dist/capture-properties.d.ts +9 -0
  23. package/dist/capture-properties.js +68 -0
  24. package/dist/capture-properties.mjs +30 -0
  25. package/dist/capture-v1.js +7 -19
  26. package/dist/capture-v1.mjs +1 -13
  27. package/dist/core.d.ts +7 -5
  28. package/dist/extensions/registry.d.ts +42 -7
  29. package/dist/extensions/registry.js +194 -37
  30. package/dist/extensions/registry.mjs +194 -37
  31. package/dist/flags-token.d.ts +4 -4
  32. package/dist/flags.js +16 -2
  33. package/dist/flags.mjs +16 -2
  34. package/dist/immutable.d.ts +1 -0
  35. package/dist/immutable.js +46 -0
  36. package/dist/immutable.mjs +8 -0
  37. package/dist/index.d.ts +7 -5
  38. package/dist/index.js +3 -67
  39. package/dist/index.mjs +3 -67
  40. package/dist/lane.js +1 -1
  41. package/dist/lane.mjs +1 -1
  42. package/dist/logs-internal.d.ts +2 -2
  43. package/dist/logs.js +5 -2
  44. package/dist/logs.mjs +5 -2
  45. package/dist/person-processing.d.ts +11 -0
  46. package/dist/person-processing.js +84 -0
  47. package/dist/person-processing.mjs +37 -0
  48. package/dist/posthog.d.ts +4 -3
  49. package/dist/posthog.js +155 -349
  50. package/dist/posthog.mjs +155 -349
  51. package/dist/rate-limiter.d.ts +5 -0
  52. package/dist/rate-limiter.js +14 -8
  53. package/dist/rate-limiter.mjs +14 -8
  54. package/dist/root-composition.d.ts +11 -0
  55. package/dist/root-composition.js +138 -0
  56. package/dist/root-composition.mjs +100 -0
  57. package/dist/state.d.ts +1 -0
  58. package/dist/state.js +4 -0
  59. package/dist/state.mjs +4 -0
  60. package/dist/surveys-extension.js +11 -6
  61. package/dist/surveys-extension.mjs +11 -6
  62. package/dist/surveys-internal.d.ts +3 -2
  63. package/dist/surveys.d.ts +0 -1
  64. package/dist/surveys.js +1 -4
  65. package/dist/surveys.mjs +1 -4
  66. package/dist/types.d.ts +13 -19
  67. package/dist/utf8.d.ts +1 -0
  68. package/dist/utf8.js +52 -0
  69. package/dist/utf8.mjs +14 -0
  70. package/dist/version.js +1 -1
  71. package/dist/version.mjs +1 -1
  72. package/package.json +3 -3
package/dist/utf8.mjs ADDED
@@ -0,0 +1,14 @@
1
+ const utf8Bytes = (value)=>{
2
+ let bytes = 0;
3
+ for(let index = 0; index < value.length; index++){
4
+ const code = value.charCodeAt(index);
5
+ if (code < 0x80) bytes++;
6
+ else if (code < 0x800) bytes += 2;
7
+ else if (code >= 0xd800 && code <= 0xdbff && value.charCodeAt(index + 1) >= 0xdc00) {
8
+ bytes += 4;
9
+ index++;
10
+ } else bytes += 3;
11
+ }
12
+ return bytes;
13
+ };
14
+ export { utf8Bytes };
package/dist/version.js CHANGED
@@ -27,7 +27,7 @@ var __webpack_require__ = {};
27
27
  })();
28
28
  var __webpack_exports__ = {};
29
29
  __webpack_require__.r(__webpack_exports__);
30
- const version = "0.1.0";
30
+ const version = "0.2.0";
31
31
  __webpack_require__.d(__webpack_exports__, {}, {
32
32
  version: version
33
33
  });
package/dist/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- const version = "0.1.0";
1
+ const version = "0.2.0";
2
2
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@posthog/browser",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "A small, extension-based PostHog client for modern browsers",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -55,8 +55,8 @@
55
55
  }
56
56
  },
57
57
  "dependencies": {
58
- "@posthog/browser-common": "^0.10.1",
59
- "@posthog/types": "^1.418.0"
58
+ "@posthog/browser-common": "^0.11.0",
59
+ "@posthog/types": "^1.425.1"
60
60
  },
61
61
  "devDependencies": {
62
62
  "@playwright/test": "1.52.0",