@theholocron/holocron-plugin-posthog 5.0.0-alpha.560 → 5.0.0-alpha.561

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/dist/index.d.mts CHANGED
@@ -65,12 +65,13 @@ export interface PluginContext {
65
65
  export declare function createContext(options?: PostHogPluginOptions): PluginContext;
66
66
  /** Builds the `analytics` capability from a plugin context. */
67
67
  export declare function analytics(ctx: PluginContext): Analytics;
68
- /** Creates the PostHog plugin: a `connection` probe and the `analytics` capability. */
68
+ /** Creates the PostHog plugin: a `connection` probe, `whoami` and the `analytics` capability. */
69
69
  export declare function createPlugin(options?: PostHogPluginOptions): {
70
70
  name: string;
71
71
  probes: {
72
72
  connection: import("@theholocron/cli").Probe;
73
73
  };
74
+ whoami: import("@theholocron/cli").ProviderAction;
74
75
  capabilities: {
75
76
  analytics: () => Analytics;
76
77
  };
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { AuthError, connectionProbe, createResolveToken } from "@theholocron/cli";
1
+ import { AuthError, connectionProbe, createResolveToken, whoamiAction } from "@theholocron/cli";
2
2
  import { createPostHogClient, createPostHogClient as createPostHogClient$1 } from "@theholocron/posthog-client";
3
3
  import { errorMessage } from "@theholocron/misc-utils";
4
4
  // src/auth.ts
@@ -92,7 +92,7 @@ function createContext(options = {}) {
92
92
  function analytics(ctx) {
93
93
  return new PostHogAnalytics(ctx.client, { host: ctx.options.host });
94
94
  }
95
- /** Creates the PostHog plugin: a `connection` probe and the `analytics` capability. */
95
+ /** Creates the PostHog plugin: a `connection` probe, `whoami` and the `analytics` capability. */
96
96
  function createPlugin(options = {}) {
97
97
  const ctx = createContext(options);
98
98
  return {
@@ -108,6 +108,16 @@ function createPlugin(options = {}) {
108
108
  fetch: options.fetch
109
109
  })
110
110
  }) },
111
+ whoami: whoamiAction({
112
+ provider: "posthog",
113
+ token: () => resolveToken(options),
114
+ verify: (token) => verifyToken(token, {
115
+ host: options.host,
116
+ baseUrl: options.baseUrl,
117
+ fetch: options.fetch
118
+ }),
119
+ tokens
120
+ }),
111
121
  capabilities: { analytics: () => analytics(ctx) }
112
122
  };
113
123
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theholocron/holocron-plugin-posthog",
3
- "version": "5.0.0-alpha.560",
3
+ "version": "5.0.0-alpha.561",
4
4
  "description": "Holocron plugin for PostHog. Implements the analytics capability — project provisioning and tracking token retrieval.",
5
5
  "keywords": [
6
6
  "analytics",
@@ -30,7 +30,7 @@
30
30
  "dist"
31
31
  ],
32
32
  "dependencies": {
33
- "@theholocron/posthog-client": "^1.58.0-alpha.61"
33
+ "@theholocron/posthog-client": "^1.58.0-alpha.62"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@types/node": "^26",
@@ -44,10 +44,10 @@
44
44
  "tsx": "4.23.15",
45
45
  "typescript": "^6.0.3",
46
46
  "vitest": "^5.1.1",
47
- "@theholocron/cli": "5.0.0-alpha.560",
47
+ "@theholocron/cli": "5.0.0-alpha.561",
48
48
  "@theholocron/env-utils": "^1.17.0-alpha.8",
49
49
  "@theholocron/eslint-config": "^8.9.0-alpha.24",
50
- "@theholocron/http-client": "^1.58.0-alpha.61",
50
+ "@theholocron/http-client": "^1.58.0-alpha.62",
51
51
  "@theholocron/misc-utils": "^1.17.0-alpha.8",
52
52
  "@theholocron/tsconfig": "^8.9.0-alpha.24",
53
53
  "@theholocron/tsdown-config": "^8.9.0-alpha.24",
@@ -55,7 +55,7 @@
55
55
  },
56
56
  "peerDependencies": {
57
57
  "@theholocron/misc-utils": "^1.16.0",
58
- "@theholocron/cli": "5.0.0-alpha.560"
58
+ "@theholocron/cli": "5.0.0-alpha.561"
59
59
  },
60
60
  "engines": {
61
61
  "node": ">=22"