posthog-js-lite 0.0.5 → 2.0.0-alpha1

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 -24
  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 -1
  46. package/dist/src/utils/context.js +0 -187
  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 -163
  61. package/src/utils/lz-string.js +0 -511
  62. package/src/utils/utils.ts +0 -28
package/README.md CHANGED
@@ -1,25 +1,3 @@
1
- [![NPM Version](https://img.shields.io/npm/v/posthog-js-lite.svg)](https://www.npmjs.com/package/posthog-js-lite)
2
- [![minified](https://badgen.net/bundlephobia/min/posthog-js-lite)](https://bundlephobia.com/result?p=posthog-js-lite)
3
- [![minified + gzipped](https://badgen.net/bundlephobia/minzip/posthog-js-lite)](https://bundlephobia.com/result?p=posthog-js-lite)
1
+ # PostHog Web
4
2
 
5
- **This library is still a work in progress!**
6
-
7
- Reimplementation of posthog-js to be as light and modular as possible.
8
-
9
- Goals:
10
- - simple api
11
- - can do autocapture, but enabled via a plugin (not yet)
12
- - runs in the oldest browsers (not yet)
13
- - might break some APIs (if not now, then when?)
14
-
15
- Supports already:
16
- - very simple api
17
- - capture & identify calls
18
- - $context from window
19
- - only send events after optin if needed
20
- - payload compression
21
- - 10kb (includes 5kb compression code)
22
-
23
- Browser support:
24
- - This library ES6 compatible browsers (everything except IE). If you need to support IE,
25
- feel free to transpile the source to ES5 after including it in your bundle.
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'