Skip to content

feat(convex): allow optional POSTHOG_PROJECT_TOKEN and add disabled option - #5859

Merged
marandaneto merged 4 commits into
mainfrom
feat/convex-optional-project-token
Nov 25, 2026
Merged

marandaneto merged 4 commits into
mainfrom
feat/convex-optional-project-token

Conversation

@dustinbyrne

Copy link
Copy Markdown
Contributor

Problem

@posthog/convex declared POSTHOG_PROJECT_TOKEN as required (v.string()) in the component's convex.config.ts. When an installing app declares POSTHOG_PROJECT_TOKEN: v.optional(v.string()) in its own defineApp({ env }) so dev or preview deployments can run without sending events to production, Convex refuses to deploy because an optional app env var cannot be bound to a required component env var.

Closes #5611.

Changes

  • Optional POSTHOG_PROJECT_TOKEN on the component (packages/convex/src/component/convex.config.ts, _generated/server.ts): Changed POSTHOG_PROJECT_TOKEN from v.string() to v.optional(v.string()). Existing apps that declare POSTHOG_PROJECT_TOKEN: v.string() in their own defineApp({ env }) continue to work and keep deploy-time enforcement; apps that want tokenless dev/preview deployments can declare v.optional(v.string()) or omit the binding.
  • Disabled component behavior when POSTHOG_PROJECT_TOKEN is unset or blank (packages/convex/src/component/lib.ts):
    • readConfig() warns once per isolate (re-arming if a token is later configured and then cleared) rather than spamming on every dropped call.
    • localEvaluationEnabled() now requires a non-empty POSTHOG_PROJECT_TOKEN, so ensureRefreshLoop and refreshLoop schedule no ticks even if POSTHOG_PERSONAL_API_KEY is set.
    • getFlagDefinitions returns { disabled: true, data: null, ... } when POSTHOG_PROJECT_TOKEN is unset (suppressing any stale cached definitions), and PostHog.loadEvaluator() degrades to undefined / {} instead of throwing "local feature flag evaluation is not configured".
  • Optional disabled?: boolean constructor option on PostHog (packages/convex/src/client/index.ts): Matches posthog-node / posthog-python and lets callers short-circuit all capture, exception, flag, and reloadFeatureFlags calls before scheduling or invoking Convex component functions or running identify / beforeSend callbacks (for example, disabled: !process.env.POSTHOG_PROJECT_TOKEN).
  • Tests and changeset: Added unit, type-binding, and example-app integration tests covering optional/required app bindings, component disablement (including refresh-loop gating and once-per-isolate warning behavior), and client-side disabled: true short-circuiting. Added a minor changeset for @posthog/convex.

Release info Sub-libraries affected

Libraries affected

  • All of them
  • posthog-js (web)
  • posthog-js-lite (web lite)
  • posthog-node
  • posthog-docusaurus
  • posthog-react-native
  • @posthog/react-native-plugin
  • @posthog/react
  • @posthog/ai
  • @posthog/convex
  • @posthog/next
  • @posthog/nextjs-config
  • @posthog/nuxt
  • @posthog/openfeature-node-provider
  • @posthog/openfeature-web-provider
  • @posthog/rollup-plugin
  • @posthog/webpack-plugin
  • @posthog/types
  • @posthog/browser-common

Checklist

  • All commits are signed (see Commit signing)
  • Tests for new code
  • Accounted for the impact of any changes across different platforms
  • Accounted for backwards compatibility of any changes (no breaking changes!)
  • Took care not to unnecessarily increase the bundle size

If releasing new changes

  • Ran pnpm changeset to generate a changeset file

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

  • Tools / agent: Antigravity (with a fresh read-only reviewer subagent for diff review), directed by @dustinbyrne.
  • Design choice: Aligned @posthog/convex with posthog-node / posthog-python disabled-client semantics instead of using a magic sentinel string for POSTHOG_PROJECT_TOKEN. Making POSTHOG_PROJECT_TOKEN optional on the component lets each app choose whether its own defineApp({ env }) enforces fail-at-deploy (v.string()) or permits tokenless dev/preview deployments (v.optional(v.string())), while new PostHog(components.posthog, { disabled }) provides an optional fast-path to avoid scheduling no-op component actions.
  • Validation: Ran oxfmt --check, pnpm lint, pnpm check-types, pnpm build, pnpm test:unit, and pnpm test:integration in packages/convex (11 test files, 232 tests passing, 0 type/lint errors). No live Convex cloud deployment test was run.

