posthog-js-lite 0.0.4 → 2.0.0-alpha2

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 (62) hide show
  1. package/README.md +2 -14
  2. package/index.ts +5 -0
  3. package/lib/index.cjs.js +1473 -0
  4. package/lib/index.cjs.js.map +1 -0
  5. package/lib/index.d.ts +177 -0
  6. package/lib/index.esm.js +1468 -0
  7. package/lib/index.esm.js.map +1 -0
  8. package/lib/node_modules/tslib/tslib.es6.d.ts +35 -0
  9. package/lib/posthog-core/src/eventemitter.d.ts +8 -0
  10. package/lib/posthog-core/src/index.d.ts +84 -0
  11. package/lib/posthog-core/src/lz-string.d.ts +8 -0
  12. package/lib/posthog-core/src/types.d.ts +68 -0
  13. package/lib/posthog-core/src/utils.d.ts +13 -0
  14. package/lib/posthog-web/index.d.ts +3 -0
  15. package/lib/posthog-web/src/context.d.ts +1 -0
  16. package/lib/posthog-web/src/posthog-web.d.ts +18 -0
  17. package/lib/posthog-web/src/storage.d.ts +12 -0
  18. package/package.json +5 -42
  19. package/src/context.ts +168 -0
  20. package/src/posthog-web.ts +70 -0
  21. package/src/storage.ts +115 -0
  22. package/test/posthog-web.spec.ts +32 -0
  23. package/tsconfig.json +4 -17
  24. package/.prettierrc +0 -7
  25. package/babel.config.js +0 -4
  26. package/dist/babel.config.d.ts +0 -5
  27. package/dist/babel.config.js +0 -5
  28. package/dist/babel.config.js.map +0 -1
  29. package/dist/package.json +0 -44
  30. package/dist/src/__tests__/index.d.ts +0 -1
  31. package/dist/src/__tests__/index.js +0 -48
  32. package/dist/src/__tests__/index.js.map +0 -1
  33. package/dist/src/index.d.ts +0 -19
  34. package/dist/src/index.js +0 -109
  35. package/dist/src/index.js.map +0 -1
  36. package/dist/src/targets/browser.d.ts +0 -19
  37. package/dist/src/targets/browser.js +0 -10
  38. package/dist/src/targets/browser.js.map +0 -1
  39. package/dist/src/targets/node.d.ts +0 -19
  40. package/dist/src/targets/node.js +0 -9
  41. package/dist/src/targets/node.js.map +0 -1
  42. package/dist/src/types.d.ts +0 -20
  43. package/dist/src/types.js +0 -3
  44. package/dist/src/types.js.map +0 -1
  45. package/dist/src/utils/context.d.ts +0 -18
  46. package/dist/src/utils/context.js +0 -182
  47. package/dist/src/utils/context.js.map +0 -1
  48. package/dist/src/utils/lz-string.d.ts +0 -14
  49. package/dist/src/utils/lz-string.js +0 -467
  50. package/dist/src/utils/lz-string.js.map +0 -1
  51. package/dist/src/utils/utils.d.ts +0 -3
  52. package/dist/src/utils/utils.js +0 -29
  53. package/dist/src/utils/utils.js.map +0 -1
  54. package/dist/tsconfig.tsbuildinfo +0 -2454
  55. package/src/__tests__/index.js +0 -47
  56. package/src/index.ts +0 -127
  57. package/src/targets/browser.ts +0 -17
  58. package/src/targets/node.ts +0 -6
  59. package/src/types.ts +0 -22
  60. package/src/utils/context.ts +0 -158
  61. package/src/utils/lz-string.js +0 -511
  62. package/src/utils/utils.ts +0 -27
package/README.md CHANGED
@@ -1,15 +1,3 @@
1
- WIP! Reimplementation of posthog-js to be as light and modular as possible.
1
+ # PostHog Web
2
2
 
3
- Goals:
4
- - simple api
5
- - can do autocapture, but enabled via a plugin (not yet)
6
- - runs in the oldest browsers (not yet)
7
- - might break some APIs (if not now, then when?)
8
-
9
- Supports already:
10
- - very simple api
11
- - capture & identify calls
12
- - $context from window
13
- - only send events after optin if needed
14
- - payload compression
15
- - 10kb (includes 5kb compression code)
3
+ > 🚧 This is a WIP. Currently the only officially supported way of using PostHog on the web is [posthog-js](https://github.com/PostHog/posthog-js)
package/index.ts ADDED
@@ -0,0 +1,5 @@
1
+ import { PostHog } from './src/posthog-web'
2
+
3
+ export default PostHog
4
+
5
+ export * from './src/posthog-web'