@picked/client 0.0.1-dev.1789541668638 → 0.0.1-next.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.
Files changed (443) hide show
  1. package/README.md +8 -0
  2. package/dist/cjs/index.js +1 -4
  3. package/dist/cjs/plugins/create-experience/index.js +1 -1
  4. package/dist/cjs/plugins/experience-browserstorage-plugin/index.js +1 -0
  5. package/dist/cjs/plugins/history-browserstorage-plugin/index.js +1 -0
  6. package/dist/cjs/plugins/responses-browserstorage-plugin/index.js +1 -0
  7. package/dist/cjs/plugins/responses-indexeddb-plugin/index.js +1 -0
  8. package/dist/cjs/plugins/shopify/index.js +1 -0
  9. package/dist/cjs/plugins/single-page-app/index.js +1 -1
  10. package/dist/cjs/plugins/window-object/index.js +1 -1
  11. package/dist/cjs/server/index.js +1 -1
  12. package/dist/esm/index.js +732 -1814
  13. package/dist/esm/plugins/create-experience/index.js +398 -490
  14. package/dist/esm/plugins/experience-browserstorage-plugin/index.js +38 -0
  15. package/dist/esm/plugins/history-browserstorage-plugin/index.js +26 -0
  16. package/dist/esm/plugins/responses-browserstorage-plugin/index.js +36 -0
  17. package/dist/esm/plugins/responses-indexeddb-plugin/index.js +101 -0
  18. package/dist/esm/plugins/shopify/index.js +59 -0
  19. package/dist/esm/plugins/single-page-app/index.js +35 -31
  20. package/dist/esm/plugins/window-object/index.js +9 -9
  21. package/dist/esm/server/index.js +89 -141
  22. package/dist/experience-instance-6ZKZS7dF.cjs +1 -0
  23. package/dist/experience-instance-BA0EXYg5.js +712 -0
  24. package/dist/id-BKIWbSTy.cjs +1 -0
  25. package/dist/id-BW-g3y32.js +6 -0
  26. package/dist/logger-BsmHUUw1.cjs +1 -0
  27. package/dist/logger-C9a75KZn.js +5 -0
  28. package/dist/object-BbFTsGh3.cjs +1 -0
  29. package/dist/object-JwZ58NOH.js +28 -0
  30. package/dist/storage-BPJwmlva.cjs +1 -0
  31. package/dist/storage-D87xFySf.js +85 -0
  32. package/dist/supports-BvrzQAVk.js +79 -0
  33. package/dist/supports-C0y3-V5V.cjs +1 -0
  34. package/dist/types/client.d.ts +23 -119
  35. package/dist/types/client.d.ts.map +1 -1
  36. package/dist/types/entities/component/component.d.ts +6 -45
  37. package/dist/types/entities/component/component.d.ts.map +1 -1
  38. package/dist/types/entities/experience/experience.d.ts +99 -160
  39. package/dist/types/entities/experience/experience.d.ts.map +1 -1
  40. package/dist/types/entities/experience-instance/experience-instance.d.ts +113 -83
  41. package/dist/types/entities/experience-instance/experience-instance.d.ts.map +1 -1
  42. package/dist/types/entities/feature/feature.d.ts +8 -118
  43. package/dist/types/entities/feature/feature.d.ts.map +1 -1
  44. package/dist/types/entities/field/field.d.ts +64 -96
  45. package/dist/types/entities/field/field.d.ts.map +1 -1
  46. package/dist/types/entities/framework/framework.d.ts +7 -32
  47. package/dist/types/entities/framework/framework.d.ts.map +1 -1
  48. package/dist/types/entities/history/history.d.ts +6 -6
  49. package/dist/types/entities/history/history.d.ts.map +1 -1
  50. package/dist/types/entities/plugin/plugin.d.ts +2 -41
  51. package/dist/types/entities/plugin/plugin.d.ts.map +1 -1
  52. package/dist/types/entities/predicate/predicate.d.ts +7 -30
  53. package/dist/types/entities/predicate/predicate.d.ts.map +1 -1
  54. package/dist/types/entities/project/project.d.ts +9 -0
  55. package/dist/types/entities/project/project.d.ts.map +1 -0
  56. package/dist/types/entities/response/response.d.ts +21 -57
  57. package/dist/types/entities/response/response.d.ts.map +1 -1
  58. package/dist/types/exports.d.ts +4 -22
  59. package/dist/types/exports.d.ts.map +1 -1
  60. package/dist/types/index.d.ts +3 -12
  61. package/dist/types/index.d.ts.map +1 -1
  62. package/dist/types/logic-engine.d.ts +11 -13
  63. package/dist/types/logic-engine.d.ts.map +1 -1
  64. package/dist/types/picked.d.ts +184 -381
  65. package/dist/types/picked.d.ts.map +1 -1
  66. package/dist/types/ping.d.ts +10 -0
  67. package/dist/types/ping.d.ts.map +1 -0
  68. package/dist/types/plugins/create-experience/create-experience.d.ts +44 -119
  69. package/dist/types/plugins/create-experience/create-experience.d.ts.map +1 -1
  70. package/dist/types/plugins/create-experience/index.d.ts +2 -2
  71. package/dist/types/plugins/create-experience/index.d.ts.map +1 -1
  72. package/dist/types/plugins/create-experience/plugin.d.ts +2 -3
  73. package/dist/types/plugins/create-experience/plugin.d.ts.map +1 -1
  74. package/dist/types/plugins/create-experience/serialization.d.ts.map +1 -1
  75. package/dist/types/plugins/experience-browserstorage-plugin/index.d.ts.map +1 -0
  76. package/dist/types/plugins/experience-browserstorage-plugin/plugin.d.ts +6 -0
  77. package/dist/types/plugins/experience-browserstorage-plugin/plugin.d.ts.map +1 -0
  78. package/dist/types/plugins/history-browserstorage-plugin/index.d.ts.map +1 -0
  79. package/dist/types/plugins/{history-browser-storage → history-browserstorage-plugin}/plugin.d.ts +1 -2
  80. package/dist/types/plugins/history-browserstorage-plugin/plugin.d.ts.map +1 -0
  81. package/dist/types/plugins/responses-browserstorage-plugin/index.d.ts.map +1 -0
  82. package/dist/types/plugins/responses-browserstorage-plugin/plugin.d.ts +6 -0
  83. package/dist/types/plugins/responses-browserstorage-plugin/plugin.d.ts.map +1 -0
  84. package/dist/types/plugins/responses-indexeddb-plugin/index.d.ts.map +1 -0
  85. package/dist/types/plugins/responses-indexeddb-plugin/plugin.d.ts +3 -0
  86. package/dist/types/plugins/responses-indexeddb-plugin/plugin.d.ts.map +1 -0
  87. package/dist/types/plugins/shopify/index.d.ts +2 -0
  88. package/dist/types/plugins/shopify/index.d.ts.map +1 -0
  89. package/dist/types/plugins/shopify/plugin.d.ts +3 -0
  90. package/dist/types/plugins/shopify/plugin.d.ts.map +1 -0
  91. package/dist/types/plugins/shopify/shopify.d.ts +28 -0
  92. package/dist/types/plugins/shopify/shopify.d.ts.map +1 -0
  93. package/dist/types/plugins/single-page-app/plugin.d.ts +2 -2
  94. package/dist/types/plugins/single-page-app/plugin.d.ts.map +1 -1
  95. package/dist/types/plugins/window-object/plugin.d.ts +2 -2
  96. package/dist/types/server/index.d.ts +3 -18
  97. package/dist/types/server/index.d.ts.map +1 -1
  98. package/dist/types/utils/dom.d.ts +6 -4
  99. package/dist/types/utils/dom.d.ts.map +1 -1
  100. package/dist/types/utils/events.d.ts +38 -83
  101. package/dist/types/utils/events.d.ts.map +1 -1
  102. package/dist/types/utils/global-obj.d.ts +2 -1
  103. package/dist/types/utils/global-obj.d.ts.map +1 -1
  104. package/dist/types/utils/id.d.ts.map +1 -1
  105. package/dist/types/utils/indexed-db.d.ts +1 -2
  106. package/dist/types/utils/indexed-db.d.ts.map +1 -1
  107. package/dist/types/utils/logger.d.ts +1 -2
  108. package/dist/types/utils/logger.d.ts.map +1 -1
  109. package/dist/types/utils/node-tree/get-next-node-from-conditional.d.ts +3 -0
  110. package/dist/types/utils/node-tree/get-next-node-from-conditional.d.ts.map +1 -0
  111. package/dist/types/utils/node-tree/get-next-node.d.ts +1 -1
  112. package/dist/types/utils/node-tree/get-next-node.d.ts.map +1 -1
  113. package/dist/types/utils/node-tree/get-origin-node.d.ts +1 -1
  114. package/dist/types/utils/node-tree/get-origin-node.d.ts.map +1 -1
  115. package/dist/types/utils/node-tree/min-max-steps-to-leaf.d.ts +7 -17
  116. package/dist/types/utils/node-tree/min-max-steps-to-leaf.d.ts.map +1 -1
  117. package/dist/types/utils/node-tree/min-max-steps-to-origin.d.ts +8 -19
  118. package/dist/types/utils/node-tree/min-max-steps-to-origin.d.ts.map +1 -1
  119. package/dist/types/utils/node-tree/next-reachable-step-nodes.d.ts +7 -31
  120. package/dist/types/utils/node-tree/next-reachable-step-nodes.d.ts.map +1 -1
  121. package/dist/types/utils/nodes.d.ts +2 -3
  122. package/dist/types/utils/nodes.d.ts.map +1 -1
  123. package/dist/types/utils/object.d.ts +8 -0
  124. package/dist/types/utils/object.d.ts.map +1 -1
  125. package/dist/types/utils/rules-logic.d.ts +3 -33
  126. package/dist/types/utils/rules-logic.d.ts.map +1 -1
  127. package/dist/types/utils/search-params.d.ts.map +1 -1
  128. package/dist/types/utils/state-snaphot.d.ts +16 -0
  129. package/dist/types/utils/state-snaphot.d.ts.map +1 -0
  130. package/dist/types/utils/storage.d.ts +11 -374
  131. package/dist/types/utils/storage.d.ts.map +1 -1
  132. package/dist/types/utils/supports.d.ts +0 -87
  133. package/dist/types/utils/supports.d.ts.map +1 -1
  134. package/package.json +49 -182
  135. package/dist/.tsbuildinfo +0 -1
  136. package/dist/api-C7q_7vxn.js +0 -22
  137. package/dist/api-Ctvh1qkk.cjs +0 -1
  138. package/dist/cjs/form/index.js +0 -1
  139. package/dist/cjs/plugins/dom-observer/index.js +0 -1
  140. package/dist/cjs/plugins/dynamic-experiences/index.js +0 -1
  141. package/dist/cjs/plugins/experience-browser-storage/index.js +0 -1
  142. package/dist/cjs/plugins/history-browser-storage/index.js +0 -1
  143. package/dist/cjs/plugins/responses-browser-storage/index.js +0 -1
  144. package/dist/cjs/plugins/responses-indexeddb/index.js +0 -1
  145. package/dist/cjs/plugins/telemetry/index.js +0 -1
  146. package/dist/cjs/plugins/web-components/index.js +0 -1
  147. package/dist/cjs/preview/index.js +0 -1
  148. package/dist/docs/_root.css +0 -101
  149. package/dist/docs/explanation/conditions-and-the-logic-engine.md +0 -94
  150. package/dist/docs/explanation/content-references.md +0 -99
  151. package/dist/docs/explanation/feature-flag-allocation.md +0 -218
  152. package/dist/docs/explanation/how-picked-works.md +0 -124
  153. package/dist/docs/explanation/how-pickedql-works.md +0 -76
  154. package/dist/docs/explanation/pages-and-flows.md +0 -64
  155. package/dist/docs/explanation/the-content-model.md +0 -87
  156. package/dist/docs/explanation/the-two-apis.md +0 -68
  157. package/dist/docs/explanation/why-server-side-rendering.md +0 -76
  158. package/dist/docs/explanation/workspaces-and-versions.md +0 -71
  159. package/dist/docs/how-to/add-a-step-field-or-action.md +0 -43
  160. package/dist/docs/how-to/analytics/index.md +0 -316
  161. package/dist/docs/how-to/archive-or-delete-a-workspace.md +0 -46
  162. package/dist/docs/how-to/authenticate-the-cli.md +0 -97
  163. package/dist/docs/how-to/authenticate-with-a-magic-link.md +0 -40
  164. package/dist/docs/how-to/authenticate-with-a-password.md +0 -51
  165. package/dist/docs/how-to/authenticate-with-an-api-key.md +0 -51
  166. package/dist/docs/how-to/authenticate-with-oauth.md +0 -40
  167. package/dist/docs/how-to/build-a-flow.md +0 -83
  168. package/dist/docs/how-to/connect-the-mcp-server.md +0 -38
  169. package/dist/docs/how-to/create-a-content-entry.md +0 -48
  170. package/dist/docs/how-to/create-a-project.md +0 -29
  171. package/dist/docs/how-to/create-an-experience.md +0 -42
  172. package/dist/docs/how-to/create-and-revoke-an-api-key.md +0 -42
  173. package/dist/docs/how-to/debug-with-the-chrome-extension.md +0 -57
  174. package/dist/docs/how-to/define-a-page-layout.md +0 -46
  175. package/dist/docs/how-to/fill-and-publish-a-page.md +0 -66
  176. package/dist/docs/how-to/install-the-gtm-template.md +0 -84
  177. package/dist/docs/how-to/install-the-sdk.md +0 -93
  178. package/dist/docs/how-to/install-the-vite-plugin.md +0 -69
  179. package/dist/docs/how-to/invite-and-remove-members.md +0 -35
  180. package/dist/docs/how-to/point-one-entry-at-another.md +0 -61
  181. package/dist/docs/how-to/preview-a-workspace.md +0 -28
  182. package/dist/docs/how-to/publish-a-workspace.md +0 -30
  183. package/dist/docs/how-to/read-a-feature-flag.md +0 -113
  184. package/dist/docs/how-to/read-a-referenced-entry.md +0 -109
  185. package/dist/docs/how-to/register-a-component.md +0 -55
  186. package/dist/docs/how-to/register-an-action-handler.md +0 -67
  187. package/dist/docs/how-to/render-a-step-form.md +0 -131
  188. package/dist/docs/how-to/render-an-unpublished-preview.md +0 -41
  189. package/dist/docs/how-to/reuse-a-section.md +0 -53
  190. package/dist/docs/how-to/reuse-a-step-field-or-action.md +0 -28
  191. package/dist/docs/how-to/roll-back-a-published-version.md +0 -26
  192. package/dist/docs/how-to/run-an-ab-test.md +0 -49
  193. package/dist/docs/how-to/run-code-on-a-form-submission.md +0 -125
  194. package/dist/docs/how-to/server-render-a-page.md +0 -81
  195. package/dist/docs/how-to/set-a-content-security-policy.md +0 -32
  196. package/dist/docs/how-to/set-up-mfa.md +0 -69
  197. package/dist/docs/how-to/switch-workspaces.md +0 -122
  198. package/dist/docs/how-to/upload-and-use-an-asset.mdx +0 -73
  199. package/dist/docs/how-to/validate-a-field.md +0 -52
  200. package/dist/docs/how-to/write-a-condition.md +0 -45
  201. package/dist/docs/how-to/write-a-predicate.md +0 -60
  202. package/dist/docs/index.md +0 -59
  203. package/dist/docs/reference/dashboard/actions.mdx +0 -53
  204. package/dist/docs/reference/dashboard/api-keys.mdx +0 -38
  205. package/dist/docs/reference/dashboard/conditions.mdx +0 -42
  206. package/dist/docs/reference/dashboard/content/asset-library.mdx +0 -63
  207. package/dist/docs/reference/dashboard/content/blocks.mdx +0 -57
  208. package/dist/docs/reference/dashboard/content/content-entries.mdx +0 -95
  209. package/dist/docs/reference/dashboard/content/models.mdx +0 -108
  210. package/dist/docs/reference/dashboard/content/pages.mdx +0 -61
  211. package/dist/docs/reference/dashboard/experiences.mdx +0 -51
  212. package/dist/docs/reference/dashboard/features.mdx +0 -154
  213. package/dist/docs/reference/dashboard/fields.mdx +0 -106
  214. package/dist/docs/reference/dashboard/flow-builder/canvas.mdx +0 -58
  215. package/dist/docs/reference/dashboard/flow-builder/condition-builder.md +0 -57
  216. package/dist/docs/reference/dashboard/flow-builder/keyboard-shortcuts.md +0 -72
  217. package/dist/docs/reference/dashboard/flow-builder/nodes.md +0 -63
  218. package/dist/docs/reference/dashboard/projects.mdx +0 -44
  219. package/dist/docs/reference/dashboard/reports.mdx +0 -43
  220. package/dist/docs/reference/dashboard/steps.mdx +0 -37
  221. package/dist/docs/reference/dashboard/team-management.md +0 -29
  222. package/dist/docs/reference/dashboard/workspace-versioning.mdx +0 -30
  223. package/dist/docs/reference/dashboard/workspaces.mdx +0 -76
  224. package/dist/docs/reference/delivery-api/experience-content.md +0 -152
  225. package/dist/docs/reference/delivery-api/index.md +0 -45
  226. package/dist/docs/reference/delivery-api/preview-caching-crawling.md +0 -79
  227. package/dist/docs/reference/delivery-api/project-config.md +0 -65
  228. package/dist/docs/reference/delivery-api/workspace-schema.md +0 -85
  229. package/dist/docs/reference/glossary.md +0 -181
  230. package/dist/docs/reference/management-api/authentication.md +0 -74
  231. package/dist/docs/reference/management-api/authorization-and-scopes.md +0 -285
  232. package/dist/docs/reference/management-api/error-handling.md +0 -233
  233. package/dist/docs/reference/management-api/pagination.md +0 -192
  234. package/dist/docs/reference/pickedql/data-sources.md +0 -174
  235. package/dist/docs/reference/pickedql/dimensions.md +0 -103
  236. package/dist/docs/reference/pickedql/filtering.md +0 -64
  237. package/dist/docs/reference/pickedql/index.md +0 -18
  238. package/dist/docs/reference/pickedql/schema.md +0 -172
  239. package/dist/docs/reference/pickedql/virtual-functions.md +0 -248
  240. package/dist/docs/reference/sdk/actions.md +0 -30
  241. package/dist/docs/reference/sdk/analytics-events.md +0 -445
  242. package/dist/docs/reference/sdk/conditions.md +0 -147
  243. package/dist/docs/reference/sdk/content-security-policy.md +0 -21
  244. package/dist/docs/reference/sdk/content.md +0 -213
  245. package/dist/docs/reference/sdk/experiences.md +0 -51
  246. package/dist/docs/reference/sdk/features.md +0 -256
  247. package/dist/docs/reference/sdk/fields.md +0 -255
  248. package/dist/docs/reference/sdk/index.md +0 -68
  249. package/dist/docs/reference/sdk/plugins/create-experience.md +0 -123
  250. package/dist/docs/reference/sdk/plugins/dynamic-experiences.md +0 -74
  251. package/dist/docs/reference/sdk/plugins/index.md +0 -29
  252. package/dist/docs/reference/sdk/plugins/window-object.md +0 -25
  253. package/dist/docs/reference/sdk/predicates.md +0 -43
  254. package/dist/docs/reference/sdk/ssr/index.md +0 -33
  255. package/dist/docs/reference/sdk/ssr/rendering-and-hydration.md +0 -103
  256. package/dist/docs/reference/sdk/ssr/serialize.md +0 -80
  257. package/dist/docs/reference/sdk/ssr/slots-and-placements.md +0 -59
  258. package/dist/docs/reference/sdk/steps.md +0 -86
  259. package/dist/docs/reference/sdk/type-generation.md +0 -196
  260. package/dist/docs/reference/tools/chrome-extension.md +0 -16
  261. package/dist/docs/reference/tools/cli.md +0 -146
  262. package/dist/docs/reference/tools/image-optimisation-service.md +0 -104
  263. package/dist/docs/reference/tools/mcp.md +0 -90
  264. package/dist/docs/reference/tools/vite-plugin.md +0 -163
  265. package/dist/docs/tutorials/first-api-call.md +0 -228
  266. package/dist/docs/tutorials/first-experience-in-the-dashboard.mdx +0 -143
  267. package/dist/docs/tutorials/first-experience.mdx +0 -254
  268. package/dist/docs/tutorials/first-server-rendered-page.mdx +0 -186
  269. package/dist/dom-BqcToNL0.js +0 -82
  270. package/dist/dom-DlLH3FxV.cjs +0 -1
  271. package/dist/emit-D-tLiWL1.cjs +0 -1
  272. package/dist/emit-Ds2EG7CB.js +0 -14
  273. package/dist/esm/form/index.js +0 -565
  274. package/dist/esm/plugins/dom-observer/index.js +0 -87
  275. package/dist/esm/plugins/dynamic-experiences/index.js +0 -5
  276. package/dist/esm/plugins/experience-browser-storage/index.js +0 -38
  277. package/dist/esm/plugins/history-browser-storage/index.js +0 -26
  278. package/dist/esm/plugins/responses-browser-storage/index.js +0 -71
  279. package/dist/esm/plugins/responses-indexeddb/index.js +0 -89
  280. package/dist/esm/plugins/telemetry/index.js +0 -100
  281. package/dist/esm/plugins/web-components/index.js +0 -19
  282. package/dist/esm/preview/index.js +0 -2
  283. package/dist/experience-instance-B9S6Yf0N.js +0 -711
  284. package/dist/experience-instance-D8rOg6We.cjs +0 -1
  285. package/dist/id-Bo4RBeOs.js +0 -4
  286. package/dist/id-Js-62re-.cjs +0 -1
  287. package/dist/inert-script-report-B_bMPRzp.js +0 -18
  288. package/dist/inert-script-report-ijRHPtcY.cjs +0 -1
  289. package/dist/logger-CSTvAyyB.cjs +0 -1
  290. package/dist/logger-DMN6TxJJ.js +0 -4
  291. package/dist/object-BUDGxEqy.js +0 -25
  292. package/dist/object-CIkt7Fkr.cjs +0 -1
  293. package/dist/plugin-ChafFq6S.js +0 -194
  294. package/dist/plugin-Dn25Gffy.cjs +0 -1
  295. package/dist/preview-channel-CSr96XAo.js +0 -98
  296. package/dist/preview-channel-Cx0e6fye.cjs +0 -1
  297. package/dist/protocol-Bb_vpLKE.cjs +0 -1
  298. package/dist/protocol-C5KkkiZc.js +0 -84
  299. package/dist/provider-B8wvmeC8.js +0 -98
  300. package/dist/provider-BBLlQOjV.cjs +0 -1
  301. package/dist/registry-C1t8l3t9.cjs +0 -1
  302. package/dist/registry-CXZv0uLg.js +0 -18
  303. package/dist/rules-logic-CGZIYgAI.cjs +0 -1
  304. package/dist/rules-logic-HesIUCu6.js +0 -13
  305. package/dist/storage-1MW3-_As.js +0 -103
  306. package/dist/storage-DUw9UJ2h.cjs +0 -1
  307. package/dist/supports-CO9bJGNl.js +0 -92
  308. package/dist/supports-DBzjGaWD.cjs +0 -1
  309. package/dist/types/data-source/api.d.ts +0 -60
  310. package/dist/types/data-source/api.d.ts.map +0 -1
  311. package/dist/types/data-source/provider.d.ts +0 -103
  312. package/dist/types/data-source/provider.d.ts.map +0 -1
  313. package/dist/types/data-source/registry.d.ts +0 -26
  314. package/dist/types/data-source/registry.d.ts.map +0 -1
  315. package/dist/types/data-source/request-observer.d.ts +0 -62
  316. package/dist/types/data-source/request-observer.d.ts.map +0 -1
  317. package/dist/types/data-source/virtual-data.d.ts +0 -19
  318. package/dist/types/data-source/virtual-data.d.ts.map +0 -1
  319. package/dist/types/entities/action/action.d.ts +0 -85
  320. package/dist/types/entities/action/action.d.ts.map +0 -1
  321. package/dist/types/entities/component/lazyComponent.d.ts +0 -11
  322. package/dist/types/entities/component/lazyComponent.d.ts.map +0 -1
  323. package/dist/types/entities/condition/condition.d.ts +0 -29
  324. package/dist/types/entities/condition/condition.d.ts.map +0 -1
  325. package/dist/types/entities/content/content.d.ts +0 -53
  326. package/dist/types/entities/content/content.d.ts.map +0 -1
  327. package/dist/types/entities/content/reference.d.ts +0 -101
  328. package/dist/types/entities/content/reference.d.ts.map +0 -1
  329. package/dist/types/entities/field/policies.d.ts +0 -35
  330. package/dist/types/entities/field/policies.d.ts.map +0 -1
  331. package/dist/types/entities/response/response-validation.d.ts +0 -75
  332. package/dist/types/entities/response/response-validation.d.ts.map +0 -1
  333. package/dist/types/entities/session/session.d.ts +0 -46
  334. package/dist/types/entities/session/session.d.ts.map +0 -1
  335. package/dist/types/entities/step/step.d.ts +0 -56
  336. package/dist/types/entities/step/step.d.ts.map +0 -1
  337. package/dist/types/form/build-responses.d.ts +0 -18
  338. package/dist/types/form/build-responses.d.ts.map +0 -1
  339. package/dist/types/form/create-field-evaluator.d.ts +0 -28
  340. package/dist/types/form/create-field-evaluator.d.ts.map +0 -1
  341. package/dist/types/form/create-field-validation.d.ts +0 -60
  342. package/dist/types/form/create-field-validation.d.ts.map +0 -1
  343. package/dist/types/form/create-form.d.ts +0 -153
  344. package/dist/types/form/create-form.d.ts.map +0 -1
  345. package/dist/types/form/create-submit-pipeline.d.ts +0 -116
  346. package/dist/types/form/create-submit-pipeline.d.ts.map +0 -1
  347. package/dist/types/form/get-step-fields.d.ts +0 -19
  348. package/dist/types/form/get-step-fields.d.ts.map +0 -1
  349. package/dist/types/form/index.d.ts +0 -11
  350. package/dist/types/form/index.d.ts.map +0 -1
  351. package/dist/types/lifecycle/condition-selection.d.ts +0 -146
  352. package/dist/types/lifecycle/condition-selection.d.ts.map +0 -1
  353. package/dist/types/lifecycle/lifecycle.d.ts +0 -48
  354. package/dist/types/lifecycle/lifecycle.d.ts.map +0 -1
  355. package/dist/types/lifecycle/rules-logic.d.ts +0 -25
  356. package/dist/types/lifecycle/rules-logic.d.ts.map +0 -1
  357. package/dist/types/lifecycle/state-snapshot.d.ts +0 -38
  358. package/dist/types/lifecycle/state-snapshot.d.ts.map +0 -1
  359. package/dist/types/plugins/dom-observer/index.d.ts +0 -3
  360. package/dist/types/plugins/dom-observer/index.d.ts.map +0 -1
  361. package/dist/types/plugins/dom-observer/plugin.d.ts +0 -50
  362. package/dist/types/plugins/dom-observer/plugin.d.ts.map +0 -1
  363. package/dist/types/plugins/dynamic-experiences/hash.d.ts +0 -105
  364. package/dist/types/plugins/dynamic-experiences/hash.d.ts.map +0 -1
  365. package/dist/types/plugins/dynamic-experiences/index.d.ts +0 -7
  366. package/dist/types/plugins/dynamic-experiences/index.d.ts.map +0 -1
  367. package/dist/types/plugins/dynamic-experiences/plugin.d.ts +0 -49
  368. package/dist/types/plugins/dynamic-experiences/plugin.d.ts.map +0 -1
  369. package/dist/types/plugins/dynamic-experiences/types.d.ts +0 -45
  370. package/dist/types/plugins/dynamic-experiences/types.d.ts.map +0 -1
  371. package/dist/types/plugins/experience-browser-storage/index.d.ts.map +0 -1
  372. package/dist/types/plugins/experience-browser-storage/plugin.d.ts +0 -7
  373. package/dist/types/plugins/experience-browser-storage/plugin.d.ts.map +0 -1
  374. package/dist/types/plugins/history-browser-storage/index.d.ts.map +0 -1
  375. package/dist/types/plugins/history-browser-storage/plugin.d.ts.map +0 -1
  376. package/dist/types/plugins/responses-browser-storage/index.d.ts.map +0 -1
  377. package/dist/types/plugins/responses-browser-storage/plugin.d.ts +0 -18
  378. package/dist/types/plugins/responses-browser-storage/plugin.d.ts.map +0 -1
  379. package/dist/types/plugins/responses-indexeddb/index.d.ts.map +0 -1
  380. package/dist/types/plugins/responses-indexeddb/plugin.d.ts +0 -3
  381. package/dist/types/plugins/responses-indexeddb/plugin.d.ts.map +0 -1
  382. package/dist/types/plugins/telemetry/emit.d.ts +0 -18
  383. package/dist/types/plugins/telemetry/emit.d.ts.map +0 -1
  384. package/dist/types/plugins/telemetry/index.d.ts +0 -4
  385. package/dist/types/plugins/telemetry/index.d.ts.map +0 -1
  386. package/dist/types/plugins/telemetry/plugin-summary.d.ts +0 -10
  387. package/dist/types/plugins/telemetry/plugin-summary.d.ts.map +0 -1
  388. package/dist/types/plugins/telemetry/plugin.d.ts +0 -45
  389. package/dist/types/plugins/telemetry/plugin.d.ts.map +0 -1
  390. package/dist/types/plugins/web-components/index.d.ts +0 -2
  391. package/dist/types/plugins/web-components/index.d.ts.map +0 -1
  392. package/dist/types/plugins/web-components/plugin.d.ts +0 -4
  393. package/dist/types/plugins/web-components/plugin.d.ts.map +0 -1
  394. package/dist/types/preview/index.d.ts +0 -18
  395. package/dist/types/preview/index.d.ts.map +0 -1
  396. package/dist/types/preview-bridge/index.d.ts +0 -14
  397. package/dist/types/preview-bridge/index.d.ts.map +0 -1
  398. package/dist/types/preview-channel.d.ts +0 -16
  399. package/dist/types/preview-channel.d.ts.map +0 -1
  400. package/dist/types/preview-receiver/apply-ops.d.ts +0 -32
  401. package/dist/types/preview-receiver/apply-ops.d.ts.map +0 -1
  402. package/dist/types/preview-receiver/index.d.ts +0 -32
  403. package/dist/types/preview-receiver/index.d.ts.map +0 -1
  404. package/dist/types/preview-receiver/protocol.d.ts +0 -69
  405. package/dist/types/preview-receiver/protocol.d.ts.map +0 -1
  406. package/dist/types/schema-registry.d.ts +0 -206
  407. package/dist/types/schema-registry.d.ts.map +0 -1
  408. package/dist/types/server/serialize.d.ts +0 -87
  409. package/dist/types/server/serialize.d.ts.map +0 -1
  410. package/dist/types/typed-content.d.ts +0 -17
  411. package/dist/types/typed-content.d.ts.map +0 -1
  412. package/dist/types/utils/client-telemetry.d.ts +0 -25
  413. package/dist/types/utils/client-telemetry.d.ts.map +0 -1
  414. package/dist/types/utils/content-path.d.ts +0 -37
  415. package/dist/types/utils/content-path.d.ts.map +0 -1
  416. package/dist/types/utils/html-asset-value.d.ts +0 -20
  417. package/dist/types/utils/html-asset-value.d.ts.map +0 -1
  418. package/dist/types/utils/inert-script-report.d.ts +0 -40
  419. package/dist/types/utils/inert-script-report.d.ts.map +0 -1
  420. package/dist/types/utils/node-tree/get-next-node-from-action.d.ts +0 -25
  421. package/dist/types/utils/node-tree/get-next-node-from-action.d.ts.map +0 -1
  422. package/dist/types/utils/node-tree/get-next-node-from-condition.d.ts +0 -17
  423. package/dist/types/utils/node-tree/get-next-node-from-condition.d.ts.map +0 -1
  424. package/dist/types/utils/node-tree/node-adjacency.d.ts +0 -50
  425. package/dist/types/utils/node-tree/node-adjacency.d.ts.map +0 -1
  426. package/dist/types/utils/node-tree/node-tree-index.d.ts +0 -57
  427. package/dist/types/utils/node-tree/node-tree-index.d.ts.map +0 -1
  428. package/dist/types/utils/picked-config.d.ts +0 -39
  429. package/dist/types/utils/picked-config.d.ts.map +0 -1
  430. package/dist/types/utils/preview-session.d.ts +0 -12
  431. package/dist/types/utils/preview-session.d.ts.map +0 -1
  432. package/dist/types/utils/rehydrate-scripts.d.ts +0 -50
  433. package/dist/types/utils/rehydrate-scripts.d.ts.map +0 -1
  434. package/dist/types/utils/render-string.d.ts +0 -24
  435. package/dist/types/utils/render-string.d.ts.map +0 -1
  436. package/dist/types/utils/user-timing.d.ts +0 -21
  437. package/dist/types/utils/user-timing.d.ts.map +0 -1
  438. package/dist/version-CLjPfmxk.cjs +0 -1
  439. package/dist/version-CPKulHMH.js +0 -256
  440. /package/dist/types/plugins/{experience-browser-storage → experience-browserstorage-plugin}/index.d.ts +0 -0
  441. /package/dist/types/plugins/{history-browser-storage → history-browserstorage-plugin}/index.d.ts +0 -0
  442. /package/dist/types/plugins/{responses-browser-storage → responses-browserstorage-plugin}/index.d.ts +0 -0
  443. /package/dist/types/plugins/{responses-indexeddb → responses-indexeddb-plugin}/index.d.ts +0 -0