@dustinbyrne dustinbyrne self-assigned this Nov 23, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Coherence

📄 0 spec file errors · ⛔ 0 broken rules · 🚪 0 unchecked inputs · 🐛 0 bugs that came back

What is Coherence?

Coherence compares the code with its spec files (*.spec.md). A spec file lists the rules for one part of the code.

This check read 44 parts of the code and 7 rules.

Tip

Nothing to fix.

@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

SDK performance: posthog-node

Benchmarks completed. No changes flagged for review.

Flags require at least a 5% change in the median and all six pairs agreeing on direction. This is a noise filter, not proof of a performance change or a CI gate.

View all results
Test Measurement Before PR With PR Change Assessment
Capture and deliver events (32-byte payload, burst)
Shard: capture
Allocations per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ V8 samples do not expose total allocation count; sample count is not object count.​; head:​ V8 samples do not expose total allocation count; sample count is not object count.​
Capture and deliver events (4,096-byte payload, burst)
Shard: capture
Allocations per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ V8 samples do not expose total allocation count; sample count is not object count.​; head:​ V8 samples do not expose total allocation count; sample count is not object count.​
Capture and deliver events (32-byte payload, steady)
Shard: capture
Allocations per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ V8 samples do not expose total allocation count; sample count is not object count.​; head:​ V8 samples do not expose total allocation count; sample count is not object count.​
Capture and deliver events (4,096-byte payload, steady)
Shard: capture
Allocations per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ V8 samples do not expose total allocation count; sample count is not object count.​; head:​ V8 samples do not expose total allocation count; sample count is not object count.​
Queue an event (32-byte payload)
Shard: capture
Allocations per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ V8 samples do not expose total allocation count; sample count is not object count.​; head:​ V8 samples do not expose total allocation count; sample count is not object count.​
Queue an event (4,096-byte payload)
Shard: capture
Allocations per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ V8 samples do not expose total allocation count; sample count is not object count.​; head:​ V8 samples do not expose total allocation count; sample count is not object count.​
Evaluate all 10 flags
Shard: flags-scaling
Allocations per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ V8 samples do not expose total allocation count; sample count is not object count.​; head:​ V8 samples do not expose total allocation count; sample count is not object count.​
Evaluate all 100 flags
Shard: flags-scaling
Allocations per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ V8 samples do not expose total allocation count; sample count is not object count.​; head:​ V8 samples do not expose total allocation count; sample count is not object count.​
Evaluate all 1,000 flags
Shard: flags-scaling
Allocations per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ V8 samples do not expose total allocation count; sample count is not object count.​; head:​ V8 samples do not expose total allocation count; sample count is not object count.​
Evaluate one boolean flag
Shard: flags-single
Allocations per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ V8 samples do not expose total allocation count; sample count is not object count.​; head:​ V8 samples do not expose total allocation count; sample count is not object count.​
Evaluate a cohort-filtered flag
Shard: flags-single
Allocations per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ V8 samples do not expose total allocation count; sample count is not object count.​; head:​ V8 samples do not expose total allocation count; sample count is not object count.​
Evaluate a flag (early match)
Shard: flags-single
Allocations per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ V8 samples do not expose total allocation count; sample count is not object count.​; head:​ V8 samples do not expose total allocation count; sample count is not object count.​
Evaluate a flag (late match)
Shard: flags-single
Allocations per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ V8 samples do not expose total allocation count; sample count is not object count.​; head:​ V8 samples do not expose total allocation count; sample count is not object count.​
Evaluate a flag (no match)
Shard: flags-single
Allocations per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ V8 samples do not expose total allocation count; sample count is not object count.​; head:​ V8 samples do not expose total allocation count; sample count is not object count.​
Evaluate a property-filtered flag
Shard: flags-single
Allocations per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ V8 samples do not expose total allocation count; sample count is not object count.​; head:​ V8 samples do not expose total allocation count; sample count is not object count.​
Evaluate a regex-filtered flag
Shard: flags-single
Allocations per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ V8 samples do not expose total allocation count; sample count is not object count.​; head:​ V8 samples do not expose total allocation count; sample count is not object count.​
Evaluate a rollout flag
Shard: flags-single
Allocations per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ V8 samples do not expose total allocation count; sample count is not object count.​; head:​ V8 samples do not expose total allocation count; sample count is not object count.​
Evaluate a multivariate flag
Shard: flags-single
Allocations per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ V8 samples do not expose total allocation count; sample count is not object count.​; head:​ V8 samples do not expose total allocation count; sample count is not object count.​
Capture and deliver events (32-byte payload, burst)
Shard: capture
Allocated memory per operation (estimated) 17.68 KiB/op 17.49 KiB/op 1.1% less memory Not flagged
Capture and deliver events (32-byte payload, burst)
Shard: capture
Time per operation 24.71 µs/op 25.76 µs/op 4.3% more time Not flagged
Capture and deliver events (32-byte payload, burst)
Shard: capture
Idle process memory (RSS) 103.71 MiB 103.74 MiB <0.1% more memory Not flagged
Capture and deliver events (32-byte payload, burst)
Shard: capture
Observed peak process memory (RSS) 109.69 MiB 109.25 MiB 0.4% less memory Not flagged
Capture and deliver events (32-byte payload, burst)
Shard: capture
Managed heap after settling 10.61 MiB 10.6 MiB <0.1% less memory Not flagged
Capture and deliver events (32-byte payload, burst)
Shard: capture
Process memory after settling (RSS) 109.16 MiB 108.7 MiB 0.4% less memory Not flagged
Capture and deliver events (32-byte payload, burst)
Shard: capture
Process CPU time per operation 42.7 µs/op 44.46 µs/op 4.1% more time Not flagged
Capture and deliver events (32-byte payload, burst)
Shard: capture
Lifetime peak process memory (RSS) 109.8 MiB 109.25 MiB 0.5% less memory Not flagged
Capture and deliver events (4,096-byte payload, burst)
Shard: capture
Allocated memory per operation (estimated) 33.28 KiB/op 33.63 KiB/op 1% more memory Not flagged
Capture and deliver events (4,096-byte payload, burst)
Shard: capture
Time per operation 37.62 µs/op 37.62 µs/op <0.1% more time Not flagged
Capture and deliver events (4,096-byte payload, burst)
Shard: capture
Idle process memory (RSS) 106.51 MiB 106.4 MiB 0.1% less memory Not flagged
Capture and deliver events (4,096-byte payload, burst)
Shard: capture
Observed peak process memory (RSS) 129.17 MiB 128.71 MiB 0.4% less memory Not flagged
Capture and deliver events (4,096-byte payload, burst)
Shard: capture
Managed heap after settling 10.61 MiB 10.61 MiB <0.1% less memory Not flagged
Capture and deliver events (4,096-byte payload, burst)
Shard: capture
Process memory after settling (RSS) 120.9 MiB 120.42 MiB 0.4% less memory Not flagged
Capture and deliver events (4,096-byte payload, burst)
Shard: capture
Process CPU time per operation 57.51 µs/op 56.9 µs/op 1.1% less time Not flagged
Capture and deliver events (4,096-byte payload, burst)
Shard: capture
Lifetime peak process memory (RSS) 129.17 MiB 128.71 MiB 0.4% less memory Not flagged
Capture and deliver events (32-byte payload, steady)
Shard: capture
Allocated memory per operation (estimated) 17.24 KiB/op 17.92 KiB/op 4% more memory Not flagged
Capture and deliver events (32-byte payload, steady)
Shard: capture
Time per operation 24.06 µs/op 24.47 µs/op 1.7% more time Not flagged
Capture and deliver events (32-byte payload, steady)
Shard: capture
Idle process memory (RSS) 103.84 MiB 103.88 MiB <0.1% more memory Not flagged
Capture and deliver events (32-byte payload, steady)
Shard: capture
Observed peak process memory (RSS) 108.98 MiB 109.19 MiB 0.2% more memory Not flagged
Capture and deliver events (32-byte payload, steady)
Shard: capture
Managed heap after settling 10.77 MiB 10.77 MiB <0.1% less memory Not flagged
Capture and deliver events (32-byte payload, steady)
Shard: capture
Process memory after settling (RSS) 108.98 MiB 108.98 MiB No observed change Not flagged
Capture and deliver events (32-byte payload, steady)
Shard: capture
Process CPU time per operation 42.34 µs/op 43.32 µs/op 2.3% more time Not flagged
Capture and deliver events (32-byte payload, steady)
Shard: capture
Lifetime peak process memory (RSS) 109.01 MiB 109.2 MiB 0.2% more memory Not flagged
Capture and deliver events (4,096-byte payload, steady)
Shard: capture
Allocated memory per operation (estimated) 32.41 KiB/op 32.71 KiB/op 0.9% more memory Not flagged
Capture and deliver events (4,096-byte payload, steady)
Shard: capture
Time per operation 35.11 µs/op 35.71 µs/op 1.7% more time Not flagged
Capture and deliver events (4,096-byte payload, steady)
Shard: capture
Idle process memory (RSS) 106.21 MiB 105.98 MiB 0.2% less memory Not flagged
Capture and deliver events (4,096-byte payload, steady)
Shard: capture
Observed peak process memory (RSS) 117.75 MiB 117.73 MiB <0.1% less memory Not flagged
Capture and deliver events (4,096-byte payload, steady)
Shard: capture
Managed heap after settling 10.78 MiB 10.77 MiB <0.1% less memory Not flagged
Capture and deliver events (4,096-byte payload, steady)
Shard: capture
Process memory after settling (RSS) 115.3 MiB 115.27 MiB <0.1% less memory Not flagged
Capture and deliver events (4,096-byte payload, steady)
Shard: capture
Process CPU time per operation 54.25 µs/op 55.09 µs/op 1.5% more time Not flagged
Capture and deliver events (4,096-byte payload, steady)
Shard: capture
Lifetime peak process memory (RSS) 117.75 MiB 117.73 MiB <0.1% less memory Not flagged
Queue an event (32-byte payload)
Shard: capture
Allocated memory per operation (estimated) 13.96 KiB/op 14.41 KiB/op 3.2% more memory Not flagged
Queue an event (32-byte payload)
Shard: capture
Time per operation 18.73 µs/op 18.98 µs/op 1.3% more time Not flagged
Queue an event (32-byte payload)
Shard: capture
Process CPU time per operation 36.2 µs/op 36.48 µs/op 0.8% more time Not flagged
Queue an event (4,096-byte payload)
Shard: capture
Allocated memory per operation (estimated) 17.76 KiB/op 17.9 KiB/op 0.8% more memory Not flagged
Queue an event (4,096-byte payload)
Shard: capture
Time per operation 24.75 µs/op 25.25 µs/op 2% more time Not flagged
Queue an event (4,096-byte payload)
Shard: capture
Process CPU time per operation 43.01 µs/op 43.95 µs/op 2.2% more time Not flagged
Evaluate all 10 flags
Shard: flags-scaling
Allocated memory per operation (estimated) 133.76 KiB/op 132.65 KiB/op 0.8% less memory Not flagged
Evaluate all 10 flags
Shard: flags-scaling
Time per operation 125.1 µs/op 127.37 µs/op 1.8% more time Not flagged
Evaluate all 10 flags
Shard: flags-scaling
Process CPU time per operation 229.05 µs/op 232.84 µs/op 1.7% more time Not flagged
Evaluate all 100 flags
Shard: flags-scaling
Allocated memory per operation (estimated) 1.23 MiB/op 1.23 MiB/op 0.1% more memory Not flagged
Evaluate all 100 flags
Shard: flags-scaling
Time per operation 1.04 ms/op 1.04 ms/op 0.2% less time Not flagged
Evaluate all 100 flags
Shard: flags-scaling
Process CPU time per operation 1.81 ms/op 1.8 ms/op 0.2% less time Not flagged
Evaluate all 1,000 flags
Shard: flags-scaling
Allocated memory per operation (estimated) 12.16 MiB/op 12.13 MiB/op 0.2% less memory Not flagged
Evaluate all 1,000 flags
Shard: flags-scaling
Time per operation 12.02 ms/op 11.85 ms/op 1.5% less time Not flagged
Evaluate all 1,000 flags
Shard: flags-scaling
Process CPU time per operation 19.07 ms/op 18.77 ms/op 1.6% less time Not flagged
Evaluate 1,000 flags under concurrent load
Shard: flags-memory
Idle process memory (RSS) 286.75 MiB 286.39 MiB 0.1% less memory Not flagged
Evaluate 1,000 flags under concurrent load
Shard: flags-memory
Observed peak process memory (RSS) 297.35 MiB 297.81 MiB 0.2% more memory Not flagged
Evaluate 1,000 flags under concurrent load
Shard: flags-memory
Managed heap after settling 9.91 MiB 9.91 MiB <0.1% less memory Not flagged
Evaluate 1,000 flags under concurrent load
Shard: flags-memory
Process memory after settling (RSS) 296.88 MiB 297.48 MiB 0.2% more memory Not flagged
Evaluate 1,000 flags under concurrent load
Shard: flags-memory
Lifetime peak process memory (RSS) 297.56 MiB 297.94 MiB 0.1% more memory Not flagged
Refresh 1,000 flag definitions
Shard: flags-memory
Idle process memory (RSS) 225.18 MiB 227.07 MiB 0.8% more memory Not flagged
Refresh 1,000 flag definitions
Shard: flags-memory
Observed peak process memory (RSS) 239.39 MiB 239.48 MiB <0.1% more memory Not flagged
Refresh 1,000 flag definitions
Shard: flags-memory
Managed heap after settling 12 MiB 12 MiB <0.1% less memory Not flagged
Refresh 1,000 flag definitions
Shard: flags-memory
Process memory after settling (RSS) 234.37 MiB 234.35 MiB <0.1% less memory Not flagged
Refresh 1,000 flag definitions
Shard: flags-memory
Lifetime peak process memory (RSS) 240.89 MiB 240.83 MiB <0.1% less memory Not flagged
Evaluate one boolean flag
Shard: flags-single
Allocated memory per operation (estimated) 17.15 KiB/op 17.09 KiB/op 0.4% less memory Not flagged
Evaluate one boolean flag
Shard: flags-single
Time per operation 47.87 µs/op 48.2 µs/op 0.7% more time Not flagged
Evaluate one boolean flag
Shard: flags-single
Process CPU time per operation 50.67 µs/op 50.63 µs/op <0.1% less time Not flagged
Evaluate a cohort-filtered flag
Shard: flags-single
Allocated memory per operation (estimated) 14.29 KiB/op 14.37 KiB/op 0.6% more memory Not flagged
Evaluate a cohort-filtered flag
Shard: flags-single
Time per operation 24.86 µs/op 25.3 µs/op 1.8% more time Not flagged
Evaluate a cohort-filtered flag
Shard: flags-single
Process CPU time per operation 28.96 µs/op 29.46 µs/op 1.7% more time Not flagged
Evaluate a flag (early match)
Shard: flags-single
Allocated memory per operation (estimated) 17.52 KiB/op 17.47 KiB/op 0.3% less memory Not flagged
Evaluate a flag (early match)
Shard: flags-single
Time per operation 25.48 µs/op 25.02 µs/op 1.8% less time Not flagged
Evaluate a flag (early match)
Shard: flags-single
Process CPU time per operation 28.94 µs/op 28.73 µs/op 0.7% less time Not flagged
Evaluate a flag (late match)
Shard: flags-single
Allocated memory per operation (estimated) 22.36 KiB/op 22.15 KiB/op 0.9% less memory Not flagged
Evaluate a flag (late match)
Shard: flags-single
Time per operation 26.12 µs/op 26.53 µs/op 1.6% more time Not flagged
Evaluate a flag (late match)
Shard: flags-single
Process CPU time per operation 30.32 µs/op 30.3 µs/op <0.1% less time Not flagged
Evaluate a flag (no match)
Shard: flags-single
Allocated memory per operation (estimated) 16.89 KiB/op 16.96 KiB/op 0.4% more memory Not flagged
Evaluate a flag (no match)
Shard: flags-single
Time per operation 3.58 µs/op 3.58 µs/op 0.1% more time Not flagged
Evaluate a flag (no match)
Shard: flags-single
Process CPU time per operation 7.01 µs/op 6.99 µs/op 0.3% less time Not flagged
Evaluate a property-filtered flag
Shard: flags-single
Allocated memory per operation (estimated) 12.77 KiB/op 12.68 KiB/op 0.7% less memory Not flagged
Evaluate a property-filtered flag
Shard: flags-single
Time per operation 26.03 µs/op 23.1 µs/op 11.2% less time Not flagged
Evaluate a property-filtered flag
Shard: flags-single
Process CPU time per operation 29.44 µs/op 26.95 µs/op 8.5% less time Not flagged
Evaluate a regex-filtered flag
Shard: flags-single
Allocated memory per operation (estimated) 18.17 KiB/op 18.43 KiB/op 1.4% more memory Not flagged
Evaluate a regex-filtered flag
Shard: flags-single
Time per operation 50.84 µs/op 50.36 µs/op 0.9% less time Not flagged
Evaluate a regex-filtered flag
Shard: flags-single
Process CPU time per operation 53.42 µs/op 53.66 µs/op 0.4% more time Not flagged
Evaluate a rollout flag
Shard: flags-single
Allocated memory per operation (estimated) 14.22 KiB/op 14.34 KiB/op 0.8% more memory Not flagged
Evaluate a rollout flag
Shard: flags-single
Time per operation 36.06 µs/op 37.73 µs/op 4.6% more time Not flagged
Evaluate a rollout flag
Shard: flags-single
Process CPU time per operation 39.27 µs/op 40.58 µs/op 3.3% more time Not flagged
Evaluate a multivariate flag
Shard: flags-single
Allocated memory per operation (estimated) 17.38 KiB/op 17.34 KiB/op 0.2% less memory Not flagged
Evaluate a multivariate flag
Shard: flags-single
Time per operation 47.19 µs/op 43.93 µs/op 6.9% less time Not flagged
Evaluate a multivariate flag
Shard: flags-single
Process CPU time per operation 50.67 µs/op 47.27 µs/op 6.7% less time Not flagged

