@splithub/core 0.0.0-stage → 0.1.1

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.
package/README.md CHANGED
@@ -1,3 +1,22 @@
1
- # Temporary Holding Version
1
+ # @splithub/core
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Framework-agnostic core of SplitHub: `defineConfig`, deterministic assignment
4
+ (MurmurHash3), visitor id, event queue and a tiny client.
5
+
6
+ ```ts
7
+ import { defineConfig, createClient } from '@splithub/core';
8
+
9
+ const config = defineConfig({ project: 'app', storage: { mode: 'self', endpoint: '/api/splithub' }, experiments: { ... } });
10
+ const client = createClient(config); // browser: reads/writes the sh_vid cookie
11
+ client.variant('hero-cta'); // 'control' | 'bold', records an exposure
12
+ client.value<string>('hero-title');
13
+ client.track('signup', { revenue: 49 });
14
+ ```
15
+
16
+ In cloud mode the client also applies **remote overrides** (pause, traffic,
17
+ weights, `value` payloads changed without a deploy): the cached copy from
18
+ localStorage is applied synchronously on page load, a fresh copy is fetched in
19
+ the background for the next load. Assignments never change mid-page.
20
+
21
+ Use `@splithub/react` in React apps. Use this package directly for vanilla JS,
22
+ other frameworks, server-side assignment, or traffic simulation.