@picked/client 0.0.1-dev.1785305085063 → 0.0.1-dev.1785908062293

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 (291) hide show
  1. package/dist/.tsbuildinfo +1 -0
  2. package/dist/api-03c5jvVk.js +38 -0
  3. package/dist/api-CQxCVIrm.cjs +1 -0
  4. package/dist/cjs/form/index.js +1 -1
  5. package/dist/cjs/index.js +2 -2
  6. package/dist/cjs/plugins/dom-observer/index.js +1 -1
  7. package/dist/cjs/plugins/dynamic-experiences/index.js +1 -1
  8. package/dist/cjs/server/index.js +1 -1
  9. package/dist/docs/explanation/conditions-and-the-logic-engine.md +94 -0
  10. package/dist/docs/explanation/feature-flag-allocation.md +176 -0
  11. package/dist/docs/explanation/how-picked-works.md +124 -0
  12. package/dist/docs/explanation/how-pickedql-works.md +76 -0
  13. package/dist/docs/explanation/pages-and-flows.md +64 -0
  14. package/dist/docs/explanation/the-content-model.md +77 -0
  15. package/dist/docs/explanation/the-two-apis.md +68 -0
  16. package/dist/docs/explanation/why-server-side-rendering.md +76 -0
  17. package/dist/docs/explanation/workspaces-and-versions.md +71 -0
  18. package/dist/docs/how-to/add-a-step-field-or-action.md +43 -0
  19. package/dist/docs/{pickedql/examples.md → how-to/analytics/index.md} +53 -28
  20. package/dist/docs/how-to/archive-or-delete-a-workspace.md +46 -0
  21. package/dist/docs/how-to/authenticate-with-a-magic-link.md +40 -0
  22. package/dist/docs/how-to/authenticate-with-a-password.md +51 -0
  23. package/dist/docs/how-to/authenticate-with-an-api-key.md +51 -0
  24. package/dist/docs/how-to/authenticate-with-oauth.md +40 -0
  25. package/dist/docs/how-to/build-a-flow.md +83 -0
  26. package/dist/docs/how-to/connect-the-mcp-server.md +38 -0
  27. package/dist/docs/how-to/create-a-project.md +29 -0
  28. package/dist/docs/how-to/create-an-experience.md +42 -0
  29. package/dist/docs/how-to/create-and-revoke-an-api-key.md +37 -0
  30. package/dist/docs/how-to/debug-with-the-chrome-extension.md +57 -0
  31. package/dist/docs/how-to/define-a-page-layout.md +39 -0
  32. package/dist/docs/how-to/fill-and-publish-a-page.md +50 -0
  33. package/dist/docs/how-to/install-the-gtm-template.md +84 -0
  34. package/dist/docs/how-to/install-the-sdk.md +68 -0
  35. package/dist/docs/how-to/install-the-vite-plugin.md +56 -0
  36. package/dist/docs/how-to/invite-and-remove-members.md +34 -0
  37. package/dist/docs/how-to/preview-a-workspace.md +28 -0
  38. package/dist/docs/how-to/publish-a-workspace.md +30 -0
  39. package/dist/docs/how-to/read-a-feature-flag.md +101 -0
  40. package/dist/docs/how-to/register-a-component.md +55 -0
  41. package/dist/docs/how-to/register-an-action-handler.md +67 -0
  42. package/dist/docs/how-to/render-a-step-form.md +132 -0
  43. package/dist/docs/how-to/render-an-unpublished-preview.md +41 -0
  44. package/dist/docs/how-to/reuse-a-section.md +37 -0
  45. package/dist/docs/how-to/reuse-a-step-field-or-action.md +28 -0
  46. package/dist/docs/how-to/roll-back-a-published-version.md +26 -0
  47. package/dist/docs/how-to/run-an-ab-test.md +49 -0
  48. package/dist/docs/how-to/run-code-on-a-form-submission.md +125 -0
  49. package/dist/docs/how-to/server-render-a-page.md +81 -0
  50. package/dist/docs/how-to/set-a-content-security-policy.md +32 -0
  51. package/dist/docs/how-to/set-up-mfa.md +69 -0
  52. package/dist/docs/how-to/upload-and-use-an-asset.mdx +73 -0
  53. package/dist/docs/how-to/validate-a-field.md +52 -0
  54. package/dist/docs/how-to/write-a-condition.md +45 -0
  55. package/dist/docs/how-to/write-a-predicate.md +60 -0
  56. package/dist/docs/index.md +41 -59
  57. package/dist/docs/reference/dashboard/actions.mdx +53 -0
  58. package/dist/docs/reference/dashboard/api-keys.mdx +37 -0
  59. package/dist/docs/reference/dashboard/conditions.mdx +42 -0
  60. package/dist/docs/reference/dashboard/content/asset-library.mdx +63 -0
  61. package/dist/docs/reference/dashboard/content/content-entries.mdx +44 -0
  62. package/dist/docs/reference/dashboard/content/layouts.mdx +62 -0
  63. package/dist/docs/reference/dashboard/content/pages.mdx +35 -0
  64. package/dist/docs/reference/dashboard/content/sections.mdx +28 -0
  65. package/dist/docs/reference/dashboard/experiences.mdx +51 -0
  66. package/dist/docs/reference/dashboard/features.mdx +114 -0
  67. package/dist/docs/reference/dashboard/fields.mdx +100 -0
  68. package/dist/docs/reference/dashboard/flow-builder/canvas.mdx +58 -0
  69. package/dist/docs/reference/dashboard/flow-builder/condition-builder.md +57 -0
  70. package/dist/docs/reference/dashboard/flow-builder/keyboard-shortcuts.md +72 -0
  71. package/dist/docs/reference/dashboard/flow-builder/nodes.md +63 -0
  72. package/dist/docs/reference/dashboard/projects.mdx +44 -0
  73. package/dist/docs/reference/dashboard/reports.mdx +43 -0
  74. package/dist/docs/reference/dashboard/steps.mdx +37 -0
  75. package/dist/docs/reference/dashboard/team-management.md +29 -0
  76. package/dist/docs/reference/dashboard/workspace-versioning.mdx +30 -0
  77. package/dist/docs/reference/dashboard/workspaces.mdx +76 -0
  78. package/dist/docs/{delivery-api → reference/delivery-api}/experience-content.md +17 -5
  79. package/dist/docs/reference/delivery-api/index.md +45 -0
  80. package/dist/docs/reference/delivery-api/preview-caching-crawling.md +79 -0
  81. package/dist/docs/{delivery-api → reference/delivery-api}/project-config.md +15 -6
  82. package/dist/docs/reference/glossary.md +173 -0
  83. package/dist/docs/reference/management-api/authentication.md +74 -0
  84. package/dist/docs/{api → reference/management-api}/authorization-and-scopes.md +70 -47
  85. package/dist/docs/reference/management-api/error-handling.md +233 -0
  86. package/dist/docs/{api → reference/management-api}/pagination.md +36 -20
  87. package/dist/docs/reference/pickedql/data-sources.md +174 -0
  88. package/dist/docs/reference/pickedql/dimensions.md +87 -0
  89. package/dist/docs/{pickedql → reference/pickedql}/filtering.md +17 -6
  90. package/dist/docs/reference/pickedql/index.md +18 -0
  91. package/dist/docs/reference/pickedql/schema.md +172 -0
  92. package/dist/docs/reference/pickedql/virtual-functions.md +237 -0
  93. package/dist/docs/reference/sdk/actions.md +30 -0
  94. package/dist/docs/{sdk → reference/sdk}/conditions.md +15 -5
  95. package/dist/docs/reference/sdk/content-security-policy.md +21 -0
  96. package/dist/docs/reference/sdk/experiences.md +51 -0
  97. package/dist/docs/reference/sdk/features.md +233 -0
  98. package/dist/docs/reference/sdk/fields.md +209 -0
  99. package/dist/docs/reference/sdk/index.md +68 -0
  100. package/dist/docs/{sdk → reference/sdk}/plugins/create-experience.md +25 -34
  101. package/dist/docs/reference/sdk/plugins/dynamic-experiences.md +74 -0
  102. package/dist/docs/reference/sdk/plugins/index.md +29 -0
  103. package/dist/docs/{sdk → reference/sdk}/plugins/window-object.md +6 -0
  104. package/dist/docs/reference/sdk/predicates.md +43 -0
  105. package/dist/docs/reference/sdk/ssr/index.md +33 -0
  106. package/dist/docs/reference/sdk/ssr/rendering-and-hydration.md +103 -0
  107. package/dist/docs/reference/sdk/ssr/serialize.md +77 -0
  108. package/dist/docs/reference/sdk/ssr/slots-and-placements.md +59 -0
  109. package/dist/docs/reference/sdk/steps.md +87 -0
  110. package/dist/docs/reference/tools/chrome-extension.md +16 -0
  111. package/dist/docs/reference/tools/image-optimisation-service.md +104 -0
  112. package/dist/docs/reference/tools/mcp.md +88 -0
  113. package/dist/docs/reference/tools/vite-plugin.md +88 -0
  114. package/dist/docs/tutorials/first-api-call.md +228 -0
  115. package/dist/docs/tutorials/first-experience-in-the-dashboard.mdx +143 -0
  116. package/dist/docs/tutorials/first-experience.mdx +255 -0
  117. package/dist/docs/tutorials/first-server-rendered-page.mdx +186 -0
  118. package/dist/{dom-BwmTHeT7.js → dom-BqcToNL0.js} +1 -3
  119. package/dist/{dom-CDrHc_j9.cjs → dom-DlLH3FxV.cjs} +1 -1
  120. package/dist/esm/form/index.js +2 -4
  121. package/dist/esm/index.js +225 -186
  122. package/dist/esm/plugins/dom-observer/index.js +1 -1
  123. package/dist/esm/plugins/dynamic-experiences/index.js +3 -3
  124. package/dist/esm/preview/index.js +1 -1
  125. package/dist/esm/server/index.js +33 -31
  126. package/dist/{experience-instance-DOJShRk5.js → experience-instance-DGk11d8a.js} +3 -3
  127. package/dist/experience-instance-Dej3P1sE.cjs +1 -0
  128. package/dist/plugin-CHOVsx7Z.js +287 -0
  129. package/dist/plugin-DsaGXQHx.cjs +1 -0
  130. package/dist/{preview-channel-DW9J8t4B.js → preview-channel-CSr96XAo.js} +1 -1
  131. package/dist/{protocol-DSqOlW2r.js → protocol-C5KkkiZc.js} +1 -1
  132. package/dist/types/client.d.ts +7 -6
  133. package/dist/types/data-source/api.d.ts +60 -0
  134. package/dist/types/data-source/api.d.ts.map +1 -0
  135. package/dist/types/data-source/provider.d.ts +97 -0
  136. package/dist/types/data-source/provider.d.ts.map +1 -0
  137. package/dist/types/entities/action/action.d.ts +5 -4
  138. package/dist/types/entities/action/action.d.ts.map +1 -1
  139. package/dist/types/entities/component/component.d.ts +6 -5
  140. package/dist/types/entities/component/component.d.ts.map +1 -1
  141. package/dist/types/entities/condition/condition.d.ts +5 -5
  142. package/dist/types/entities/content/content.d.ts +4 -3
  143. package/dist/types/entities/experience/experience.d.ts +11 -10
  144. package/dist/types/entities/experience/experience.d.ts.map +1 -1
  145. package/dist/types/entities/experience-instance/experience-instance.d.ts +10 -9
  146. package/dist/types/entities/feature/feature.d.ts +19 -2
  147. package/dist/types/entities/feature/feature.d.ts.map +1 -1
  148. package/dist/types/entities/field/field.d.ts +7 -6
  149. package/dist/types/entities/framework/framework.d.ts +7 -6
  150. package/dist/types/entities/framework/framework.d.ts.map +1 -1
  151. package/dist/types/entities/history/history.d.ts +6 -6
  152. package/dist/types/entities/plugin/plugin.d.ts +3 -2
  153. package/dist/types/entities/plugin/plugin.d.ts.map +1 -1
  154. package/dist/types/entities/predicate/predicate.d.ts +4 -3
  155. package/dist/types/entities/predicate/predicate.d.ts.map +1 -1
  156. package/dist/types/entities/response/response-validation.d.ts +3 -2
  157. package/dist/types/entities/response/response.d.ts +12 -11
  158. package/dist/types/entities/session/session.d.ts +2 -1
  159. package/dist/types/entities/step/step.d.ts +6 -5
  160. package/dist/types/exports.d.ts +2 -1
  161. package/dist/types/exports.d.ts.map +1 -1
  162. package/dist/types/form/build-responses.d.ts +2 -1
  163. package/dist/types/form/create-field-evaluator.d.ts +4 -3
  164. package/dist/types/form/create-field-validation.d.ts +5 -4
  165. package/dist/types/form/create-form.d.ts +7 -6
  166. package/dist/types/form/create-submit-pipeline.d.ts +7 -6
  167. package/dist/types/form/get-step-fields.d.ts +3 -2
  168. package/dist/types/lifecycle/condition-selection.d.ts +14 -4
  169. package/dist/types/lifecycle/lifecycle.d.ts +4 -3
  170. package/dist/types/lifecycle/rules-logic.d.ts +4 -3
  171. package/dist/types/lifecycle/state-snapshot.d.ts +4 -3
  172. package/dist/types/picked.d.ts +79 -62
  173. package/dist/types/picked.d.ts.map +1 -1
  174. package/dist/types/ping.d.ts +1 -1
  175. package/dist/types/ping.d.ts.map +1 -1
  176. package/dist/types/plugins/create-experience/create-experience.d.ts +9 -8
  177. package/dist/types/plugins/create-experience/create-experience.d.ts.map +1 -1
  178. package/dist/types/plugins/create-experience/plugin.d.ts +3 -2
  179. package/dist/types/plugins/create-experience/plugin.d.ts.map +1 -1
  180. package/dist/types/plugins/create-experience/serialization.d.ts.map +1 -1
  181. package/dist/types/plugins/dom-observer/plugin.d.ts +1 -1
  182. package/dist/types/plugins/dynamic-experiences/hash.d.ts +40 -5
  183. package/dist/types/plugins/dynamic-experiences/hash.d.ts.map +1 -1
  184. package/dist/types/plugins/dynamic-experiences/index.d.ts +2 -0
  185. package/dist/types/plugins/dynamic-experiences/index.d.ts.map +1 -1
  186. package/dist/types/plugins/dynamic-experiences/plugin.d.ts +4 -36
  187. package/dist/types/plugins/dynamic-experiences/plugin.d.ts.map +1 -1
  188. package/dist/types/plugins/dynamic-experiences/types.d.ts +42 -11
  189. package/dist/types/plugins/dynamic-experiences/types.d.ts.map +1 -1
  190. package/dist/types/plugins/experience-browser-storage/plugin.d.ts +1 -1
  191. package/dist/types/plugins/experience-browser-storage/plugin.d.ts.map +1 -1
  192. package/dist/types/plugins/history-browser-storage/plugin.d.ts +1 -1
  193. package/dist/types/plugins/history-browser-storage/plugin.d.ts.map +1 -1
  194. package/dist/types/plugins/responses-browser-storage/plugin.d.ts +1 -1
  195. package/dist/types/plugins/responses-browser-storage/plugin.d.ts.map +1 -1
  196. package/dist/types/plugins/responses-indexeddb/plugin.d.ts +1 -1
  197. package/dist/types/plugins/single-page-app/plugin.d.ts +1 -1
  198. package/dist/types/plugins/single-page-app/plugin.d.ts.map +1 -1
  199. package/dist/types/plugins/web-components/plugin.d.ts +2 -1
  200. package/dist/types/plugins/window-object/plugin.d.ts +2 -2
  201. package/dist/types/preview-channel.d.ts +5 -1
  202. package/dist/types/preview-receiver/index.d.ts +18 -1
  203. package/dist/types/preview-receiver/protocol.d.ts +10 -1
  204. package/dist/types/server/index.d.ts +3 -3
  205. package/dist/types/server/serialize.d.ts +8 -2
  206. package/dist/types/server/serialize.d.ts.map +1 -1
  207. package/dist/types/utils/dom.d.ts +2 -1
  208. package/dist/types/utils/events.d.ts +6 -6
  209. package/dist/types/utils/events.d.ts.map +1 -1
  210. package/dist/types/utils/global-obj.d.ts +1 -1
  211. package/dist/types/utils/global-obj.d.ts.map +1 -1
  212. package/dist/types/utils/id.d.ts.map +1 -1
  213. package/dist/types/utils/logger.d.ts +2 -1
  214. package/dist/types/utils/logger.d.ts.map +1 -1
  215. package/dist/types/utils/node-tree/get-next-node-from-action.d.ts +2 -1
  216. package/dist/types/utils/node-tree/get-next-node-from-condition.d.ts +2 -1
  217. package/dist/types/utils/node-tree/get-next-node.d.ts +1 -1
  218. package/dist/types/utils/node-tree/get-next-node.d.ts.map +1 -1
  219. package/dist/types/utils/node-tree/get-origin-node.d.ts +1 -1
  220. package/dist/types/utils/node-tree/get-origin-node.d.ts.map +1 -1
  221. package/dist/types/utils/node-tree/min-max-steps-to-leaf.d.ts +1 -1
  222. package/dist/types/utils/node-tree/min-max-steps-to-leaf.d.ts.map +1 -1
  223. package/dist/types/utils/node-tree/min-max-steps-to-origin.d.ts +1 -1
  224. package/dist/types/utils/node-tree/min-max-steps-to-origin.d.ts.map +1 -1
  225. package/dist/types/utils/node-tree/next-reachable-step-nodes.d.ts +1 -1
  226. package/dist/types/utils/node-tree/next-reachable-step-nodes.d.ts.map +1 -1
  227. package/dist/types/utils/nodes.d.ts +1 -1
  228. package/dist/types/utils/picked-config.d.ts +2 -1
  229. package/dist/types/utils/rehydrate-scripts.d.ts +6 -0
  230. package/dist/types/utils/rehydrate-scripts.d.ts.map +1 -1
  231. package/dist/types/utils/rules-logic.d.ts +6 -2
  232. package/dist/types/utils/storage.d.ts +1 -1
  233. package/dist/types/utils/storage.d.ts.map +1 -1
  234. package/package.json +22 -23
  235. package/dist/api-CPL40b7A.js +0 -40
  236. package/dist/api-Dz5rgRgQ.cjs +0 -1
  237. package/dist/docs/actions.mdx +0 -78
  238. package/dist/docs/api/authentication.md +0 -376
  239. package/dist/docs/api/error-handling.md +0 -211
  240. package/dist/docs/api/index.md +0 -197
  241. package/dist/docs/api-keys.mdx +0 -40
  242. package/dist/docs/chrome-extension.md +0 -51
  243. package/dist/docs/conditions.mdx +0 -59
  244. package/dist/docs/content/asset-library.mdx +0 -93
  245. package/dist/docs/content/content-entries.mdx +0 -30
  246. package/dist/docs/content/layouts.mdx +0 -70
  247. package/dist/docs/content/pages.mdx +0 -67
  248. package/dist/docs/content/sections.mdx +0 -33
  249. package/dist/docs/delivery-api/index.md +0 -46
  250. package/dist/docs/delivery-api/preview-caching-crawling.md +0 -59
  251. package/dist/docs/experiences.mdx +0 -42
  252. package/dist/docs/features.mdx +0 -58
  253. package/dist/docs/fields.mdx +0 -79
  254. package/dist/docs/flow-builder/building-flows.md +0 -61
  255. package/dist/docs/flow-builder/condition-builder.md +0 -54
  256. package/dist/docs/flow-builder/keyboard-shortcuts.md +0 -66
  257. package/dist/docs/flow-builder/nodes.md +0 -43
  258. package/dist/docs/flow-builder/overview.mdx +0 -50
  259. package/dist/docs/gtm-template.md +0 -69
  260. package/dist/docs/guides/build-a-personalized-page.mdx +0 -143
  261. package/dist/docs/image-optimisation-service.md +0 -80
  262. package/dist/docs/mcp.md +0 -120
  263. package/dist/docs/pickedql/data-sources.md +0 -145
  264. package/dist/docs/pickedql/dimensions.md +0 -65
  265. package/dist/docs/pickedql/index.md +0 -36
  266. package/dist/docs/pickedql/schema.md +0 -156
  267. package/dist/docs/pickedql/virtual-functions.md +0 -204
  268. package/dist/docs/projects.mdx +0 -37
  269. package/dist/docs/reports.mdx +0 -18
  270. package/dist/docs/sdk/actions.md +0 -66
  271. package/dist/docs/sdk/content-security-policy.md +0 -32
  272. package/dist/docs/sdk/experiences.md +0 -46
  273. package/dist/docs/sdk/features.md +0 -212
  274. package/dist/docs/sdk/fields.md +0 -263
  275. package/dist/docs/sdk/index.md +0 -83
  276. package/dist/docs/sdk/plugins/dynamic-experiences.md +0 -58
  277. package/dist/docs/sdk/plugins/index.md +0 -9
  278. package/dist/docs/sdk/predicates.md +0 -112
  279. package/dist/docs/sdk/ssr/index.md +0 -62
  280. package/dist/docs/sdk/ssr/rendering-and-hydration.md +0 -141
  281. package/dist/docs/sdk/ssr/serialize.md +0 -86
  282. package/dist/docs/sdk/ssr/slots-and-placements.md +0 -35
  283. package/dist/docs/sdk/steps.md +0 -434
  284. package/dist/docs/steps.mdx +0 -44
  285. package/dist/docs/team-management.md +0 -40
  286. package/dist/docs/vite-plugin.md +0 -82
  287. package/dist/docs/workspace-versioning.mdx +0 -28
  288. package/dist/docs/workspaces.mdx +0 -102
  289. package/dist/experience-instance-DurC3pE-.cjs +0 -1
  290. package/dist/plugin-CFXwbXeM.js +0 -247
  291. package/dist/plugin-m4qekgtA.cjs +0 -1
