Files

21 KiB

@hanzo/convex

2.0.6

Patch Changes

2.0.5

Patch Changes

2.0.4

Patch Changes

2.0.3

Patch Changes

2.0.2

Patch Changes

2.0.1

Patch Changes

  • #3684 714ffa5 Thanks @richardsolomou! - Fix the refresh cron not registering when INSIGHTS_PERSONAL_API_KEY is forwarded from the installing app. Convex only forwards component env vars at runtime, so the previous load-time gate saw an empty value during deploy-time module analysis and silently dropped the cron. The cron now registers unconditionally and gates at runtime.

    Fixes #3683. (2026-05-28)

  • Updated dependencies [7b84b75]:

2.0.0

Major Changes

  • #3662 4285c40 Thanks @richardsolomou! - v2 moves credentials onto the component via Convex 1.39's typed env-var config, bundles the flag-definitions refresh cron inside the component, and renames INSIGHTS_API_KEY → INSIGHTS_PROJECT_TOKEN.

    Breaking changes:

    • Requires Convex ^1.39.0 (peer dependency bumped).
    • INSIGHTS_API_KEY env var renamed to INSIGHTS_PROJECT_TOKEN, to clearly differentiate the project token (phc_…) from INSIGHTS_PERSONAL_API_KEY (phx_… / phs_…). INSIGHTS_PROJECT_TOKEN is now required at deploy time (Convex env validation enforces it); v1 silently no-op'd missing-token event sends at runtime.
    • apiKey, host, and personalApiKey no longer accepted on the Insights client constructor — declare them as env vars on the component instead.
    • apiKey and host are no longer arguments to the component's actions (capture, identify, evaluateFlag, etc.). refreshFlagDefinitions no longer takes any arguments.
    • The refresh cron is now registered inside the component and only fires when INSIGHTS_PERSONAL_API_KEY is set — delete any app-level convex/crons.ts that existed only to refresh Insights flags.
    • insights.refreshFlagDefinitions(ctx) renamed to insights.reloadFeatureFlags(ctx) for parity with insights-node.
    • Local-eval methods (getFeatureFlag, isFeatureEnabled, etc.) now throw when INSIGHTS_PERSONAL_API_KEY isn't configured, pointing callers at the remote evaluateFlag methods. They still return undefined during the warm-up window when PAK is set but the cron hasn't fetched yet.
    • New optional INSIGHTS_FLAGS_POLLING_INTERVAL_SECONDS env var lets you tune the cron cadence (default 60 seconds). Raise it on free-tier dev deployments to reduce function-call usage.

    See the migration guide in the README for the full diff. (2026-05-27)

1.0.10

Patch Changes

1.0.9

Patch Changes

1.0.8

Patch Changes

1.0.7

Patch Changes

1.0.6

Patch Changes

1.0.5

Patch Changes

1.0.4

Patch Changes

1.0.3

Patch Changes

1.0.2

Patch Changes

1.0.1

Patch Changes

1.0.0

Major Changes

  • #3622 a1a668e Thanks @richardsolomou! - Feature flags are now evaluated locally in the Convex runtime instead of via a per-call action to Insights. Your app schedules a cron that calls insights.refreshFlagDefinitions(ctx) on whatever interval suits you; the component fetches /flags/definitions, caches the result in a Convex table, and feature flag methods read from that cache and evaluate flags in-process. Methods work in queries (not just actions) and benefit from Convex's reactivity — a query reading a flag re-runs automatically when definitions change.

    Setup: pass the keys through new Insights(components.insights, { apiKey, personalApiKey, host }) in your convex/insights.ts. Convex components run in an isolated env namespace, so the client captures the keys at construction time and forwards them to the component when refreshFlagDefinitions(ctx) is called. Add a convex/crons.ts that schedules insights.refreshFlagDefinitions(ctx) — see the README for the exact shape.

    Two evaluation paths in this release. Pick the one that fits the flag:

    • Local (getFeatureFlag, isFeatureEnabled, getFeatureFlagPayload, getFeatureFlagResult, getAllFlags, getAllFlagsAndPayloads) — query/mutation/action context, no per-call round trip, reactive. Requires personalApiKey. Returns null/undefined when local eval can't reach a verdict (experience continuity, static cohorts, the is_not_set operator, or properties you don't pass in).
    • Remote (evaluateFlag, evaluateFlagPayload, evaluateAllFlags) — action context only. Hits Insights's /flags endpoint directly via insights-node's evaluateFlags. No personalApiKey needed. Handles every flag.

    Breaking changes in this major release:

    • Feature flag methods (getFeatureFlag, isFeatureEnabled, getFeatureFlagPayload, getFeatureFlagResult, getAllFlags, getAllFlagsAndPayloads) now accept any context with runQuery (queries, mutations, or actions) instead of requiring an action context.
    • Methods return undefined (or empty objects for the all-flags methods) when local evaluation can't reach a verdict. They no longer fall back to a server /flags request.
    • The sendFeatureFlagEvents option has been removed; with local evaluation there is no server-side /flags call to emit those events.
    • The component now declares a flagDefinitions table — re-deploy the component to apply the schema change.
    • The component no longer ships its own cron. Consumers schedule the refresh themselves via convex/crons.ts, which makes the polling interval explicit and gives the parent app's env vars a way to reach the action. (2026-05-19)

Patch Changes

0.2.33

Patch Changes

0.2.32

Patch Changes

0.2.31

Patch Changes

0.2.30

Patch Changes

0.2.29

Patch Changes

0.2.28

Patch Changes

0.2.27

Patch Changes

0.2.26

Patch Changes

0.2.25

Patch Changes

0.2.24

Patch Changes

0.2.23

Patch Changes

0.2.22

Patch Changes

0.2.21

Patch Changes

0.2.20

Patch Changes

0.2.19

Patch Changes

0.2.18

Patch Changes

0.2.17

Patch Changes

0.2.16

Patch Changes

0.2.15

Patch Changes

0.2.14

Patch Changes

0.2.13

Patch Changes

0.2.12

Patch Changes

0.2.11

Patch Changes

0.2.10

Patch Changes

0.2.9

Patch Changes

0.2.8

Patch Changes

0.2.7

Patch Changes

0.2.6

Patch Changes

0.2.5

Patch Changes

0.2.4

Patch Changes

0.2.3

Patch Changes

0.2.2

Patch Changes

0.2.1

Patch Changes

0.2.0

Minor Changes

Patch Changes

0.1.19

Patch Changes

0.1.18

Patch Changes

0.1.17

Patch Changes

0.1.16

Patch Changes

0.1.15

Patch Changes

0.1.14

Patch Changes

0.1.13

Patch Changes

0.1.12

Patch Changes

0.1.11

Patch Changes

0.1.10

Patch Changes

0.1.9

Patch Changes

0.1.8

Patch Changes

0.1.7

Patch Changes

0.1.6

Patch Changes

0.1.5

Patch Changes

0.1.4

Patch Changes

0.1.3

Patch Changes

0.1.2

Patch Changes

0.1.1

Patch Changes

0.1.0

Minor Changes

0.1.0

Minor Changes

Patch Changes