@hogsend/plugin-posthog 0.3.0 → 0.5.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.
- package/README.md +6 -0
- package/package.json +3 -2
- package/src/types.ts +4 -20
package/README.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
PostHog integration for [Hogsend](https://github.com/dougwithseismic/hogsend):
|
|
4
4
|
person-property fetching with optional Redis caching, and event capture.
|
|
5
5
|
|
|
6
|
+
`createPostHogService` is the **reference implementation** of the `PostHogService`
|
|
7
|
+
contract — the contract itself (with `CaptureOptions`) lives in `@hogsend/core`
|
|
8
|
+
(canonical author import `@hogsend/engine`); this package re-exports them for
|
|
9
|
+
back-compat. To swap analytics, implement that interface. See
|
|
10
|
+
[docs/adr/0001-provider-boundary.md](https://github.com/dougwithseismic/hogsend/blob/main/docs/adr/0001-provider-boundary.md).
|
|
11
|
+
|
|
6
12
|
This package ships raw TypeScript source; consumers bundle it via their own build
|
|
7
13
|
(tsup `noExternal`). See the
|
|
8
14
|
[release model](https://github.com/dougwithseismic/hogsend/blob/main/docs/RELEASING.md).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hogsend/plugin-posthog",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -22,7 +22,8 @@
|
|
|
22
22
|
"access": "public"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"posthog-node": "^5.35.1"
|
|
25
|
+
"posthog-node": "^5.35.1",
|
|
26
|
+
"@hogsend/core": "^0.5.0"
|
|
26
27
|
},
|
|
27
28
|
"peerDependencies": {
|
|
28
29
|
"ioredis": ">=5.0.0"
|
package/src/types.ts
CHANGED
|
@@ -7,26 +7,10 @@ export interface PostHogServiceConfig {
|
|
|
7
7
|
cacheTtlSeconds?: number;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
identify(distinctId: string, properties: Record<string, unknown>): void;
|
|
16
|
-
|
|
17
|
-
isFeatureEnabled(opts: {
|
|
18
|
-
distinctId: string;
|
|
19
|
-
flag: string;
|
|
20
|
-
}): Promise<boolean>;
|
|
21
|
-
|
|
22
|
-
shutdown(): Promise<void>;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export interface CaptureOptions {
|
|
26
|
-
distinctId: string;
|
|
27
|
-
event: string;
|
|
28
|
-
properties?: Record<string, unknown>;
|
|
29
|
-
}
|
|
10
|
+
// The analytics-provider contract now lives in the neutral @hogsend/core
|
|
11
|
+
// package. These re-exports keep every existing
|
|
12
|
+
// `import ... from "@hogsend/plugin-posthog"` working unchanged.
|
|
13
|
+
export type { CaptureOptions, PostHogService } from "@hogsend/core";
|
|
30
14
|
|
|
31
15
|
export interface PersonPropertiesConfig {
|
|
32
16
|
apiKey: string;
|