@@ -0,0 +1,73 @@
1
+ ---
2
+ type: how-to
3
+ layout: docs
4
+ ---
5
+
6
+ import { Screenshot } from '../../../components/Screenshot'
7
+
8
+ # How to upload and use an asset
9
+
10
+ This guide shows you how to put a file in the asset library and point at it from your
11
+ content.
12
+
13
+ ## 1. Add the field to a layout
14
+
15
+ Two field types point at the library:
16
+
17
+ - An **Asset** field takes an image, a video, or a document.
18
+ - An **HTML** field takes a `.html` file.
19
+
20
+ Add one of them to a page layout or a step layout.
21
+
22
+ ## 2. Choose a file
23
+
24
+ 1. Open the content entry.
25
+ 2. Click **Choose file** on the asset field. On a field that holds a value already, click
26
+ **Replace**.
27
+ 3. Open the **Upload** tab to add a new file.
28
+ 4. Open the **Library** tab to use a file that is there already.
29
+ 5. Choose your asset.
30
+
31
+ <Screenshot
32
+ route="/{orgSlug}/{projectId}/design-systems/new"
33
+ wait='button:has-text("Upload file")'
34
+ click='button:has-text("Upload file")'
35
+ selector="[role=dialog]"
36
+ alt="The asset picker modal on the Picked dashboard, with the Library tab, its search box, its type filter, and its Sort menu"
37
+ renderWidth={1072}
38
+ renderHeight={790}
39
+ />
40
+
41
+ <Screenshot
42
+ route="/{orgSlug}/{projectId}/design-systems/new"
43
+ wait='button:has-text("Upload file")'
44
+ click='button:has-text("Upload file")'
45
+ selector="[role=dialog]"
46
+ alt="The asset picker modal on the Picked dashboard, with the Library tab, its search box, its type filter, and its Sort menu"
47
+ renderWidth={1072}
48
+ renderHeight={790}
49
+ />
50
+
51
+ The detail panel on the right shows the kind, the dimensions, the size, and the upload
52
+ date.
53
+
54
+ ## 3. Find an asset in a large library
55
+
56
+ The **Library** tab has three controls, and the server applies each one across the whole
57
+ library:
58
+
59
+ - **Search by name** narrows the list by file name while you type.
60
+ - The type filter narrows the list to one media type. **All types** is the default.
61
+ - **Sort** orders the list by **Name**, **Date created**, or **Date updated**.
62
+
63
+ Click **Load more** at the bottom to read the next page of results.
64
+
65
+ :::tip
66
+ Each row has an **Open in new tab** control. Use it to check an asset again before you
67
+ choose it. Your choice in the picker stays as it is.
68
+ :::
69
+
70
+ ## Related
71
+
72
+ - [Asset library](/reference/dashboard/content/asset-library) — the limits, the file
73
+ types, and how Picked serves an uploaded file.
@@ -0,0 +1,52 @@
1
+ ---
2
+ type: how-to
3
+ layout: docs
4
+ ---
5
+
6
+ # How to validate a field
7
+
8
+ This guide shows you how to check what a visitor enters. Write the rule in JSON Logic. The
9
+ `$input` variable holds the current value of the field.
10
+
11
+ ## Steps
12
+
13
+ Add a `validation` rule to `createField()`:
14
+
15
+ ```ts
16
+ import { createField } from '@picked/client/plugins/create-experience'
17
+
18
+ const quantityField = createField({
19
+ id: 'quantity',
20
+ name: 'quantity',
21
+ type: 'number',
22
+ label: 'Quantity',
23
+ multiple: false,
24
+ required: true,
25
+ validation: {
26
+ catch: {
27
+ or: [
28
+ {
29
+ and: [
30
+ { '>': [{ var: '$input' }, 0] },
31
+ { '<=': [{ var: '$input' }, 999] },
32
+ ],
33
+ },
34
+ { throw: 'Please enter a value between 1 and 999' },
35
+ ],
36
+ },
37
+ },
38
+ })
39
+ ```
40
+
41
+ :::tip
42
+ The `catch` and `throw` pattern checks that the condition gives `true`. When it does not,
43
+ the SDK shows the `throw` message to your visitor.
44
+ :::
45
+
46
+ The SDK runs the rule on blur and on submit.
47
+
48
+ ## Related
49
+
50
+ - [SDK fields](/reference/sdk/fields) — every field option.
51
+ - [About conditions and the logic engine](/explanation/conditions-and-the-logic-engine) —
52
+ the rule format.
@@ -0,0 +1,45 @@
1
+ ---
2
+ type: how-to
3
+ layout: docs
4
+ ---
5
+
6
+ # How to write a condition
7
+
8
+ This guide shows you how to build a rule in the visual condition builder. The builder
9
+ appears on a condition node, on an experience condition, on an initialize-open condition,
10
+ and on a field option.
11
+
12
+ ## Steps
13
+
14
+ 1. Choose the node or the field that takes the condition.
15
+ 2. Find the **Logic** section in the inspector.
16
+ 3. Choose a data source: **Responses**, **Actions**, **Feature flags**, **Conditions**,
17
+ or **Window Location**.
18
+ 4. Choose an operator. The choices include equals, not equals, greater than, and
19
+ contains.
20
+ 5. Enter a value.
21
+
22
+ ## Join more than one rule
23
+
24
+ 1. Create an AND group or an OR group.
25
+ 2. Add your rules inside it.
26
+
27
+ With **AND** every rule must match. With **OR** one rule must match. Put a group inside
28
+ another group to build a larger rule.
29
+
30
+ ## Example
31
+
32
+ To show a step only to a visitor who is on one page and who accepted marketing:
33
+
34
+ 1. Create an AND group.
35
+ 2. Add a rule: **Window Location → pathname** equals `/pricing`.
36
+ 3. Add a rule: **Responses → `marketing_opt_in`** equals `true`.
37
+
38
+ The group matches only when both rules are true.
39
+
40
+ ## Related
41
+
42
+ - [About conditions and the logic engine](/explanation/conditions-and-the-logic-engine) —
43
+ what a rule can read.
44
+ - [Condition builder](/reference/dashboard/flow-builder/condition-builder) — the rule
45
+ structure.
@@ -0,0 +1,60 @@
1
+ ---
2
+ type: how-to
3
+ layout: docs
4
+ ---
5
+
6
+ # How to write a predicate
7
+
8
+ This guide shows you how to let a condition read data that only your application holds,
9
+ such as a cart total or an account level.
10
+
11
+ ## 1. Define the predicate
12
+
13
+ Pass a `predicates` object to `createClient()`:
14
+
15
+ ```ts
16
+ import { createClient } from '@picked/client'
17
+
18
+ const client = createClient({
19
+ projectId: 'your-project-id',
20
+ predicates: {
21
+ 'is-example-page': ({ location }) => location?.pathname === '/example',
22
+ 'get-account-tier': async () => {
23
+ const data = await fetch('/api/get-account-tier').then((r) => r.json())
24
+ return data.result
25
+ },
26
+ },
27
+ })
28
+ ```
29
+
30
+ A predicate returns a boolean, a string, an array of strings, or `undefined`. It can also
31
+ return a promise that resolves to one of those.
32
+
33
+ ## 2. Invoke it from a condition
34
+
35
+ ```ts
36
+ condition: {
37
+ '==': [
38
+ { invoke: { var: 'predicates.is-example-page' } },
39
+ true,
40
+ ],
41
+ }
42
+ ```
43
+
44
+ :::tip
45
+ A predicate also works inside `validation` logic.
46
+ :::
47
+
48
+ ## Keep it pure and fast
49
+
50
+ - The same snapshot must always give the same result.
51
+ - Check that a response or a field is there before you read its value. Return `undefined`
52
+ when the data is not available, and do not throw.
53
+ - The SDK can invoke a predicate many times, so keep the logic small.
54
+ - Do not change the snapshot. It is frozen, and a change to it throws in strict mode.
55
+
56
+ ## Related
57
+
58
+ - [Predicates](/reference/sdk/predicates) — the state snapshot shape.
59
+ - [About conditions and the logic engine](/explanation/conditions-and-the-logic-engine) —
60
+ why predicates exist.
@@ -1,77 +1,59 @@
1
1
  ---
