splithub 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 +46 -2
- package/dist/index.js +2192 -0
- package/dist/index.js.map +1 -0
- package/package.json +32 -3
package/README.md
CHANGED
|
@@ -1,3 +1,47 @@
|
|
|
1
|
-
#
|
|
1
|
+
# splithub
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A/B testing for your app in one command. Run it without arguments and it walks you through; add flags and `--json` when a coding agent runs it.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npx splithub # menu: set up, connect, create, results, start/pause, push — step by step
|
|
7
|
+
npx splithub init # config, framework files (Next.js middleware + ingest route), agent skills
|
|
8
|
+
npx splithub init --mode self --db postgres # events in your Postgres: writes splithub/store.ts (also mysql | custom | sqlite)
|
|
9
|
+
npx splithub create # wizard; or flags:
|
|
10
|
+
npx splithub create --kind value --id hero-title --variants control,direct \
|
|
11
|
+
--value "control=Old headline" --value "direct=New headline" --goal signup --yes --json
|
|
12
|
+
npx splithub start hero-title # also: pause, finish
|
|
13
|
+
npx splithub status # all experiments, verdict headline
|
|
14
|
+
npx splithub results hero-title # lift, P(beat), p-value, CI, SRM, recommendation
|
|
15
|
+
npx splithub doctor # checks config, provider, middleware, route, code references, endpoint
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Where results come from
|
|
19
|
+
|
|
20
|
+
| Config `storage.mode` | `status` / `results` read from | Auth |
|
|
21
|
+
|---|---|---|
|
|
22
|
+
| `self` | your app's endpoint on the local dev server (`localhost:3000` for Next.js, `5173` for Vite) or `--url` / `SPLITHUB_URL` | `--token` / `SPLITHUB_ADMIN_TOKEN` when the handler has `adminToken` |
|
|
23
|
+
| `cloud` | `https://go.splithub.io/v1` (or `--api` / `SPLITHUB_API`) | project API key: `--token sk_...`, `SPLITHUB_API_KEY`, or the key saved by `splithub login` |
|
|
24
|
+
|
|
25
|
+
## SplitHub Cloud
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npx splithub login # prints a code + URL; approve in the dashboard, pick the project
|
|
29
|
+
npx splithub push # uploads splithub.config.ts; first push returns the public key
|
|
30
|
+
# and writes it into storage.key
|
|
31
|
+
npx splithub status
|
|
32
|
+
npx splithub pull # show what the cloud has
|
|
33
|
+
npx splithub whoami # which project this directory talks to
|
|
34
|
+
npx splithub logout
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
`login` never asks you to paste a secret: the dashboard mints a project API key
|
|
38
|
+
for this terminal and the CLI stores it per directory in
|
|
39
|
+
`~/.config/splithub/credentials.json` (`%APPDATA%\splithub` on Windows).
|
|
40
|
+
CI and agents without a browser can still use `SPLITHUB_API_KEY=sk_...`
|
|
41
|
+
(dashboard → project → Settings → API keys); env and `--token` win over the
|
|
42
|
+
saved key.
|
|
43
|
+
|
|
44
|
+
The public key (`pk_...`) is safe in the browser: it only allows sending
|
|
45
|
+
events. The API key (`sk_...`) reads results and pushes config; keep it out of git.
|
|
46
|
+
|
|
47
|
+
Planned: `watch` (live verdicts).
|