@posthog/convex 1.0.9 → 2.0.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 (39) hide show
  1. package/README.md +88 -36
  2. package/dist/client/index.d.ts +17 -22
  3. package/dist/client/index.d.ts.map +1 -1
  4. package/dist/client/index.js +26 -41
  5. package/dist/client/index.js.map +1 -1
  6. package/dist/component/_generated/api.d.ts +4 -0
  7. package/dist/component/_generated/api.d.ts.map +1 -1
  8. package/dist/component/_generated/api.js.map +1 -1
  9. package/dist/component/_generated/component.d.ts +1 -21
  10. package/dist/component/_generated/component.d.ts.map +1 -1
  11. package/dist/component/_generated/server.d.ts +11 -0
  12. package/dist/component/_generated/server.d.ts.map +1 -1
  13. package/dist/component/_generated/server.js +1 -0
  14. package/dist/component/_generated/server.js.map +1 -1
  15. package/dist/component/convex.config.d.ts +18 -1
  16. package/dist/component/convex.config.d.ts.map +1 -1
  17. package/dist/component/convex.config.js +21 -1
  18. package/dist/component/convex.config.js.map +1 -1
  19. package/dist/component/crons.d.ts +12 -0
  20. package/dist/component/crons.d.ts.map +1 -0
  21. package/dist/component/crons.js +42 -0
  22. package/dist/component/crons.js.map +1 -0
  23. package/dist/component/lib.d.ts +18 -32
  24. package/dist/component/lib.d.ts.map +1 -1
  25. package/dist/component/lib.js +90 -60
  26. package/dist/component/lib.js.map +1 -1
  27. package/dist/component/version.d.ts +1 -1
  28. package/dist/component/version.js +1 -1
  29. package/package.json +7 -6
  30. package/src/client/index.test.ts +85 -63
  31. package/src/client/index.ts +35 -60
  32. package/src/component/_generated/api.ts +4 -0
  33. package/src/component/_generated/component.ts +3 -27
  34. package/src/component/_generated/server.ts +11 -0
  35. package/src/component/convex.config.ts +21 -1
  36. package/src/component/crons.test.ts +62 -0
  37. package/src/component/crons.ts +52 -0
  38. package/src/component/lib.ts +86 -59
  39. package/src/component/version.ts +1 -1
package/README.md CHANGED
@@ -21,21 +21,41 @@ Found a bug? Feature request? [File it here](https://github.com/PostHog/posthog-
21
21
 
22
22
  ## 🚀 Quick Start
23
23
 
24
- Install the package:
24
+ Install the package (requires Convex 1.39 or newer):
25
25
 
26
26
  ```sh
27
27
  pnpm add @posthog/convex
28
28
  ```
29
29
 
30
- Register the component in your `convex/convex.config.ts`:
30
+ Register the component in your `convex/convex.config.ts` and forward the env vars from your app to the component:
31
31
 
32
32
  ```ts
33
33
  // convex/convex.config.ts
34
34
  import { defineApp } from "convex/server";
35
+ import { v } from "convex/values";
35
36
  import posthog from "@posthog/convex/convex.config.js";
36
37
 
37
- const app = defineApp();
38
- app.use(posthog);
38
+ const app = defineApp({
39
+ env: {
40
+ // Required. PostHog project token (`phc_…`) — used to send events and evaluate flags remotely.
41
+ POSTHOG_PROJECT_TOKEN: v.string(),
42
+ // Optional. PostHog host. Defaults to `https://us.i.posthog.com`; use `https://eu.i.posthog.com` for EU Cloud or your self-hosted URL.
43
+ POSTHOG_HOST: v.optional(v.string()),
44
+ // Optional. A feature flags secure API key (`phs_…`, recommended) or personal API key (`phx_…`). Setting it enables local feature flag evaluation and starts the refresh cron.
45
+ POSTHOG_PERSONAL_API_KEY: v.optional(v.string()),
46
+ // Optional. Cron interval (seconds) for refreshing flag definitions. Defaults to 60. Raise it on free-tier dev deployments to reduce function-call usage.
47
+ POSTHOG_FLAGS_POLLING_INTERVAL_SECONDS: v.optional(v.string()),
48
+ },
49
+ });
50
+
51
+ app.use(posthog, {
52
+ env: {
53
+ POSTHOG_PROJECT_TOKEN: app.env.POSTHOG_PROJECT_TOKEN,
54
+ POSTHOG_HOST: app.env.POSTHOG_HOST,
55
+ POSTHOG_PERSONAL_API_KEY: app.env.POSTHOG_PERSONAL_API_KEY,
56
+ POSTHOG_FLAGS_POLLING_INTERVAL_SECONDS: app.env.POSTHOG_FLAGS_POLLING_INTERVAL_SECONDS,
57
+ },
58
+ });
39
59
 
40
60
  export default app;
41
61
  ```
@@ -43,7 +63,7 @@ export default app;
43
63
  Set your PostHog credentials on your Convex deployment:
44
64
 
45
65
  ```sh
46
- npx convex env set POSTHOG_API_KEY phc_your_project_api_key
66
+ npx convex env set POSTHOG_PROJECT_TOKEN phc_your_project_token
47
67
  npx convex env set POSTHOG_HOST https://us.i.posthog.com