2
+ type: map
2
3
  layout: docs
3
4
  ---
4
5
 
5
- # Getting Started
6
+ # Picked documentation
6
7
 
7
- Picked lets you build personalized UI flows in a visual editor and deliver them to visitors on your site with a lightweight SDK.
8
+ Picked lets you build personalized UI flows in a visual editor. The SDK then serves them
9
+ to the visitors on your site.
8
10
 
9
- ## How it works
11
+ There are two paths to follow. Choose the one that matches your work.
10
12
 
11
- You design experiences in the dashboard using a drag-and-drop flow builder. The SDK fetches your published experiences and renders them on your site.
13
+ ## Work in the dashboard
12
14
 
13
- ## Quick start
15
+ Build experiences, write content, and publish.
14
16
 
15
- ### 1. Create a project
17
+ Start with [build your first experience](/tutorials/first-experience-in-the-dashboard).
18
+ It takes you from an empty project to a survey on your own site, and it needs no
19
+ development tools.
16
20
 
17
- Sign in to the dashboard and create a project. A project represents one website or app.
21
+ One thing must happen first: a developer adds the Picked SDK to your site one time. After
22
+ that, the dashboard is all you need.
18
23
 
19
- See [Projects](/projects) for details.
24
+ Then:
20
25
 
21
- ### 2. Install the SDK
26
+ - **[Build](/how-to/create-an-experience)** — experiences, flows, conditions, and A/B
27
+ tests.
28
+ - **[Content](/how-to/define-a-page-layout)** — layouts, sections, pages, and assets.
29
+ - **[Publish](/how-to/publish-a-workspace)** — preview, publish, and roll back.
30
+ - **[Administer and measure](/how-to/invite-and-remove-members)** — members, API keys,
31
+ analytics, and the tools that connect Picked to Google Tag Manager and to an AI tool.
32
+ - **[Dashboard reference](/reference/dashboard/projects)** — every dashboard screen and
33
+ every option, plus the [glossary](/reference/glossary).
34
+ - **[How Picked works](/explanation/how-picked-works)** — what happens when you publish.
22
35
 