@@ -1,94 +0,0 @@
1
- ---
2
- type: explanation
3
- layout: docs
4
- ---
5
-
6
- # About conditions and the logic engine
7
-
8
- A condition decides whether a visitor sees something. One rule format covers every one of
9
- those decisions, both in the dashboard and in code. This page covers why there is one
10
- engine, and what it can reach.
11
-
12
- ## One rule format, many places
13
-
14
- The dashboard uses the visual condition builder in four places, and the SDK evaluates the
15
- same rules in each:
16
-
17
- - **Condition nodes** decide which branch a flow takes.
18
- - **Experience conditions** decide whether an experience starts for a visitor.
19
- - **Initialize-open conditions** decide whether an experience opens by itself.
20
- - **Field option conditions** show or hide one option in a field.
21
-
22
- One format means one model to learn. Learn how a rule reads in the flow builder, and you
23
- can read the rule that gates an experience.
24
-
25
- ## What a rule looks like below
26
-
27
- A rule is JSON Logic. The visual builder writes it for you, and you can also write it
28
- directly in SDK code:
29
-
30
- ```ts
31
- {
32
- '==': [{ var: 'responses.country' }, 'US']
33
- }
34
- ```
35
-
36
- Rules sit in groups, and each group is an **AND** or an **OR**. Put a group inside another
37
- group to build a larger rule.
38
-
39
- The format is data, and not code. That is the point. A rule travels from the dashboard to
40
- the browser inside the published snapshot. A function cannot travel that way.
41
-
42
- ## What a rule can read
43
-
44
- | Source | What it holds |
45
- | --- | --- |
46
- | **Responses** | The values your visitors send through the fields of the current experience. |
47
- | **Actions** | The actions that ran during the flow. |
48
- | **Feature flags** | Whether Picked allocates this visitor to a flag. |
49
- | **Location** | The parts of the current URL: pathname, search parameters, hostname, and hash. |
50
-
51
- Each one is state the SDK already holds, which is why a rule evaluates without a network
52
- request.
53
-
54
- ## Predicates are the escape hatch
55
-
56
- The four sources above cover what Picked knows. They do not cover what *your application*
57
- knows: a cart total, an account level, or the profile of a signed-in user.
58
-
59
- A **predicate** gives you that. It is a function that you register on the client, and a
60
- rule invokes it by name:
61
-
62
- ```ts
63
- { invoke: { var: 'predicates.has-items-in-cart' } }
64
- ```
65
-
66
- The predicate receives a frozen state snapshot and returns a boolean, a string, an array
67
- of strings, or `undefined`. Because a rule can invoke one, the visual builder in the
68
- dashboard reaches your application data, and nobody writes JSON Logic by hand.
69
-
70
- A predicate must stay pure and fast. The SDK can invoke it many times while it evaluates a
71
- flow, and everything that waits on the rule waits on the predicate.
72
-
73
- ## Why a precondition is not a condition
74
-
75
- The client takes two gates, and they answer different questions:
76
-
77
- | Gate | Question |
78
- | --- | --- |
79
- | Precondition | Must Picked start at all? |
80
- | Condition | Is this visitor eligible? |
81
-
82
- A precondition runs at startup, and that has a result which catches people out. A
83
- precondition that points at a feature flag reads the bucket of that flag, and a read is
84
- what allocates the visitor. Every visitor is therefore allocated to that flag before
85
- anything else happens, and that includes a visitor who never reaches the experience the
86
- flag controls. See
87
- [About feature flag allocation](/explanation/feature-flag-allocation).
88
-
89
- ## Related
90
-
91
- - [Condition builder](/reference/dashboard/flow-builder/condition-builder) — the visual
92
- editor.
93
- - [SDK conditions](/reference/sdk/conditions) — the JSON Logic shapes.
94
- - [Predicates](/reference/sdk/predicates) — the state snapshot and the return types.
@@ -1,99 +0,0 @@
1
- ---
2
- type: explanation
3
- layout: docs
4
- ---
5
-
6
- # About content references
7
-
8
- A [Reference field](/reference/dashboard/content/models#reference-fields) points one
9
- content entry at another. Why a pointer, when Picked can put the content into the entry
10
- that needs it?
11
-
12
- ## A pointer keeps one fact in one place
13
-
14
- A product points at its category. Ten products can point at the same category.
15
-
16
- A copy makes ten categories. Correct the name of the category and you must correct it ten
17
- times. The copy that you do not correct is now wrong.
18
-
19
- A pointer makes one category. Correct the name one time, and every product that points at
20
- it is correct.
21
-
22
- This is the same reason that Blocks exist, one level up. A Block shares a *shape* between
23
- entries. A reference shares an *entry* between entries.
24
-
25
- ## The target travels beside the content
26
-
27
- Picked sends the entries of your steps in `content`. It sends the entries that a
28
- reference reaches in `references`. Both go into the same content index in the SDK, keyed
29
- by the id.
30
-
31
- Picked can put the target inside the field instead, and it did so before. Three things
32
- count against that.
33
-
34
- A shared target costs one blob, and not one blob for each entry that points at it. Ten
35
- products with the same category send the category one time.
36
-
37
- A separate entry has an id. Your code reads it with `useContent(id)`, and live preview
38
- updates it while you edit. A target inside a field has no id, so an update finds nothing
39
- to change.
40
-
41
- The reader chooses how deep to go. A component that shows a category reads the category.
42
- A component that shows a card reads the product only, and it costs nothing more.
43
-
44
- ## Picked stops a chain at a depth of five
45
-
46
- Content can point at content that points at content. Such a chain has no end of its own.
47
- A cycle has none at all. Two entries that point at each other keep the chain open for as
48
- long as something asks.
49
-
50
- Picked therefore resolves a chain to a depth of five. It counts the depth from the
51
- entries that your steps point at. It also keeps the entries that it saw, so that a cycle
52
- stops.
53
-
54
- Five is a choice, and not a rule of the system. It is deep enough for the shapes that
55
- content takes, such as a product, its category, and the owner of that category. It is
56
- also small enough that one page cannot pull a whole workspace over the wire.
57
-
58
- ## A missing entry is how Picked says "no such entry"
59
-
60
- Picked sends no blob for a pointer whose target it cannot resolve. The entry is absent
61
- from `references`.
62
-
63
- The other option is a blob with no data. That reads as an entry that exists and is empty,
64
- which is a different fact from an entry that is not there.
65
-
66
- Your code cannot tell one from the other. The empty record also goes into the content
67
- index under an id that resolves. A missing entry looks like nothing else.
68
-
69
- ## A delete stops while a reference is live
70
-
71
- Picked does not delete an entry that another entry points at. It does not delete a Model
72
- that a Reference field holds as its target.
73
-
74
- The other option is a pointer at nothing. Picked must then choose what the field holds,
75
- and every answer is wrong. It can give your component an empty value that the component
76
- does not expect. It can also remove content that somebody wrote, with no report.
77
-
78
- A stop costs you one step. Clear the reference, then delete the target. In return, a
79
- field that holds a pointer always points at something that exists.
80
-
81
- ## A reference stays inside its workspace
82
-
83
- A field cannot point at an entry in another workspace. Picked reports such a target as
84
- unknown.
85
-
86
- A workspace is one version of the configuration of a project, and you publish it whole. A
87
- pointer that leaves the workspace resolves against content that this workspace never
88
- sent. The two sides can then go live at different times.
89
-
90
- The delivery surface applies the same rule on a read, so a target outside the workspace
91
- never reaches a visitor.
92
-
93
- ## Related
94
-
95
- - [Models](/reference/dashboard/content/models) — the field and its options.
96
- - [Content entries](/reference/dashboard/content/content-entries) — the editor and the delete rules.
97
- - [Content](/reference/sdk/content) — how your code resolves a pointer.
98
- - [Experience content endpoint](/reference/delivery-api/experience-content) — the wire shape.
99
- - [About the content model](/explanation/the-content-model) — why a schema and its data are separate.
@@ -1,218 +0,0 @@
1
- ---
2
- type: explanation
3
- layout: docs
4
- ---
5
-
6
- # About feature flag allocation
7
-
8
- When does a visitor enter a test, and what decides the group they land in? The answer is
9
- not "when you create the feature flag" and not "when the page loads". It is the moment something
10
- reads the bucket, and that moment is yours to choose.
11
-
12
- ## A registration is not a decision
13
-
14
- The SDK loads every feature flag in your project at startup. It allocates nobody then. A feature flag
15
- stays undecided until something reads its bucket. The first read runs the `decide`
16
- function, stores the result, and reports the decision.
17
-
18
- You therefore choose when Picked commits a visitor to a feature flag. You choose it by the point
19
- at which you read the feature flag.
20
-
21
- ## A read of the bucket records an exposure
22
-
23
- The first read is the decision, so it is also the moment the visitor enters the test. If
24
- you read every feature flag at startup, every visitor counts as exposed to every test. That
25
- includes a test the visitor never reached.
26
-
27
- Read a feature flag where the decision matters: after the cart loads, after the quote returns, or
28
- after you know who the visitor is. A feature flag that you read before that point puts a visitor in
29
- a test they never saw, and the uplift number then means nothing.
30
-
31
- ## A condition reads the bucket, so a condition allocates
32
-
33
- Most reads are not calls that you write. They come from a condition. A condition that
34
- points at a feature flag with `invoke: { var: 'features.<id>' }` must have the bucket
35
- before it can compare it. That read allocates the visitor, exactly as a call in your own
36
- code does.
37
-
38
- Where the condition sits therefore decides who enters the test:
39
-
40
- | The condition is | It runs | Who enters the test |
41
- | --- | --- | --- |
42
- | An experience condition | When Picked evaluates that experience | Only a visitor who reaches the experience |
43
- | A precondition | At startup, before anything else | Every visitor who loads the page |
44
-
45
- A precondition that points at a feature flag allocates every visitor on your site, and it
46
- does so before the visitor sees anything. Keep a feature flag out of a precondition unless
47
- it truly controls whether Picked starts at all.
48
-
49
- Keep each `decide` function fast for the same reason. Everything that waits for the
50
- condition waits for `decide`, and that includes the experience itself. A network call
51
- inside `decide` delays what the visitor sees.
52
-
53
- ## How Picked chooses
54
-
55
- For a feature flag you control from the dashboard the choice is deterministic. Picked
56
- gives each visitor a stable value for each feature flag. It derives that value from the
57
- visitor ID and from the ID of the feature flag, and it compares the value against the
58
- weight. Picked allocates the visitor when the value is below the weight.
59
-
60
- The same visitor gets the same result for one feature flag on every visit, while the
61
- weight stays the same.
62
-
63
- That is also why a feature flag you control from the dashboard cannot use the data of
64
- your application in its decision. The value comes from the visitor ID, the feature flag
65
- ID, and the weight, and from nothing else. Define the feature flag in SDK code when the
66
- decision needs a cart, a quote, or a profile.
67
-
68
- ## More than two groups
69
-
70
- A Text feature flag has a table of variants, and each variant is one group. Picked
71
- allocates a visitor to exactly one of them, and the control group is one of the rows.
72
-
73
- The two types decide by different routes, and the difference matters if you compare them:
74
-
75
- | Type | Picked compares | Against |
76
- | --- | --- | --- |
77
- | Boolean | The stable value of the visitor, out of 100 | The weight |
78
- | Text | One stable value for each variant | The weight of that variant |
79
-
80
- A Text feature flag gives each variant a score. Picked makes the score from the visitor
81
- ID, the feature flag ID, and the key of the variant. The weight of the variant then scales
82
- that score. The variant with the best score receives the visitor.
83
-
84
- The weight of a variant therefore changes the score of that variant alone. No other
85
- variant moves because of it.
86
-
87
- A Boolean feature flag makes the same comparison it always has. A feature flag that you
88
- made before variants existed therefore keeps every visitor where it put them.
89
-
90
- Picked derives the stable value from the visitor ID and from the ID of the feature flag,
91
- for both types. The two types are therefore independent of each other in the same way that
92
- two feature flags are.
93
-
94
- **The order of the rows has no effect.** Picked scores each variant from its key, and the
95
- key of a variant never changes. Move a row in the dashboard and the
96
- visitors stay where they are. The order that you see is the order that you chose to read
97
- them in, and nothing more.
98
-
99
- Rename a variant and nothing changes. The name travels no further than the dashboard.
100
-
101
- Change the string that a variant serves and the visitors stay in the same group, but your
102
- site and your reports receive the new string. A visitor with a decision in browser storage
103
- keeps the old string until you increment the version.
104
-
105
- ## Each feature flag is independent
106
-
107
- Picked builds that value from the visitor ID together with the ID of the feature flag.
108
- Each feature flag therefore gets its own value, and tests that run at the same time are
109
- independent of each other.
110
-
111
- Two feature flags, both at weight 50, split your visitors into four equal parts:
112
- allocated to both, to one, to the other, or to neither. Three feature flags at weight 50
113
- give eight groups of 12.5%. Add a feature flag and the groups divide again.
114
-
115
- This is what lets you read two experiments separately. Give every feature flag the same
116
- value, and two feature flags at weight 50 hold exactly the same visitors. Your analytics
117
- then never sees the mixed groups that tell one result from the other.
118
-
119
- ## The allocation ratchets
120
-
121
- The ratchet applies to both types of feature flag. Inside one feature flag, a larger
122
- weight only adds visitors. Everybody allocated at
123
- weight 30 is still allocated at weight 50. The allocation is a **ratchet**: it turns one
124
- way, and a larger weight never moves a visitor back out.
125
-
126
- That property is what makes a staged release safe. A visitor who sees the change at 10%
127
- still sees it at 20%. A smaller weight is the reverse turn. It removes visitors from the
128
- top of the range, and every visitor below the new weight keeps what they had.
129
-
130
- A Text feature flag has the same ratchet, one variant at a time. A larger weight on one variant only
131
- adds visitors to that variant. A smaller weight only removes them. Two variants that you
132
- do not change never exchange visitors with each other.
133
-
134
- ## A disabled feature flag records nothing
135
-
136
- A disabled feature flag allocates nobody, and the difference from a weight of 0
137
- matters for your reports. At weight 0 the visitor is in the test, and in the
138
- control group. When the feature flag is disabled, the visitor is not in the test at all.
139
-
140
- The SDK does not evaluate a disabled feature flag. It writes no decision to browser
141
- storage and it reports no decision. The feature flag is also absent from the feature
142
- list on every analytics event. Expect a step change in your reports when you disable
143
- one: fewer feature flags for each visitor, and fewer decision events.
144
-
145
- This state is temporary. A visitor allocated before you disabled the feature flag keeps
146
- that bucket in the browser. When you enable the feature flag again, that visitor continues
147
- in the same group.
148
-
149
- ## What a version does, and what it does not
150
-
151
- Each feature flag carries a version, and it starts at 1. The SDK caches the bucket in
152
- browser storage under a key that holds the feature flag ID and the version. A visitor
153
- therefore keeps the same bucket across page loads.
154
-
155
- Change a weight and leave the version as it is, and that cache decides the result. A
156
- visitor who has a cached bucket keeps it. The new weight reaches only a visitor who has no
157
- cache. Your reports then hold two groups of visitors at the same time, one measured
158
- against the old weight and one against the new.
159
-
160
- Increment the version and the old cache key no longer matches. The feature flag counts as
161
- undecided, `decide` runs again on the next page load, and every visitor is measured
162
- against the new weight. Increment it after each weight change, unless you intend the
163
- change to reach new visitors only.
164
-
165
- **The version affects the cache only. It is not part of the allocation.** The ratchet
166
- still holds after you increment the version: a visitor allocated at weight 30 is allocated
167
- again at weight 50. You cannot decrement a version.
168
-
169
- ## When the SDK reports a decision
170
-
171
- The SDK sends `feature_decide` the first time that it allocates a visitor to a bucket,
172
- and only then. On a later page load it restores that bucket from browser storage and sends
173
- nothing. A visitor who returns therefore produces no `feature_decide` event, although that
174
- visitor is still in the group they went into the first time.
175
-
176
- An integration that listens only for `feature_decide` under-reports every visitor who
177
- returns. Choose the source that matches your question:
178
-
179
- | Question | Source |
180
- | --- | --- |
181
- | Which bucket is this visitor in now? | [`client.features.listStore`](/how-to/read-a-feature-flag#1-choose-an-accessor) |
182
- | Did the SDK allocate a visitor now? | [`feature_decide` on `client.eventBus`](/reference/sdk/features#watch-for-feature-flag-decisions) |
183
- | Which allocations happened before I subscribed? | [`client.events`](/reference/sdk/features#read-the-events-that-already-happened) |
184
-
185
- `listStore` updates each time that a feature flag resolves. It does this whether the SDK
186
- restored the bucket from storage or allocated the visitor now. A watch on it therefore
187
- always gives the current state.
188
- Use `feature_decide` only when you need to know that Picked allocated a visitor at that
189
- moment.
190
-
191
- ## What Picked reports for you
192
-
193
- Every Picked analytics event carries a `feature_list` context, and a report of your own
194
- can use it. The context describes each feature flag that this visitor resolved: the
195
- feature flag ID, the name, the version key, and the bucket. Only a resolved feature flag
196
- appears there, so the context shows what the visitor was exposed to at the time when the
197
- event fired.
198
-
199
- The optional [Sentry plugin](https://www.npmjs.com/package/@picked/sentry) also tags each
200
- allocation onto the Sentry scope as `picked.feature.<id>`, with the bucket as the value.
201
- You can then filter your errors by the variant.
202
-
203
- ## Preview mode
204
-
205
- In preview mode the SDK stores the bucket in session storage and not in local storage. The
206
- bucket does not stay after you close the tab, and Picked can allocate a preview visitor
207
- differently from a production visitor. Treat a preview allocation as disposable.
208
-
209
- A feature flag that you define in SDK code can ask for the same thing in production with
210
- `storage: 'session'`. Use it for a short test that must not last across browser sessions.
211
-
212
- ## Related
213
-
214
- - [How to read a feature flag](/how-to/read-a-feature-flag) — the accessors, and which
215
- ones resolve the feature flag.
216
- - [Feature flags](/reference/dashboard/features) — the dashboard controls.
217
- - [SDK feature flags](/reference/sdk/features) — the definition shape and the accessor
218
- table.
@@ -1,124 +0,0 @@
1
- ---
2
- type: explanation
3
- layout: docs
4
- ---
5
-
6
- # About how Picked works
7
-
8
- What happens between the moment an editor clicks **Publish** and the moment a visitor
9
- sees the result? This page follows one change through the whole system.
10
-
11
- ## The shape of it
12
-
13
- Picked splits into two parts that meet at a published snapshot.
14
-
15
- ```
16
- Author (dashboard) -> Publish -> Delivery API (config + content)
17
- -> SDK reads it -> conditions decide -> component renders
18
- ```
19
-
20
- On the left, an editor works in a workspace. Nothing they do reaches a visitor. On the
21
- right, the SDK in your application reads what was published and renders it. The snapshot
22
- between them is immutable, so each part moves at its own speed. An editor publishes with
23
- no deployment, and you deploy with no change to the content.
24
-
25
- ## What happens when you publish
26
-
27
- Picked takes the current workspace and makes an immutable snapshot of it. The result is a
28
- version, and a project serves exactly one version at a time, the live one. Nothing in a
29
- published version can change later. A roll-back moves the live pointer of the project to
30
- an earlier version, and it changes no data.
31
-
32
- That is why the dashboard has a draft state at all. The workspace holds the work that is
33
- still in progress. The version holds what your visitors get.
34
-
35
- ## What the SDK does at startup
36
-
37
- `createClient()` builds the client, and `client.start()` runs it. Between those two calls
38
- nothing happens yet.
39
-
40
- 1. **Options resolve.** The dynamic experiences plugin reads the configuration of your
41
- project from the source that its `mode` names. That is the data in your bundle, or a
42
- request to the Delivery API. A preview token replaces both.
43
- 2. **Everything registers.** The plugin registers every feature flag, condition, field,
44
- step, and experience from that configuration. You declare none of them in code.
45
- 3. **Preconditions run.** A precondition asks whether Picked should start at all. A
46
- condition asks whether this visitor is eligible.
47
- 4. **Experiences resolve.** Each experience evaluates its condition and looks for its
48
- target element in the page.
49
- 5. **Components render.** An experience whose condition is true, and whose target exists,
50
- renders the component you registered under its component name.
51
-
52
- Step 1 is why the [Vite plugin](/reference/tools/vite-plugin) exists: it embeds the
53
- options at build time, so production makes no request at startup.
54
-
55
- ## Why the browser and the server can read from different places
56
-
57
- The two ends of a server-rendered page want different things. Your server wants a new
58
- version to reach visitors at once. That needs a request to the API. The browser wants no
59
- request at all. That needs the data in your bundle.
60
-
61
- The `mode` option belongs to one end only, so you can have both. Give `'api'` to your
62
- server and `'bundle'` to your browser.
63
-
64
- Each end stays consistent with itself. The configuration and the content that one end
65
- reads always come from the same source. Picked gives them the same version.
66
-
67
- The two ends can still hold different versions. An editor publishes a workspace between
68
- your build and the request, which moves the server to a newer version than the bundle.
69
- The snapshot from the server then wins. The browser keeps it, and drops the configuration
70
- that it read.
71
-
72
- The reason is that the server made the page from that snapshot. To register a different
73
- configuration over the top makes the page and the client show different data. One
74
- version behind is the safer of the two results. The client records the two version IDs on
75
- `client.versionSkew`, and the [devtools](/reference/tools/chrome-extension) show them.
76
-
77
- ## Why the flow is a graph
78
-
79
- An experience is not a list of screens. It is a directed graph, and the SDK walks it.
80
-
81
- The origin node is the entry point. From there each edge leads to a step, an action, or a
82
- condition. A step waits for the visitor. An action runs a side effect and does not
83
- interrupt them. A condition evaluates a rule and sends the flow down one of two paths.
84
-
85
- The walk is what makes a branch cost so little. To show a different screen to a different
86
- visitor you add a condition node, and not a second copy of the flow. The same step can
87
- appear in several flows, because a step belongs to the project and the graph only
88
- points at it.
89
-
90
- ## How an action decides which way to go
91
-
92
- An action node can carry a success branch and a failure branch, and the SDK picks between
93
- them from the outcome of your handler:
94
-
95
- - The handler **throws**, or its promise rejects: the flow takes the failure branch.
96
- - The handler **resolves** to any value at all, and that includes `false`: the flow takes
97
- the success branch.
98
-
99
- This difference matters more than it looks. A valid negative result is not a failure. An
100
- endpoint that answers `200` with `{ serviced: false }` succeeded — it told you something
101
- true. Record that value as a response and branch on it with a condition. Keep the failure
102
- branch for a request that did not complete.
103
-
104
- Get this wrong and your failure branch holds two different things at once: a network
105
- error, and a visitor who lives outside your service area.
106
-
107
- ## Where content comes in
108
-
109
- A flow renders in the browser. A page renders on your server, from content held in the
110
- Picked CMS, so a search engine reads it in the first response. Both are experiences, and
111
- both go through the same publish.
112
-
113
- The difference is only the place where each one renders, and that follows from what the
114
- content is for. See [About pages and flows](/explanation/pages-and-flows) and
115
- [About server-side rendering](/explanation/why-server-side-rendering).
116
-
117
- ## Related
118
-
119
- - [Add Picked to your application](/tutorials/first-experience) — the whole path, in
120
- practice.
121
- - [About workspaces and versions](/explanation/workspaces-and-versions) — draft, live,
122
- and roll-back.
123
- - [Delivery API](/reference/delivery-api) — what the published snapshot looks like on the
124
- wire.
@@ -1,76 +0,0 @@
1
- ---
2
- type: explanation
3
- layout: docs
4
- ---
5
-
6
- # About PickedQL
7
-
8
- PickedQL is SQL over your Picked analytics data, but it is not only SQL. It expands what
9
- you write before it runs. Why add a layer at all, and not give you the tables?
10
-
11
- ## The problem it answers
12
-
13
- An A/B test question is short to ask, and the SQL behind it is not. Take one question:
14
- "How many users are in the control group?" It needs four things. It needs a filter on the
15
- variant, a count of distinct users, a join to each dimension in the group, and a tenant
16
- filter.
17
-
18
- Write that by hand for every question, and most of each query is the same text again.
19
-
20
- PickedQL lets you write the short version:
21
-
22
- ```sql
23
- SELECT control_users(), variant_users()
24
- FROM metrics
25
- WHERE project_id = 'your-project-id'
26
- ```
27
-
28
- ## What it expands
29
-
30
- **Virtual tables.** A name such as `metrics` maps to the real tables below it. You name
31
- the thing that you ask about, and not the storage.
32
-
33
- **Virtual functions.** `control_users()` expands to a full aggregate expression. The
34
- definition lives in one place, so every report that counts control users counts them the
35
- same way.
36
-
37
- **Automatic joins.** Point at a dimension column such as `device_category` or
38
- `country_code` and PickedQL adds the `LEFT JOIN` for you. This gives you the most: a
39
- dimension that you did not join is the most common reason for a wrong answer that looks
40
- correct.
41
-
42
- **SQL passthrough.** Standard SQL still works next to a virtual function, and that
43
- includes `CASE WHEN`, window functions, and subqueries. The layer adds; it does not
44
- restrict.
45
-
46
- ## Why every query must carry a tenant filter
47
-
48
- Every query must carry a tenant filter in its `WHERE` clause. That filter is `project_id`
49
- for most tables. The `projects` table uses `id` instead, because there the row ID *is* the
50
- project ID.
51
-
52
- PickedQL reads that filter and checks your permission for that project. The filter is
53
- therefore not a convention that you can forget. Without one, the query does not run.
54
- The isolation is a property of the language, and not of each author.
55
-
56
- ## Which table to reach for
57
-
58
- | Table | Use it for |
59
- | --- | --- |
60
- | `metrics` | A dashboard. The data is aggregated first, so it is much faster than raw events. |
61
- | `events` | Anything deeper. Raw events let you build any breakdown or funnel. |
62
- | `experience_journey` | A sankey or a funnel chart. One line of SQL returns `source, target, users`. |
63
-
64
- Note what `experience_journey` does for you. It builds the eight common table expressions
65
- that a path analysis needs. Those remove the duplicates, rank the top paths, and call
66
- `lagInFrame`. You pass your parameters in the `WHERE` clause.
67
-
68
- Some reference columns are free on `events`. `step_title`, `experience_title`, and
69
- `project_name` come from reference tables that PickedQL joins for you.
70
-
71
- ## Related
72
-
73
- - [PickedQL](/reference/pickedql) — the language surface.
74
- - [Data sources](/reference/pickedql/data-sources) — every table.
75
- - [Virtual functions](/reference/pickedql/virtual-functions) — every function.
76
- - [How to run an analytics query](/how-to/analytics) — worked examples.
@@ -1,64 +0,0 @@
1
- ---
2
- type: explanation
3
- layout: docs
4
- ---
5
-
6
- # About pages and flows
7
-
8
- An experience has two kinds, and the dashboard makes you choose
9
- between them when you create one. Why two, and how do you know which one a piece of work needs?
10
-
11
- ## The two kinds
12
-
13
- | | Page | Flow |
14
- | --- | --- | --- |
15
- | What it is | A standalone experience that your server renders from a content entry. | An interactive experience of more than one step, which the browser renders. |
16
- | Use it for | A landing page or a campaign page where the search rank matters. | A quiz, a survey, a product finder, onboarding of more than one step. |
17
-
18
- The split is not about how complex the content is. It is about **who has to read it**.
19
-
20
- ## Why the split exists
21
-
22
- A crawler and a social preview read the HTML your server returns. Neither waits for
23
- JavaScript in the browser. Content that a search engine must find is therefore
24
- content that must be in the first response. Only a server render puts it there.
25
-
26
- A flow has the reverse constraint. Its value is in the interaction: a visitor answers,
27
- the flow branches, the next screen depends on what came before. None of that can be in the
28
- first response, because none of it exists until the visitor acts.
29
-
30
- Choose a Page when the content must reach a search engine. Choose a Flow when the value is
31
- in the interaction and a browser render is acceptable.
32
-
33
- ## What backs a page
34
-
35
- Four pieces sit behind every Page, and they are separate on purpose:
36
-
37
- 1. A **page layout** sets the shape: which fields the page can hold.
38
- 2. A **content entry** fills that shape with real data.
39
- 3. A **Page** binds one entry, so the SDK can render it.
40
- 4. The **SDK** reads the entry and renders it on your server.
41
-
42
- Layout and entry are separate because one layout backs many entries. Describe a campaign
43
- page one time, then make many pages from it. Change the layout and you must check every
44
- entry again. That is why the dashboard reports an invalid entry and does not serve it.
45
-
46
- A step layout does the same thing for one step inside a flow. The parts behave the same
47
- way. Only the thing that they give shape to is different.
48
-
49
- ## They meet at the same publish
50
-
51
- Both kinds are experiences. Both live in a workspace, both go into the same immutable
52
- version, and both come out of the same Delivery API. The SDK decides where to render each
53
- one, and every step before that treats them the same way.
54
-
55
- This matters, because it means a project mixes them freely. A server-rendered
56
- landing page can carry a browser-rendered quiz inside it.
57
-
58
- ## Related
59
-
60
- - [About how Picked works](/explanation/how-picked-works) — the path that both kinds take.
61
- - [About server-side rendering](/explanation/why-server-side-rendering) — how a Page
62
- reaches the browser.
63
- - [Pages](/reference/dashboard/content/pages) — the page editor.
64
- - [Experiences](/reference/dashboard/experiences) — the flow options.