[ CONVEX COMPONENT · STABLE · MIT ]
@vllnt/convex-experiments
Deterministic A/B experimentation — sticky variant assignment and deduped exposure tracking
STABLE 0.1.0 · 1 GitHub star
Package details
Install
The untagged install gets the latest stable version (0.1.0). The canary tag tracks main (0.1.1-canary.131a7f7).
pnpm add @vllnt/convex-experiments
pnpm add @vllnt/convex-experiments@canaryRegister the component
Add it to your app’s convex/convex.config.ts, then run npx convex dev to generate the references.
import { defineApp } from "convex/server";
import experiments from "@vllnt/convex-experiments/convex.config";
const app = defineApp();
app.use(experiments);
export default app;Use it
Usage, options and examples are in the package README.
Downloads
- Last 7 days
- 15
- Since first publish
- 1,812
Downloads per week since 17 June 2026, oldest on the left. Weeks count back from 23 November 2026, so the first one may be shorter than seven days.
15 downloads in the last 7 days. 1,812 downloads since 17 June 2026. Source: npm, counted through 23 November 2026.
Show downloads per week as a table
| Week | Downloads |
|---|---|
| 17 June 2026 to 22 June 2026 | 429 |
| 23 June 2026 to 29 June 2026 | 15 |
| 30 June 2026 to 6 July 2026 | 51 |
| 7 July 2026 to 13 July 2026 | 24 |
| 14 July 2026 to 20 July 2026 | 8 |
| 21 July 2026 to 27 July 2026 | 4 |
| 28 July 2026 to 3 August 2026 | 7 |
| 4 August 2026 to 10 August 2026 | 10 |
| 11 August 2026 to 17 August 2026 | 19 |
| 18 August 2026 to 24 August 2026 | 2 |
| 25 August 2026 to 31 August 2026 | 322 |
| 1 September 2026 to 7 September 2026 | 370 |
| 8 September 2026 to 14 September 2026 | 46 |
| 15 September 2026 to 21 September 2026 | 10 |
| 22 September 2026 to 28 September 2026 | 13 |
| 29 September 2026 to 5 October 2026 | 11 |
| 6 October 2026 to 12 October 2026 | 9 |
| 13 October 2026 to 19 October 2026 | 6 |
| 20 October 2026 to 26 October 2026 | 6 |
| 27 October 2026 to 2 November 2026 | 335 |
| 3 November 2026 to 9 November 2026 | 82 |
| 10 November 2026 to 16 November 2026 | 18 |
| 17 November 2026 to 23 November 2026 | 15 |
Release history
Every release on a timeline, oldest on the left. A tall mark with its version is a stable release; a short mark is a canary build. The time axis is the one of the downloads chart, so a release stands above the week it shipped in.
1 stable release and 10 canary builds since 17 June 2026. Latest stable: 0.1.0 on 1 September 2026.
Show every release as a table
| Version | Kind | Published |
|---|---|---|
| 0.1.1-canary.131a7f7 | canary | 31 October 2026 |
| 0.1.1-canary.b4e25b0 | canary | 31 October 2026 |
| 0.1.0 | stable | 1 September 2026 |
| 0.1.0-canary.cead4b6 | canary | 1 September 2026 |
| 0.1.0-canary.bc84479 | canary | 31 August 2026 |
| 0.1.0-canary.0b21dd5 | canary | 31 August 2026 |
| 0.1.0-canary.cc3e7d0 | canary | 31 August 2026 |
| 0.1.0-canary.1c87af5 | canary | 17 June 2026 |
| 0.1.0-canary.73e1118 | canary | 17 June 2026 |
| 0.1.0-canary.f2cd1ba | canary | 17 June 2026 |
| 0.1.0-canary.207ab91 | canary | 17 June 2026 |
Changelog
The newest stable releases of @vllnt/convex-experiments, with the notes from its changelog.
0.1.0
Added
- First release of
@vllnt/convex-experiments. - Deterministic, sticky variant assignment:
pickVarianthashes(salt, subjectRef)with FNV-1a onto the cumulative-weight line, so the same subject always lands in the same weighted bucket — sticky before persistence, weight-respecting, and stable across concurrent first-assigncalls. define/setStatuslifecycle (draft → running → stopped); onlyrunningenrolls, and stopping freezes new enrollment while preserving recorded assignments and exposures.assignreturns{ variant: null }(not enrolled) or{ variant, isNew }, persisting the pick on first sight and replaying it afterwards.logExposurededups exposures into one tallied row per subject;resultsreports distinct subjects and total exposures per variant.saltdefaults to the experiment key and seeds the assignment hash.- Scopes namespace experiments per tenant / surface; server-sourced timestamps throughout.
- Fully typed end to end — variant keys, weights, statuses, and refs are concrete types; no
v.any(). definerejects an empty variant set, a non-positive/non-finite weight, or a duplicate variant key withConvexError({ code: "INVALID_VARIANTS" }).- Optional
@vllnt/convex-experiments/reactentry —useVariant(flicker-free, onpeek),useAssignment,useExperimentResults. ThinuseQuerywrappers over the host's re-exported refs;reactis an optional peer dep; render-tested in jsdom at 100%. peek— a read-only, deterministic query that returns a subject's sticky variant without persisting (the SSR / flicker-free first-paint path).listExperiments(scope, status?)— discovery / management surface.forgetSubject— erase one subject's assignment + exposure (GDPR right-to-erasure), decrementing tallies;deleteExperiment— bounded, self-rescheduling cascade delete of an experiment + all data.resultsnow returnsassignedandweightper variant (alongsidesubjects/exposures) so a host can check sample-ratio-mismatch, and reads maintainedvariantTalliesin O(variants) instead of scanning every exposure row.INVALID_VARIANTSerrors now carry areason(empty/non_positive_weight/duplicate_key).
Changed
- Treat Convex
_generatedoutput as CLI-owned, exclude it from formatting, and expose a dedicated codegen script. - Refresh all direct dependencies to their latest compatible releases for canary validation.
- Require
convex@^1.45.0and updateconvex-testto^0.0.56. scopeis folded into the assignment hash (${scope}:${salt}) so the samesubjectRefbuckets independently per scope — fixes cross-tenant assignment correlation.
Fixed
- Reject zero, fractional, non-finite, negative, and oversized experiment-deletion batches to prevent infinite self-scheduling and oversized transactions.
- Definition immutability (
EXPERIMENT_LOCKED). Changingvariantsorsaltafter a subject is assigned now throws instead of silently splitting the population across two randomizations. The earlier "change salt to re-randomize" claim was incorrect for enrolled subjects and is removed from the docs; re-randomize by defining a new experiment key.
- First release of
Licence
Released under the MIT licence. The full text is in the source repository.
[ PACKAGE ]
- Stable
- 0.1.0
- Canary
- 0.1.1-canary.131a7f7
- GitHub stars
- 1 GitHub star
- Licence
- MIT
- Issues
- Open an issue