create-kywi-app 0.10.0 → 0.11.0
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/assets/agent-patterns.md
CHANGED
|
@@ -441,20 +441,22 @@ interchangeable.
|
|
|
441
441
|
page is complete with JavaScript off. This is the default for anything the
|
|
442
442
|
server can know — rule-based audiences (UTM, referrer, the `kywi_audience`
|
|
443
443
|
pin) and A/B experiments. Since 0.6.3 it also renders in the layout editor as
|
|
444
|
-
a badged block with
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
444
|
+
a badged block with a **variant switcher** (internal editor code —
|
|
445
|
+
`activeArms`, the `VariantArm` type, `data-arm-id` — still says "arm"; the
|
|
446
|
+
persisted layout field is `variants`), each variant editable with the
|
|
447
|
+
ordinary section/column/module tools, so server-resolution no longer costs
|
|
448
|
+
the owner their editing surface. Since kywi-cms#119, the owner doesn't need
|
|
449
|
+
an agent to hand-author this shape at all: the section chrome — in the
|
|
450
|
+
admin layout editor and in the in-place front-of-site overlay alike —
|
|
451
|
+
offers **Personalize this section** / **A/B test** actions that wrap an
|
|
452
|
+
ordinary section into a section-level variant container on the spot,
|
|
453
|
+
seeding the default variant from the section's current content and
|
|
454
|
+
opening straight into its config (audience/experiment picker included).
|
|
455
|
+
An agent only needs to reach for `update_layout` when scripting bulk
|
|
456
|
+
changes or building a container the UI can't reach.
|
|
455
457
|
- **Module-level** — the `variantContainer` *module*, placed in a column; its
|
|
456
|
-
|
|
457
|
-
content}]`). Every
|
|
458
|
+
variants are HTML strings (`defaultContent`, `variants: [{audienceId, label,
|
|
459
|
+
content}]`). Every variant ships in the HTML (default visible, the rest
|
|
458
460
|
`display:none`) and the browser runtime reveals the matching one. Use it
|
|
459
461
|
**only for signals the server cannot read at first paint** — in practice, a
|
|
460
462
|
self-ID answer held in `localStorage`.
|
|
@@ -44,16 +44,18 @@ is progressive enhancement; anonymous visitors get the default).
|
|
|
44
44
|
### 4b. Experiment path
|
|
45
45
|
|
|
46
46
|
Admin → Experiments: create the experiment. In the layout, add an A/B
|
|
47
|
-
container with
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
container with a variant per treatment (the editor UI and API both call these
|
|
48
|
+
"variants"; the underlying data model calls each one an "arm" — same thing).
|
|
49
|
+
Assignment is deterministic per visitor (the scaffold's middleware issues a
|
|
50
|
+
persistent `kywi_visitor` cookie), so a visitor sees the same variant on every
|
|
51
|
+
visit — no client runtime needed.
|
|
50
52
|
|
|
51
53
|
### 5. Verify before calling it done
|
|
52
54
|
|
|
53
55
|
- **Preview tokens** (Audiences → Preview Tokens): view the page *as each
|
|
54
56
|
audience* and confirm the right variant serves.
|
|
55
57
|
- Experiments: two fresh browser profiles should get (possibly) different
|
|
56
|
-
|
|
58
|
+
variants, and each profile must get the **same** variant on reload.
|
|
57
59
|
- Confirm exposures are being recorded in the Experiments admin.
|
|
58
60
|
- Load the page as a plain anonymous visitor: the default must be complete.
|
|
59
61
|
|
package/package.json
CHANGED