Values are medians of paired measurements. Not flagged does not mean unchanged. Unavailable means a measurement could not be provided, not zero. Estimated allocation measurements retain their instrumentation uncertainty. RSS measures the whole process, not just SDK allocations; observed peaks are sampled checkpoints. Paired ranges in the diagnostics describe variability, not confidence intervals.

Each shard uses its own runner; compare Before PR against With PR within a row, not across shards.

Compared f05a993f9dfd2d98d90b910cf1c02e972311dbd1 → caf81b41078abbd56612a849d8b5b539ddff7701.

Full report and diagnostics

102 metric rows; 102 rows shown in all results. Omitted or shortened data remain in comparison.json, including per-runner environments, resource limits, measurement methods, samples and checkpoints.

@dustinbyrne
dustinbyrne marked this pull request as ready for review November 24, 2026 19:10
@dustinbyrne
dustinbyrne requested a review from a team as a code owner November 24, 2026 19:10
@dustinbyrne
dustinbyrne requested review from richardsolomou and removed request for a team November 24, 2026 19:10
@posthog-security-review-bot posthog-security-review-bot Bot added the security-review Request a security review label Nov 24, 2026
@posthog-security-review-bot

posthog-security-review-bot Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

✅ Security review complete — abfee3039468

No findings above the confidence threshold, in 4 min.

