Initial Commit

This commit is contained in:
2026-05-27 23:47:53 +01:00
parent fbc70f96e6
commit 9b28db724f
18103 changed files with 1600554 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
/** Default sample rate — include 100% of eligible users in the experiment. */
export const DEFAULT_SAMPLE_RATE = 1.0;
/** Default FNV-1a seed offset XOR'd into the hash basis when no custom seed is provided. */
export const DEFAULT_HASH_SEED = 0;
/** FNV-1a 32-bit offset basis. */
export const FNV_OFFSET_BASIS = 2166136261;
/** FNV-1a 32-bit prime. */
export const FNV_PRIME = 16777619;
/** Maximum allowed total weight for variants (normalisation denominator). */
export const MAX_VARIANT_WEIGHT = Number.MAX_SAFE_INTEGER;
/** Event bus topic emitted when a user is assigned to an experiment variant. */
export const EVENT_AB_ASSIGNED = "ab:assigned";
/** Event bus topic emitted when a conversion event is tracked. */
export const EVENT_AB_CONVERSION = "ab:conversion";
/** OTel meter name for all A/B testing instruments. */
export const OTEL_METER_NAME = "@suaveplan/ab-testing";
/** OTel span name for the assign operation. */
export const OTEL_SPAN_ASSIGN = "ab.assign";
/** OTel counter name tracking total variant assignments. */
export const OTEL_COUNTER_ASSIGNMENTS = "ab.assignments_total";
/** OTel counter name tracking total conversion events. */
export const OTEL_COUNTER_CONVERSIONS = "ab.conversions_total";