48
68
  ```
49
69
 
@@ -53,49 +73,27 @@ To enable local feature flag evaluation, also set a [feature flags secure API ke
53
73
  npx convex env set POSTHOG_PERSONAL_API_KEY phs_your_feature_flags_secure_api_key
54
74
  ```
55
75
 
56
- > Personal API keys (`phx_…`) also still work for local evaluation, but PostHog recommends the project-scoped feature flags secure API key going forward.
76
+ > Personal API keys (`phx_…`) also still work for local evaluation, but PostHog recommends the project-scoped feature flags secure API key going forward. This env var also gates the component's built-in refresh cron: when it's set the cron is registered at deploy time and refreshes flag definitions once a minute; when it isn't, the cron isn't registered at all so idle dev deployments don't burn function calls. The gate is evaluated at module-load (i.e. deploy) time — `npx convex dev` redeploys automatically when you set the env var, but production deployments need a manual redeploy for the cron to start.
57
77
 
58
- Create a `convex/posthog.ts` file to initialize the client. Read the keys from `process.env` and pass them to the constructor the client captures them and forwards them to component actions as needed:
78
+ Create a `convex/posthog.ts` file to initialize the client. Credentials live on the component, so this file is just for callbacks (identify, beforeSend):
59
79
 
60
80
  ```ts
61
81
  // convex/posthog.ts
62
82
  import { PostHog } from "@posthog/convex";
63
83
  import { components } from "./_generated/api";
64
84
 
65
- export const posthog = new PostHog(components.posthog, {
66
- apiKey: process.env.POSTHOG_API_KEY,
67
- personalApiKey: process.env.POSTHOG_PERSONAL_API_KEY,
68
- host: process.env.POSTHOG_HOST,
69
- });
85
+ export const posthog = new PostHog(components.posthog);
70
86
  ```
71
87
 
72
- Schedule a cron in your own `convex/crons.ts` that refreshes the flag definitions on whatever interval suits you. The client class captures the keys you passed in `posthog.ts` and forwards them automatically:
88
+ That's the whole setup feature flag methods will start returning live values on the next cron tick. The component refreshes flag definitions every minute when `POSTHOG_PERSONAL_API_KEY` is set. To tune the cadence (e.g. raise it to `300` for a free-tier dev deployment), set `POSTHOG_FLAGS_POLLING_INTERVAL_SECONDS` and redeploy:
73
89
 