Add the security-review label to run again on the latest commit.

@posthog-security-review-bot posthog-security-review-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agent-driven security review - no findings.

@dustinbyrne

dustinbyrne commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor Author

additional context / justification here #5611 (comment)

@turnipdabeets turnipdabeets left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Keeping fail-fast in the app's own defineApp({ env }) while the component fails open fits the capture spec's missing-token requirement, and the setup guide already declares v.string() there, so existing apps keep the deploy-time check. Since this reverses the v2 "required at deploy" call from #3662, it'd be good to get a thumbs-up from Richard or Manoel before merging. Could we also add the tokenless dev/preview setup and the disabled option to the posthog.com Convex guide, which #5611 asks for too?

Comment thread packages/convex/src/component/lib.ts Resolved
Comment thread packages/convex/src/client/index.ts Resolved
@veria-ai

veria-ai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

PR overview

No security issues were found in this pull request.

Reviews

@richardsolomou richardsolomou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, happy with flipping the #3662 call here. apps that want it to fail at deploy still get that from v.string() in their own defineApp({ env }), and the setup guide already does that, so prod setups dont rly lose anything

@marandaneto

Copy link
Copy Markdown
Member

PostHog/posthog.com#22828 for the docs

Merged via the queue into main with commit be4704f Nov 25, 2026
86 checks passed
@marandaneto
marandaneto deleted the feat/convex-optional-project-token branch November 25, 2026 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

@posthog/convex: allow deployments without POSTHOG_PROJECT_TOKEN (declare it optional)

4 participants