23
- Add the SDK to your site and initialize the client. Copy the snippet from your project home page.
36
+ ## Integrate with code
24
37
 
25
- ```typescript
26
- import { createClient } from '@picked/client'
38
+ Add Picked to a site or an application. Your code then renders the experiences that the
39
+ dashboard describes.
27
40
 
28
- const picked = createClient({
29
- projectId: 'your-project-id',
30
- plugins: [],
31
- })
41
+ Start with [add Picked to your application](/tutorials/first-experience). It goes from an
42
+ empty project to a survey that runs in React or in Svelte.
32
43
 
33
- picked.start()
34
- ```
44
+ Read the dashboard documents above also. Everything your code renders is described
45
+ there, so the two paths link to each other rather than repeat.
35
46
 
36
- See [SDK Installation](/sdk) for full setup options.
47
+ Then:
37
48
 
38
- ### 3. Register a component
39
-
40
- Register components when creating the client. Each key in the `components` object must match a component name you set in the dashboard.
41
-
42
- ```typescript
43
- import { createClient } from '@picked/client'
44
-
45
- const picked = createClient({
46
- projectId: 'your-project-id',
47
- components: {
48
- 'welcome-survey': YourComponent,
49
- },
50
- })
51
-
52
- picked.start()
53
- ```
54
-
55
- See [SDK Experiences](/sdk/experiences) for targeting, conditions, and component adapters.
56
-
57
- ### 4. Create an experience
58
-
59
- In the dashboard, open your project and click **Experiences** > **New Experience**. Enter a name and set the component name to match your registered component (e.g., `welcome-survey`).
60
-
61
- See [Experiences](/experiences) for configuration options.
62
-
63
- ### 5. Build the flow
64
-
65
- Open the flow builder and drag steps, actions, and conditions onto the canvas. Connect nodes to define the visitor's path through the experience.
66
-
67
- See [Flow Builder](/flow-builder/overview) for a full walkthrough.
68
-
69
- ### 6. Save and publish
70
-
71
- Click **Save** in the flow builder toolbar. The SDK picks up the published experience and renders it to matching visitors on your site.
72
-
73
- ## Next steps
74
-
75
- - [Flow Builder](/flow-builder/overview) — Build experience flows visually
76
- - [Steps](/steps), [Fields](/fields), [Actions](/actions), [Conditions](/conditions) — Configure the building blocks of experiences
77
- - [SDK Installation](/sdk) — Full SDK setup and configuration
49
+ - **[Integrate the SDK](/how-to/install-the-sdk)** — install, register a component, read
50
+ a feature flag.
51
+ - **[Build a step form](/how-to/render-a-step-form)** — render fields, act on a
52
+ submission, validate input.
53
+ - **[Server-side rendering](/how-to/server-render-a-page)** — a page that a search engine
54
+ can read.
55
+ - **[Authenticate](/how-to/authenticate-with-a-password)** — the management API.
56
+ - **[SDK reference](/reference/sdk)**, **[Delivery API](/reference/delivery-api)**,
57
+ **[PickedQL](/reference/pickedql)**.
58
+ - **[Why it works this way](/explanation/why-server-side-rendering)** — the design
59
+ behind the SDK.
@@ -0,0 +1,53 @@
1
+ ---
2
+ type: reference
3
+ layout: docs
4
+ ---
5
+
6
+ import { Screenshot } from '../../../../components/Screenshot'
7
+
8
+ # Actions
9
+
10
+ An action is a side effect that starts when the flow reaches it. Use an action to
11
+ track an event, to send data to an external service, or to call a webhook.
12
+
13
+ <Screenshot
14
+ route="/{orgSlug}/{projectId}/workspaces/{workspaceId}/actions"
15
+ alt="The actions list for a workspace on the Picked dashboard"
16
+ />
17
+
18
+ ## Set up an action
19
+
20
+ **Name**: The name that the dashboard shows. Your visitors do not see it.
21
+
22
+ **Key**: The identifier that your application uses for this action. Your visitors do
23
+ not see it.
24
+
25
+ ## Register in your application
26
+
27
+ Each action key must match a key in the `actions` object that you pass to
28
+ `createClient()`. See
29
+ [How to register an action handler](/how-to/register-an-action-handler) for the code, and
30
+ [SDK actions](/reference/sdk/actions) for what the handler receives and returns.
31
+
32
+ ## Use actions in flows
33
+
34
+ In the flow builder, drag an action from the library onto the canvas. Connect it to
35
+ the point in the flow where you want it to start.
36
+
37
+ An action runs when the flow reaches its node. It does not interrupt your visitor. By
38
+ default the flow continues to the next connected node.
39
+
40
+ An action node can carry a **success** branch and a **failure** branch. Which one the flow
41
+ takes depends on whether your handler throws, and a returned `false` is a success. See
42
+ [How an action decides which way to go](/explanation/how-picked-works#how-an-action-decides-which-way-to-go).
43
+
44
+ ## Reuse actions
45
+
46
+ An action belongs to the project. Use the same action in more than one experience flow.
47
+ A change to the options of an action applies at every place that uses it.
48
+
49
+ ## Related
50
+
51
+ - [How to add a step, a field, an action, or a condition](/how-to/add-a-step-field-or-action)
52
+ - [How to register an action handler](/how-to/register-an-action-handler)
53
+ - [SDK actions](/reference/sdk/actions) — what the handler receives and returns.
@@ -0,0 +1,37 @@
1
+ ---
2
+ type: reference
3
+ layout: docs
4
+ ---
5
+
6
+ import { Screenshot } from '../../../../components/Screenshot'
7
+
8
+ # API keys
9
+
10
+ An API key lets your code reach the Picked API. Use one for a server-side integration
11
+ or for a CI/CD workflow.
12
+
13
+ <Screenshot
14
+ route="/{orgSlug}/api-keys"
15
+ alt="The API keys list for an organization on the Picked dashboard"
16
+ />
17
+
18
+ ## Use an API key
19
+
20
+ Put your API key in the `Authorization` header of each request to the
21
+ [Picked API](/tutorials/first-api-call).
22
+
23
+ ```
24
+ Authorization: Bearer your-api-key
25
+ ```
26
+
27
+ ## Scopes
28
+
29
+ An API key carries scopes, and the scopes limit what the key can reach. Choose the
30
+ scopes that your integration needs when you create the key. A key can do only the
31
+ operations that its scopes permit.
32
+
33
+ ## Related
34
+
35
+ - [How to create and revoke an API key](/how-to/create-and-revoke-an-api-key)
36
+ - [How to authenticate with an API key](/how-to/authenticate-with-an-api-key) — the API
37
+ side.
@@ -0,0 +1,42 @@
1
+ ---
2
+ type: reference
3
+ layout: docs
4
+ ---
5
+
6
+ import { Screenshot } from '../../../../components/Screenshot'
7
+
8
+ # Conditions
9
+
10
+ A condition evaluates a rule and splits the flow into two paths. One path is for a
11
+ true result, the other for a false result.
12
+
13
+ <Screenshot
14
+ route="/{orgSlug}/{projectId}/workspaces/{workspaceId}/conditions"
15
+ alt="The conditions list for a workspace on the Picked dashboard"
16
+ />
17
+
18
+ ## Set up a condition
19
+
20
+ **Name**: The name that the dashboard shows. Your visitors do not see it.
21
+
22
+ **Key**: The identifier for your application. You set it once and you cannot change
23
+ it. Your visitors do not see it.
24
+
25
+ ## Branches
26
+
27
+ In the flow builder, a condition node has two output handles. The green handle, for a
28
+ true result, leads to the path for a match. The red handle, for a false result, leads
29
+ to the other path.
30
+
31
+ You can chain conditions. Connect the output of one condition to the input of another
32
+ to build a decision tree.
33
+
34
+ ## Related
35
+
36
+ - [How to add a step, a field, an action, or a condition](/how-to/add-a-step-field-or-action)
37
+
38
+ - [About conditions and the logic engine](/explanation/conditions-and-the-logic-engine) —
39
+ what a rule can read.
40
+ - [How to write a condition](/how-to/write-a-condition)
41
+ - [Condition builder](/reference/dashboard/flow-builder/condition-builder) — the data
42
+ sources and the rule structure.
@@ -0,0 +1,63 @@
1
+ ---
2
+ type: reference
3
+ layout: docs
4
+ ---
5
+
6
+ import { Screenshot } from '../../../../../components/Screenshot'
7
+
8
+ # Asset Library
9
+
10
+ The Asset Library holds the files that your content points at. These are images,
11
+ video, documents, and HTML.
12
+
13
+ <Screenshot
14
+ route="/{orgSlug}/{projectId}/assets"
15
+ alt="The asset library on the Picked dashboard"
16
+ />
17
+
18
+ ## Upload and control your assets
19
+
20
+ The Asset Library is a project-level store. Upload a file, then point at it from any
21
+ Content Entry in the project.
22
+
23
+ - **Size limit:** 50 MB for each file.
24
+ - **Allowed types:** an image in PNG, JPEG, WebP, AVIF, GIF, or SVG. A video in MP4
25
+ or WebM. A common document format. HTML, as `text/html`.
26
+
27
+ Picked rejects a file of another type. It also rejects a file above the size limit.
28
+
29
+ ## HTML assets
30
+
31
+ Upload a `.html` file and point at it from an **HTML asset** field. Picked then scans
32
+ the file. The scan is advisory: it helps you, and it never stops you. It
33
+ reports findings about speed, about search rank, and about accessibility, so that you
34
+ can improve the file before you publish it:
35
+
36
+ - **File size:** a warning at 100 KB, and a stronger one at 250 KB.
37
+ - **Inline images:** a note when inline `base64` image data adds about 50 KB or more.
38
+ - **Image dimensions:** an image with no width and no height. Such an image can move
39
+ the content around it while the page loads.
40
+ - **Lazy load:** an image with no `loading="lazy"` attribute.
41
+ - **Link safety:** an external link with `target="_blank"` and no `rel="noopener"`.
42
+ - **Link search rank:** an external link with no `rel="nofollow"`.
43
+ - **Accessibility:** a pass by `axe-core`. It covers alt text, heading order,
44
+ contrast, and more.
45
+
46
+ Every finding is advisory. You can always upload the file as it is.
47
+
48
+ ## How assets are served
49
+
50
+ Picked serves each asset from a sandboxed storage origin. That origin is separate
51
+ from the trusted origin of your application. HTML therefore comes from its own
52
+ origin, so a document that you upload runs in isolation and cannot reach the page
53
+ that holds it. A script in that document cannot read a session, a token, or the DOM
54
+ around it, because each of those needs same-origin access.
55
+
56
+ An [Experience Content](/reference/delivery-api/experience-content) response can hold an HTML
57
+ asset. The response then carries the content of that asset, and the SDK renders it
58
+ with no second request to storage.
59
+
60
+ ## Related
61
+
62
+ - [How to upload and use an asset](/how-to/upload-and-use-an-asset)
63
+ - [Fields](/reference/dashboard/fields) — the field type for an HTML asset.
@@ -0,0 +1,44 @@
1
+ ---
2
+ type: reference
3
+ layout: docs
4
+ ---
5
+
6
+ import { Screenshot } from '../../../../../components/Screenshot'
7
+
8
+ # Content Entries
9
+
10
+ A Content Entry is an instance of a layout filled with real data. A Page renders one entry; a Flow Step can render one too.
11
+
12
+ <Screenshot
13
+ route="/{orgSlug}/{projectId}/workspaces/{workspaceId}/content"
14
+ alt="The content entries list on the Picked dashboard"
15
+ />
16
+
17
+ ## What a content entry is
18
+
19
+ A Content Entry is an instance of a layout's schema. The [layout](/reference/dashboard/content/layouts) defines the fields; the entry holds the actual values. One layout can back many entries, each with its own data.
20
+
21
+ ## How entries bind to pages and steps
22
+
23
+ A [Page](/reference/dashboard/content/pages) has a single Step, and that Step links to its entry through the layout content link. A Flow [Step](/reference/dashboard/steps) backed by a Step Layout binds an entry the same way. When the SDK renders the Page or Step, it resolves the linked entry and hands its data to your component.
24
+
25
+ ## Edit entry data
26
+
27
+ The entry editor renders a form from the layout schema. There is one input for each
28
+ field, in the order that the schema sets. A repeatable field appears as a sortable
29
+ list. You can add to that list and put it into a new order. A group field holds its
30
+ inputs under one heading.
31
+
32
+ ## Validation
33
+
34
+ Invalid data appears as an error on each field. The error carries a path in the JSON
35
+ style, and it points at the exact place in the entry, for example
36
+ `sections[0].data.title`. Fix every error before you publish, because Picked serves
37
+ valid content only.
38
+
39
+ ## Related
40
+
41
+ - [About the content model](/explanation/the-content-model) — why the schema and the data
42
+ are separate.
43
+ - [How to fill and publish a page](/how-to/fill-and-publish-a-page)
44
+ - [Page and step layouts](/reference/dashboard/content/layouts)
@@ -0,0 +1,62 @@
1
+ ---
2
+ type: reference
3
+ layout: docs
4
+ ---
5
+
6
+ import { Screenshot } from '../../../../../components/Screenshot'
7
+
8
+ # Page & Step Layouts
9
+
10
+ Layouts are reusable JSON schemas. Page Layouts back standalone Pages; Step Layouts back individual Steps inside a Flow.
11
+
12
+ <Screenshot
13
+ route="/{orgSlug}/{projectId}/workspaces/{workspaceId}/models"
14
+ alt="The layouts list in the schema builder on the Picked dashboard"
15
+ />
16
+
17
+ ## A page layout and a step layout
18
+
19
+ Each layout has a fixed category, and the category decides what the layout gives its
20
+ shape to:
21
+
22
+ | Layout | It gives its shape to | Who renders it |
23
+ | --- | --- | --- |
24
+ | **Page Layout** | A standalone [Page](/reference/dashboard/content/pages). | The SDK renders the entry on your server. |
25
+ | **Step Layout** | One [Step](/reference/dashboard/steps) inside a Flow. | The Step renders the entry in the browser. |
26
+
27
+ ## Field types
28
+
29
+ A layout is built from fields. Each field has a type that decides its editor and the shape of the value it stores.
30
+
31
+ | Type | Stores | Use it for |
32
+ | --- | --- | --- |
33
+ | **Single-line text** | A short string. | A title, a label, or a short headline. |
34
+ | **Multi-line text** | A longer plain string. | A description, or a paragraph with no format marks. |
35
+ | **Markdown** | A Markdown string. | Body copy with format marks. |
36
+ | **Slug** | A URL-safe string. | A part of a path, or an identifier. |
37
+ | **Number** | A numeric value. | A price, a count, or a rating. |
38
+ | **Boolean** | A true or false value. | A toggle or a flag. |
39
+ | **Date** | A date value. | A publish date or a deadline. |
40
+ | **Color** | A color value. | A theme accent or a swatch. |
41
+ | **JSON** | Any JSON value. | Structured data with no editor of its own. |
42
+ | **Group** | An object of fields inside the layout. | A set of related fields, held together. |
43
+ | **Section** | A [Section](/reference/dashboard/content/sections) schema inside the layout. | A shared schema fragment that you reuse. |
44
+ | **Asset** | A link to an [Asset Library](/reference/dashboard/content/asset-library) item. | An image, a video, or a document. |
45
+ | **HTML asset** | A link to a `.html` file in your library. | HTML that you wrote before, held inside the content. |
46
+
47
+ ## Repeatable and grouped fields
48
+
49
+ You can make any field **repeatable**. It then renders as a sortable list of values,
50
+ and not as one value. Use it for a gallery, for a list of features, or for any
51
+ collection.
52
+
53
+ A **Group** field holds a set of fields under one key, and it gives a structured
54
+ object. Make a group repeatable to describe a list of objects, such as a list of
55
+ feature cards.
56
+
57
+ ## Related
58
+
59
+ - [About the content model](/explanation/the-content-model) — why a schema change does not
60
+ migrate your data.
61
+ - [How to define a page layout](/how-to/define-a-page-layout)
62
+ - [How to reuse a section](/how-to/reuse-a-section)