74
- ```ts
75
- // convex/crons.ts
76
- import { cronJobs } from "convex/server";
77
- import { internalAction } from "./_generated/server";
78
- import { internal } from "./_generated/api";
79
- import { posthog } from "./posthog";
80
-
81
- export const refreshPosthogFlags = internalAction({
82
- args: {},
83
- handler: async (ctx) => {
84
- await posthog.refreshFlagDefinitions(ctx);
85
- },
86
- });
87
-
88
- const crons = cronJobs();
89
- crons.interval(
90
- "refresh posthog feature flag definitions",
91
- { minutes: 1 },
92
- internal.crons.refreshPosthogFlags
93
- );
94
-
95
- export default crons;
90
+ ```sh
91
+ npx convex env set POSTHOG_FLAGS_POLLING_INTERVAL_SECONDS 300
96
92
  ```
97
93
 
98
- That's the whole setup feature flag methods will start returning live values on the next cron tick, or you can call `posthog.refreshFlagDefinitions(ctx)` from an action whenever you want an immediate refresh.
94
+ If you call a local-eval method (`getFeatureFlag`, `isFeatureEnabled`, …) without `POSTHOG_PERSONAL_API_KEY` configured, the client throws with a pointer to the remote `evaluateFlag` / `evaluateFlagPayload` / `evaluateAllFlags` methods. While the first cron tick is still in flight (PAK is set but no definitions are cached yet) the local methods return `undefined` so your fallback path keeps working.
95
+
96
+ Need to force a refresh between cron ticks (e.g. just after creating a flag in development)? Call `posthog.reloadFeatureFlags(ctx)` from an action — same name and shape as `posthog-node`.
99
97
 
100
98
  ## 📊 Capturing Events
101
99
 
@@ -349,6 +347,60 @@ Three methods:
349
347
 
350
348
  Same option shape as the local methods (`groups`, `personProperties`, `groupProperties`, `disableGeoip`, `flagKeys` on the all-flags variant). Pick local when the flag is suitable and the cost of `/flags/definitions` polling is justified; pick remote when it isn't.
351
349
 
350
+ ## 🔄 Differences from `posthog-node`
351
+
352
+ Method names and option shapes (`groups`, `personProperties`, `groupProperties`, `disableGeoip`, `flagKeys`) match `posthog-node` where they reasonably can. The differences:
353
+
354
+ - **Every method takes a Convex `ctx` first.** `posthog.capture(ctx, { … })` rather than `posthog.capture({ … })`. Required by Convex's runtime.
355
+ - **Flag methods and `captureException` use an args object instead of positional args.** `getFeatureFlag(ctx, { key, distinctId, … })` rather than `getFeatureFlag(key, distinctId, …)`. The event methods (`capture`, `identify`, `alias`, `groupIdentify`) already use args objects in `posthog-node`, so those match.
356
+ - **No `captureImmediate` / `identifyImmediate` / `aliasImmediate` variants.** All component actions use the `Immediate` paths under the hood — Convex isolates don't have a clean lifecycle hook for batching and flushing, so the queued mode is gone.
357
+ - **No `flush()` / `shutdown()`.** Same reason — there's nothing to flush.
358
+ - **Local-eval methods don't auto-fall-back to remote.** `posthog-node`'s `getFeatureFlag` quietly hits `/flags` when local eval can't reach a verdict. Ours returns `undefined` (or `null` from `getFeatureFlagResult`) and you call `evaluateFlag` / `evaluateFlagPayload` / `evaluateAllFlags` explicitly for remote. Auto-fallback would force every local-eval call into an action context (since queries can't make network calls), which would defeat the reactivity win.
359
+ - **Local-eval methods throw when `POSTHOG_PERSONAL_API_KEY` isn't configured.** `posthog-node` returns `undefined`; the throw here points you at the remote `evaluate*` methods so you can't get stuck wondering why your rollouts don't take effect.
360
+
361
+ ## ⬆️ Migrating from v1
362
+
363
+ v2 moves credentials from the client constructor onto the component itself, using [Convex 1.39's typed component env vars](https://docs.convex.dev/components/authoring#environment-variables). It also bundles the refresh cron inside the component. The result is less plumbing per call site and a setup that's safe to leave running on free-tier dev deployments.
364
+
365
+ To upgrade:
366
+
367
+ 1. **Bump your app's `convex` dependency** to `^1.39.0` (required for the typed component env-var API).
368
+ 2. **Rename** the `POSTHOG_API_KEY` env var to `POSTHOG_PROJECT_TOKEN`. The new name is unambiguous: this is your PostHog project token (`phc_…`), distinct from `POSTHOG_PERSONAL_API_KEY` (the `phx_…` / `phs_…` key used for local flag evaluation).
369
+ ```sh
370
+ npx convex env set POSTHOG_PROJECT_TOKEN phc_your_project_token
371
+ npx convex env unset POSTHOG_API_KEY
372
+ ```
373
+ `POSTHOG_PROJECT_TOKEN` is now **required at deploy time** (declared as `v.string()` on the component). In v1 the component would deploy without it set and silently no-op event sends at runtime; v2 fails fast at deploy. Make sure the env var is set before deploying.
374
+ 3. **Declare the env vars on your app and forward them to the component** in `convex/convex.config.ts`:
375
+ ```ts
376
+ const app = defineApp({
377
+ env: {
378
+ POSTHOG_PROJECT_TOKEN: v.string(),
379
+ POSTHOG_HOST: v.optional(v.string()),
380
+ POSTHOG_PERSONAL_API_KEY: v.optional(v.string()),
381
+ },
382
+ });
383
+ app.use(posthog, {
384
+ env: {
385
+ POSTHOG_PROJECT_TOKEN: app.env.POSTHOG_PROJECT_TOKEN,
386
+ POSTHOG_HOST: app.env.POSTHOG_HOST,
387
+ POSTHOG_PERSONAL_API_KEY: app.env.POSTHOG_PERSONAL_API_KEY,
388
+ },
389
+ });
390
+ ```
391
+ 4. **Drop the credential options** from `new PostHog(...)`:
392
+ ```diff
393
+ - export const posthog = new PostHog(components.posthog, {
394
+ - apiKey: process.env.POSTHOG_API_KEY,
395
+ - personalApiKey: process.env.POSTHOG_PERSONAL_API_KEY,
396
+ - host: process.env.POSTHOG_HOST,
397
+ - });
398
+ + export const posthog = new PostHog(components.posthog);
399
+ ```
400
+ 5. **Delete your `convex/crons.ts`** if it only existed to refresh PostHog flag definitions — the component ships its own cron now, conditionally registered only when `POSTHOG_PERSONAL_API_KEY` is set. `posthog.refreshFlagDefinitions(ctx)` was renamed to `posthog.reloadFeatureFlags(ctx)` for parity with `posthog-node`; the cron is the primary refresh path but you can still call this manually from an action when you need an immediate refresh.
401
+
402
+ Everything else — the `capture`, `identify`, `getFeatureFlag`, `evaluateFlag`, etc. APIs — is unchanged.
403
+
352
404
  ## 📦 Example
353
405
 
354
406
  See the [example app](../../examples/example-convex/) for a working demo.
@@ -9,6 +9,10 @@ type SchedulerCtx = {
9
9
  type RunQueryCtx = {
10
10
  runQuery: (reference: any, args: any) => Promise<any>;
11
11
  };
12
+ /** Context with runAction — available in actions. Used by remote flag evaluation methods. */
13
+ type RunActionCtx = {
14
+ runAction: (reference: any, args: any) => Promise<any>;
15
+ };
12
16
  type FeatureFlagOptions = {
13
17
  groups?: Record<string, string>;
14
18
  personProperties?: Record<string, any>;
@@ -33,38 +37,29 @@ export declare function normalizeError(error: unknown): {
33
37
  stack?: string;
34
38
  name?: string;
35
39
  };
36
- /** Context with runAction — available in actions. Used by `refreshFlagDefinitions`. */
37
- type RunActionCtx = {
38
- runAction: (reference: any, args: any) => Promise<any>;
39
- };
40
+ /**
41
+ * Client-side wrapper around the PostHog Convex component.
42
+ *
43
+ * Credentials (`POSTHOG_PROJECT_TOKEN`, `POSTHOG_HOST`, `POSTHOG_PERSONAL_API_KEY`) are declared on the
44
+ * component in `convex.config.ts` and read directly inside the component's actions — they don't
45
+ * need to be plumbed through every call site. Configure callbacks (identify, beforeSend) on the
46
+ * client; everything else lives in env vars.
47
+ */
40
48
  export declare class PostHog {
41
49
  component: ComponentApi;
42
- private apiKey;
43
- private personalApiKey;
44
- private host;
45
50
  private beforeSend?;
46
51
  private identifyFn?;
47
52
  constructor(component: ComponentApi, options?: {
48
- apiKey?: string;
49
- /**
50
- * Either a [feature flags secure API key](https://posthog.com/docs/feature-flags/local-evaluation#step-1-find-your-feature-flags-secure-api-key)
51
- * (`phs_…`, recommended) or a personal API key (`phx_…`) with feature-flag read access.
52
- * Required for local feature flag evaluation; defaults to `process.env.POSTHOG_PERSONAL_API_KEY`.
53
- * The key is captured at construction time and forwarded to the component whenever you call
54
- * `refreshFlagDefinitions(ctx)`.
55
- */
56
- personalApiKey?: string;
57
- host?: string;
58
53
  beforeSend?: BeforeSendFn | BeforeSendFn[];
59
54
  identify?: IdentifyFn;
60
55
  });
61
56
  /**
62
- * Trigger a refresh of the cached feature flag definitions. Must be called from an action
63
- * context (typically a cron handler) the component fetches `/flags/definitions` and writes
64
- * the result to its singleton table. Returns the component's status object so callers can log
65
- * misconfiguration without throwing.
57
+ * Trigger a one-off refresh of the cached feature flag definitions. Named for parity with
58
+ * `posthog-node`'s `reloadFeatureFlags()`. The component already refreshes on a cron when
59
+ * `POSTHOG_PERSONAL_API_KEY` is set, so call this only when you need an immediate refresh
60
+ * (e.g. after creating a flag in development). Requires an action context.
66
61
  */
67
- refreshFlagDefinitions(ctx: RunActionCtx): Promise<unknown>;
62
+ reloadFeatureFlags(ctx: RunActionCtx): Promise<unknown>;
68
63
  private resolveDistinctId;
69
64
  private runBeforeSend;
70
65
  private loadEvaluator;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAA;AACxE,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EAErB,KAAK,QAAQ,EAEd,MAAM,0BAA0B,CAAA;AAEjC,qEAAqE;AACrE,KAAK,YAAY,GAAG;IAAE,SAAS,EAAE,SAAS,CAAA;CAAE,CAAA;AAE5C,4EAA4E;AAC5E,KAAK,WAAW,GAAG;IAAE,QAAQ,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,CAAA;CAAE,CAAA;AAE5E,KAAK,kBAAkB,GAAG;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC/B,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACtC,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAA;IACrD,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB,CAAA;AAED,KAAK,eAAe,GAAG,kBAAkB,GAAG;IAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,CAAA;AAanE,YAAY,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,QAAQ,EAA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,GAC9D,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;IAY3B;;;;OAIG;IACG,gBAAgB,CACpB,GAAG,EAAE,YAAY,EACjB,IAAI,EAAE;QAAE,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,eAAe,GAC9C,OAAO,CAAC;QACT,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAA;QAC9C,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;KAC9C,CAAC;CAcH"}
@@ -1,12 +1,4 @@
1
1
  import { LocalFeatureFlagEvaluator, } from './feature-flags/index.js';
2
- const DEFAULT_HOST = 'https://us.i.posthog.com';
3
- function normalizeApiKey(value) {
4
- return typeof value === 'string' ? value.trim() : '';
5
- }
6
- function normalizeHost(value) {
7
- const normalizedValue = typeof value === 'string' ? value.trim() : '';
8
- return normalizedValue || DEFAULT_HOST;
9
- }
10
2
  export function normalizeError(error) {
11
3
  if (error instanceof Error) {
12
4
  return { message: error.message, stack: error.stack, name: error.name };
@@ -27,33 +19,31 @@ export function normalizeError(error) {
27
19
  }
28
20
  return { message: String(error) };
29
21
  }
22
+ /**
23
+ * Client-side wrapper around the PostHog Convex component.
24
+ *
25
+ * Credentials (`POSTHOG_PROJECT_TOKEN`, `POSTHOG_HOST`, `POSTHOG_PERSONAL_API_KEY`) are declared on the
26
+ * component in `convex.config.ts` and read directly inside the component's actions — they don't
27
+ * need to be plumbed through every call site. Configure callbacks (identify, beforeSend) on the
28
+ * client; everything else lives in env vars.
29
+ */
30
30
  export class PostHog {
31
31
  component;
32
- apiKey;
33
- personalApiKey;
34
- host;
35
32
  beforeSend;
36
33
  identifyFn;
37
34
  constructor(component, options) {
38
35
  this.component = component;
39
- this.apiKey = normalizeApiKey(options?.apiKey ?? process.env.POSTHOG_API_KEY);
40
- this.personalApiKey = normalizeApiKey(options?.personalApiKey ?? process.env.POSTHOG_PERSONAL_API_KEY);
41
- this.host = normalizeHost(options?.host ?? process.env.POSTHOG_HOST);
42
36
  this.beforeSend = options?.beforeSend;
43
37
  this.identifyFn = options?.identify;
44
38
  }
45
39
  /**
46
- * Trigger a refresh of the cached feature flag definitions. Must be called from an action
47
- * context (typically a cron handler) the component fetches `/flags/definitions` and writes
48
- * the result to its singleton table. Returns the component's status object so callers can log
49
- * misconfiguration without throwing.
40
+ * Trigger a one-off refresh of the cached feature flag definitions. Named for parity with
41
+ * `posthog-node`'s `reloadFeatureFlags()`. The component already refreshes on a cron when
42
+ * `POSTHOG_PERSONAL_API_KEY` is set, so call this only when you need an immediate refresh
43
+ * (e.g. after creating a flag in development). Requires an action context.
50
44
  */
51
- async refreshFlagDefinitions(ctx) {
52
- return await ctx.runAction(this.component.lib.refreshFlagDefinitions, {
53
- apiKey: this.apiKey,
54
- personalApiKey: this.personalApiKey,
55
- host: this.host,
56
- });
45
+ async reloadFeatureFlags(ctx) {
46
+ return await ctx.runAction(this.component.lib.refreshFlagDefinitions, {});
57
47
  }
58
48
  async resolveDistinctId(ctx, argsDistinctId) {
59
49
  if (this.identifyFn) {
@@ -80,7 +70,18 @@ export class PostHog {
80
70
  }
81
71
  async loadEvaluator(ctx) {
82
72
  const row = (await ctx.runQuery(this.component.lib.getFlagDefinitions, {}));
83
- if (!row)
73
+ if (!row.localEvalConfigured) {
74
+ // Loud failure rather than silent `undefined`: a caller invoking a local-eval method
75
+ // without `POSTHOG_PERSONAL_API_KEY` configured almost certainly meant to use a remote
76
+ // `evaluate*` method instead. Throwing tells them exactly what to do.
77
+ throw new Error('PostHog: local feature flag evaluation is not configured. ' +
78
+ 'Set POSTHOG_PERSONAL_API_KEY on your Convex deployment, or call the remote ' +
79
+ '`evaluateFlag` / `evaluateFlagPayload` / `evaluateAllFlags` methods instead ' +
80
+ '(action context only).');
81
+ }
82
+ // PAK is set but the cron hasn't populated the cache yet — return null so callers fall
83
+ // back to their `undefined` graceful-degrade path until definitions land.
84
+ if (!row.data)
84
85
  return null;
85
86
  let parsed;
86
87
  try {
@@ -103,8 +104,6 @@ export class PostHog {
103
104
  if (!result)
104
105
  return;
105
106
  await ctx.scheduler.runAfter(0, this.component.lib.capture, {
106
- apiKey: this.apiKey,
107
- host: this.host,
108
107
  distinctId: result.distinctId,
109
108
  event: result.event,
110
109
  properties: result.properties ? JSON.stringify(result.properties) : undefined,
@@ -125,8 +124,6 @@ export class PostHog {
125
124
  if (!result)
126
125
  return;
127
126
  await ctx.scheduler.runAfter(0, this.component.lib.identify, {
128
- apiKey: this.apiKey,
129
- host: this.host,
130
127
  distinctId: result.distinctId,
131
128
  properties: result.properties ? JSON.stringify(result.properties) : undefined,
132
129
  disableGeoip: args.disableGeoip,
@@ -141,8 +138,6 @@ export class PostHog {
141
138
  if (!result)
142
139
  return;
143
140
  await ctx.scheduler.runAfter(0, this.component.lib.groupIdentify, {
144
- apiKey: this.apiKey,
145
- host: this.host,
146
141
  groupType: args.groupType,
147
142
  groupKey: args.groupKey,
148
143
  properties: result.properties ? JSON.stringify(result.properties) : undefined,
@@ -162,8 +157,6 @@ export class PostHog {
162
157
  if (!result)
163
158
  return;
164
159
  await ctx.scheduler.runAfter(0, this.component.lib.alias, {
165
- apiKey: this.apiKey,
166
- host: this.host,
167
160
  distinctId: result.distinctId,
168
161
  alias: args.alias,
169
162
  disableGeoip: args.disableGeoip,
@@ -186,8 +179,6 @@ export class PostHog {
186
179
  if (!result)
187
180
  return;
188
181
  await ctx.scheduler.runAfter(0, this.component.lib.captureException, {
189
- apiKey: this.apiKey,
190
- host: this.host,
191
182
  distinctId: result.distinctId || undefined,
192
183
  errorMessage: message,
193
184
  errorStack: stack,
@@ -283,8 +274,6 @@ export class PostHog {
283
274
  async evaluateFlag(ctx, args) {
284
275
  const distinctId = await this.resolveDistinctId(ctx, args.distinctId);
285
276
  return (await ctx.runAction(this.component.lib.evaluateFlag, {
286
- apiKey: this.apiKey,
287
- host: this.host,
288
277
  key: args.key,
289
278
  distinctId,
290
279
  groups: args.groups,
@@ -300,8 +289,6 @@ export class PostHog {
300
289
  async evaluateFlagPayload(ctx, args) {
301
290
  const distinctId = await this.resolveDistinctId(ctx, args.distinctId);
302
291
  return (await ctx.runAction(this.component.lib.evaluateFlagPayload, {
303
- apiKey: this.apiKey,
304
- host: this.host,
305
292
  key: args.key,
306
293
  distinctId,
307
294
  groups: args.groups,
@@ -318,8 +305,6 @@ export class PostHog {
318
305
  async evaluateAllFlags(ctx, args) {
319
306
  const distinctId = await this.resolveDistinctId(ctx, args.distinctId);
320
307
  return (await ctx.runAction(this.component.lib.evaluateAllFlags, {
321
- apiKey: this.apiKey,
322
- host: this.host,
323
308
  distinctId,
324
309
  groups: args.groups,
325
310
  personProperties: args.personProperties,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAKL,yBAAyB,GAC1B,MAAM,0BAA0B,CAAA;AAiBjC,MAAM,YAAY,GAAG,0BAA0B,CAAA;AAE/C,SAAS,eAAe,CAAC,KAAe;IACtC,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;AACtD,CAAC;AAED,SAAS,aAAa,CAAC,KAAe;IACpC,MAAM,eAAe,GAAG,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;IACrE,OAAO,eAAe,IAAI,YAAY,CAAA;AACxC,CAAC;AAcD,MAAM,UAAU,cAAc,CAAC,KAAc;IAK3C,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;QAC3B,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,CAAA;IACzE,CAAC;IACD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC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,CAAC,UAAU,CAAC,CAAA;QACrE,OAAO,CAAC,MAAM,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,gBAAgB,EAAE;YAC/D,UAAU;YACV,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;YACvC,eAAe,EAAE,IAAI,CAAC,eAAe;YACrC,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,QAAQ,EAAE,IAAI,CAAC,QAAQ;SACxB,CAAC,CAGD,CAAA;IACH,CAAC;CACF"}
@@ -6,10 +6,14 @@
6
6
  * To regenerate, run `npx convex dev`.
7
7
  * @module
8
8
  */
9
+ import type * as crons from "../crons.js";
9
10
  import type * as lib from "../lib.js";
11
+ import type * as version from "../version.js";
10
12
  import type { ApiFromModules, FilterApi, FunctionReference } from "convex/server";
11
13
  declare const fullApi: ApiFromModules<{
14
+ crons: typeof crons;
12
15
  lib: typeof lib;
16
+ version: typeof version;
13
17
  }>;
14
18
  /**
15
19
  * A utility for referencing Convex functions in your app's public API.
@@ -1 +1 @@
1
- {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../src/component/_generated/api.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAEH,OAAO,KAAK,KAAK,GAAG,MAAM,WAAW,CAAC;AAEtC,OAAO,KAAK,EACV,cAAc,EACd,SAAS,EACT,iBAAiB,EAClB,MAAM,eAAe,CAAC;AAGvB,QAAA,MAAM,OAAO,EAAE,cAAc,CAAC;IAC5B,GAAG,EAAE,OAAO,GAAG,CAAC;CACjB,CAAiB,CAAC;AAEnB;;;;;;;GAOG;AACH,eAAO,MAAM,GAAG,EAAE,SAAS,CACzB,OAAO,OAAO,EACd,iBAAiB,CAAC,GAAG,EAAE,QAAQ,CAAC,CACjB,CAAC;AAElB;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ,EAAE,SAAS,CAC9B,OAAO,OAAO,EACd,iBAAiB,CAAC,GAAG,EAAE,UAAU,CAAC,CACnB,CAAC;AAElB,eAAO,MAAM,UAAU,EAAqC,EAAE,CAAC"}
1
+ {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../src/component/_generated/api.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAEH,OAAO,KAAK,KAAK,KAAK,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,KAAK,GAAG,MAAM,WAAW,CAAC;AACtC,OAAO,KAAK,KAAK,OAAO,MAAM,eAAe,CAAC;AAE9C,OAAO,KAAK,EACV,cAAc,EACd,SAAS,EACT,iBAAiB,EAClB,MAAM,eAAe,CAAC;AAGvB,QAAA,MAAM,OAAO,EAAE,cAAc,CAAC;IAC5B,KAAK,EAAE,OAAO,KAAK,CAAC;IACpB,GAAG,EAAE,OAAO,GAAG,CAAC;IAChB,OAAO,EAAE,OAAO,OAAO,CAAC;CACzB,CAAiB,CAAC;AAEnB;;;;;;;GAOG;AACH,eAAO,MAAM,GAAG,EAAE,SAAS,CACzB,OAAO,OAAO,EACd,iBAAiB,CAAC,GAAG,EAAE,QAAQ,CAAC,CACjB,CAAC;AAElB;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ,EAAE,SAAS,CAC9B,OAAO,OAAO,EACd,iBAAiB,CAAC,GAAG,EAAE,UAAU,CAAC,CACnB,CAAC;AAElB,eAAO,MAAM,UAAU,EAAqC,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"api.js","sourceRoot":"","sources":["../../../src/component/_generated/api.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB;;;;;;;GAOG;AASH,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAE1D,MAAM,OAAO,GAER,MAAa,CAAC;AAEnB;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,GAAG,GAGZ,MAAa,CAAC;AAElB;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,QAAQ,GAGjB,MAAa,CAAC;AAElB,MAAM,CAAC,MAAM,UAAU,GAAG,iBAAiB,EAAmB,CAAC"}
1
+ {"version":3,"file":"api.js","sourceRoot":"","sources":["../../../src/component/_generated/api.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB;;;;;;;GAOG;AAWH,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAE1D,MAAM,OAAO,GAIR,MAAa,CAAC;AAEnB;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,GAAG,GAGZ,MAAa,CAAC;AAElB;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,QAAQ,GAGjB,MAAa,CAAC;AAElB,MAAM,CAAC,MAAM,UAAU,GAAG,iBAAiB,EAAmB,CAAC"}
@@ -22,18 +22,14 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
22
22
  lib: {
23
23
  alias: FunctionReference<"action", "internal", {
24
24
  alias: string;
25
- apiKey: string;
26
25
  disableGeoip?: boolean;
27
26
  distinctId: string;
28
- host: string;
29
27
  }, any, Name>;
30
28
  capture: FunctionReference<"action", "internal", {
31
- apiKey: string;
32
29
  disableGeoip?: boolean;
33
30
  distinctId: string;
34
31
  event: string;
35
32
  groups?: string;
36
- host: string;
37
33
  properties?: string;
38
34
  sendFeatureFlags?: boolean;
39
35
  timestamp?: number;
@@ -41,67 +37,51 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
41
37
  }, any, Name>;
42
38
  captureException: FunctionReference<"action", "internal", {
43
39
  additionalProperties?: string;
44
- apiKey: string;
45
40
  distinctId?: string;
46
41
  errorMessage: string;
47
42
  errorName?: string;
48
43
  errorStack?: string;
49
- host: string;
50
44
  }, any, Name>;
51
45
  evaluateAllFlags: FunctionReference<"action", "internal", {
52
- apiKey: string;
53
46
  disableGeoip?: boolean;
54
47
  distinctId: string;
55
48
  flagKeys?: Array<string>;
56
49
  groupProperties?: any;
57
50
  groups?: any;
58
- host: string;
59
51
  personProperties?: any;
60
52
  }, any, Name>;
61
53
  evaluateFlag: FunctionReference<"action", "internal", {
62
- apiKey: string;
63
54
  disableGeoip?: boolean;
64
55
  distinctId: string;
65
56
  flagKeys?: Array<string>;
66
57
  groupProperties?: any;
67
58
  groups?: any;
68
- host: string;
69
59
  key: string;
70
60
  personProperties?: any;
71
61
  }, any, Name>;
72
62
  evaluateFlagPayload: FunctionReference<"action", "internal", {
73
- apiKey: string;
74
63
  disableGeoip?: boolean;
75
64
  distinctId: string;
76
65
  flagKeys?: Array<string>;
77
66
  groupProperties?: any;
78
67
  groups?: any;
79
- host: string;
80
68
  key: string;
81
69
  personProperties?: any;
82
70
  }, any, Name>;
83
71
  getFlagDefinitions: FunctionReference<"query", "internal", {}, any, Name>;
84
72
  groupIdentify: FunctionReference<"action", "internal", {
85
- apiKey: string;
86
73
  disableGeoip?: boolean;
87
74
  distinctId?: string;
88
75
  groupKey: string;
89
76
  groupType: string;
90
- host: string;
91
77
  properties?: string;
92
78
  }, any, Name>;
93
79
  identify: FunctionReference<"action", "internal", {
94
- apiKey: string;
95
80
  disableGeoip?: boolean;
96
81
  distinctId: string;
97
- host: string;
98
82
  properties?: string;
99
83
  }, any, Name>;
100
- refreshFlagDefinitions: FunctionReference<"action", "internal", {
101
- apiKey: string;
102
- host?: string;
103
- personalApiKey: string;
104
- }, any, Name>;
84
+ refreshFlagDefinitions: FunctionReference<"action", "internal", {}, any, Name>;
105
85
  };
106
86
  };
107
87
  //# sourceMappingURL=component.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/component/_generated/component.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAEvD;;;;;;;;;;GAUG;AACH,MAAM,MAAM,YAAY,CAAC,IAAI,SAAS,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,IAC3E;IACE,GAAG,EAAE;QACH,KAAK,EAAE,iBAAiB,CACtB,QAAQ,EACR,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,EAAE,MAAM,CAAC;YAClB,IAAI,EAAE,MAAM,CAAC;YACb,UAAU,CAAC,EAAE,MAAM,CAAC;SACrB,EACD,GAAG,EACH,IAAI,CACL,CAAC;QACF,QAAQ,EAAE,iBAAiB,CACzB,QAAQ,EACR,UAAU,EACV;YACE,MAAM,EAAE,MAAM,CAAC;YACf,YAAY,CAAC,EAAE,OAAO,CAAC;YACvB,UAAU,EAAE,MAAM,CAAC;YACnB,IAAI,EAAE,MAAM,CAAC;YACb,UAAU,CAAC,EAAE,MAAM,CAAC;SACrB,EACD,GAAG,EACH,IAAI,CACL,CAAC;QACF,sBAAsB,EAAE,iBAAiB,CACvC,QAAQ,EACR,UAAU,EACV;YAAE,MAAM,EAAE,MAAM,CAAC;YAAC,IAAI,CAAC,EAAE,MAAM,CAAC;YAAC,cAAc,EAAE,MAAM,CAAA;SAAE,EACzD,GAAG,EACH,IAAI,CACL,CAAC;KACH,CAAC;CACH,CAAC"}
1
+ {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/component/_generated/component.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAEvD;;;;;;;;;;GAUG;AACH,MAAM,MAAM,YAAY,CAAC,IAAI,SAAS,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,IAC3E;IACE,GAAG,EAAE;QACH,KAAK,EAAE,iBAAiB,CACtB,QAAQ,EACR,UAAU,EACV;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,YAAY,CAAC,EAAE,OAAO,CAAC;YAAC,UAAU,EAAE,MAAM,CAAA;SAAE,EAC7D,GAAG,EACH,IAAI,CACL,CAAC;QACF,OAAO,EAAE,iBAAiB,CACxB,QAAQ,EACR,UAAU,EACV;YACE,YAAY,CAAC,EAAE,OAAO,CAAC;YACvB,UAAU,EAAE,MAAM,CAAC;YACnB,KAAK,EAAE,MAAM,CAAC;YACd,MAAM,CAAC,EA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AAO,CAAC;YACvB,UAAU,EAAE,MAAM,CAAC;YACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;YACzB,eAAe,CAAC,EAAE,GAAG,CAAC;YACtB,MAAM,CAAC,EAAE,GAAG,CAAC;YACb,GAAG,EAAE,MAAM,CAAC;YACZ,gBAAgB,CAAC,EAAE,GAAG,CAAC;SACxB,EACD,GAAG,EACH,IAAI,CACL,CAAC;QACF,kBAAkB,EAAE,iBAAiB,CAAC,OAAO,EAAE,UAAU,EAAE,EAAE,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;QAC1E,aAAa,EAAE,iBAAiB,CAC9B,QAAQ,EACR,UAAU,EACV;YACE,YAAY,CAAC,EAAE,OAAO,CAAC;YACvB,UAAU,CAAC,EAAE,MAAM,CAAC;YACpB,QAAQ,EAAE,MAAM,CAAC;YACjB,SAAS,EAAE,MAAM,CAAC;YAClB,UAAU,CAAC,EAAE,MAAM,CAAC;SACrB,EACD,GAAG,EACH,IAAI,CACL,CAAC;QACF,QAAQ,EAAE,iBAAiB,CACzB,QAAQ,EACR,UAAU,EACV;YAAE,YAAY,CAAC,EAAE,OAAO,CAAC;YAAC,UAAU,EAAE,MAAM,CAAC;YAAC,UAAU,CAAC,EAAE,MAAM,CAAA;SAAE,EACnE,GAAG,EACH,IAAI,CACL,CAAC;QACF,sBAAsB,EAAE,iBAAiB,CACvC,QAAQ,EACR,UAAU,EACV,EAAE,EACF,GAAG,EACH,IAAI,CACL,CAAC;KACH,CAAC;CACH,CAAC"}
@@ -8,6 +8,15 @@
8
8
  */
9
9
  import type { ActionBuilder, HttpActionBuilder, MutationBuilder, QueryBuilder, GenericActionCtx, GenericMutationCtx, GenericQueryCtx, GenericDatabaseReader, GenericDatabaseWriter } from "convex/server";
10
10
  import type { DataModel } from "./dataModel.js";
11
+ /**
12
+ * Typesafe environment variables declared in `convex.config.ts`.
13
+ */
14
+ type Env = {
15
+ readonly POSTHOG_FLAGS_POLLING_INTERVAL_SECONDS: string | undefined;
16
+ readonly POSTHOG_HOST: string | undefined;
17
+ readonly POSTHOG_PERSONAL_API_KEY: string | undefined;
18
+ readonly POSTHOG_PROJECT_TOKEN: string;
19
+ };
11
20
  /**
12
21
  * Define a query in this Convex app's public API.
13
22
  *
@@ -75,6 +84,7 @@ export declare const internalAction: ActionBuilder<DataModel, "internal">;
75
84
  * @returns The wrapped function. Import this function from `convex/http.js` and route it to hook it up.
76
85
  */
77
86
  export declare const httpAction: HttpActionBuilder;
87
+ export declare const env: Env;
78
88
  /**
79
89
  * A set of services for use within Convex query functions.
80
90
  *
@@ -118,4 +128,5 @@ export type DatabaseReader = GenericDatabaseReader<DataModel>;
118
128
  * for the guarantees Convex provides your functions.
119
129
  */
120
130
  export type DatabaseWriter = GenericDatabaseWriter<DataModel>;
131
+ export {};
121
132
  //# sourceMappingURL=server.d.ts.map