@picked/client 0.0.1-dev.1788925875333 → 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 (439) 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 +733 -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 -152
  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 +1 -1
  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 +1 -1
  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 +1 -1
  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-DbMJli3H.js +0 -22
  137. package/dist/api-qiqq8lgz.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 -34
  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-DGk11d8a.js +0 -563
  284. package/dist/experience-instance-Dej3P1sE.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-BcLaCLm1.cjs +0 -1
  294. package/dist/plugin-De_BJSwE.js +0 -194
  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-C_9u0yGJ.cjs +0 -1
  300. package/dist/provider-ovM-CBX_.js +0 -98
  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/picked-config.d.ts +0 -39
  425. package/dist/types/utils/picked-config.d.ts.map +0 -1
  426. package/dist/types/utils/preview-session.d.ts +0 -12
  427. package/dist/types/utils/preview-session.d.ts.map +0 -1
  428. package/dist/types/utils/rehydrate-scripts.d.ts +0 -50
  429. package/dist/types/utils/rehydrate-scripts.d.ts.map +0 -1
  430. package/dist/types/utils/render-string.d.ts +0 -24
  431. package/dist/types/utils/render-string.d.ts.map +0 -1
  432. package/dist/types/utils/user-timing.d.ts +0 -21
  433. package/dist/types/utils/user-timing.d.ts.map +0 -1
  434. package/dist/version-BvLZaTMC.cjs +0 -1
  435. package/dist/version-VvasRUfR.js +0 -256
  436. /package/dist/types/plugins/{experience-browser-storage → experience-browserstorage-plugin}/index.d.ts +0 -0
  437. /package/dist/types/plugins/{history-browser-storage → history-browserstorage-plugin}/index.d.ts +0 -0
  438. /package/dist/types/plugins/{responses-browser-storage → responses-browserstorage-plugin}/index.d.ts +0 -0
  439. /package/dist/types/plugins/{responses-indexeddb → responses-indexeddb-plugin}/index.d.ts +0 -0
@@ -1,81 +0,0 @@
1
- ---
2
- type: how-to
3
- layout: docs
4
- ---
5
-
6
- # How to server-render a page
7
-
8
- This guide shows you how to render a Picked Page on your server and hydrate it in the
9
- browser. You need a published Page and a server that renders React or Svelte.
10
-
11
- ## 1. Make the snapshot
12
-
13
- Create one client for each request, then call `serialize()`:
14
-
15
- ```ts
16
- import { createClient } from 'picked'
17
- import { serialize } from '@picked/client/server'
18
-
19
- const client = createClient(options)
20
-
21
- const snapshot = await serialize(client, {
22
- projectConfig,
23
- attributes: { location: { pathname: url.pathname } },
24
- })
25
- ```
26
-
27
- :::warning
28
- Give `serialize()` one client for each request. It does not support two calls at the same
29
- time on one client.
30
- :::
31
-
32
- ## 2. Embed the snapshot
33
-
34
- ```ts
35
- const html = `
36
- <div id="root">${appHtml}</div>
37
- <script>window.__PICKED__ = ${JSON.stringify(snapshot)}</script>
38
- `
39
- ```
40
-
41
- ## 3. Seed the client and render the slot
42
-
43
- :::code-group
44
-
45
- ```tsx [React]
46
- import { PickedProvider, ExperienceSlot } from '@picked/react'
47
-
48
- export function Page({ snapshot }) {
49
- return (
50
- <PickedProvider options={options} snapshot={snapshot}>
51
- <ExperienceSlot name="page" />
52
- </PickedProvider>
53
- )
54
- }
55
- ```
56
-
57
- ```svelte [Svelte]
58
- <script lang="ts">
59
- import { ExperienceSlot, setPickedContext } from '@picked/svelte'
60
-
61
- const { snapshot } = $props()
62
- setPickedContext({ options, snapshot })
63
- </script>
64
-
65
- <ExperienceSlot name="page" />
66
- ```
67
-
68
- :::
69
-
70
- The provider seeds the client at once, so the server HTML and the first paint match.
71
-
72
- ## 4. Point the experience at the slot
73
-
74
- Set the target selector of your Page experience to `.picked-slot-page`, then publish.
75
-
76
- ## Related
77
-
78
- - [About server-side rendering](/explanation/why-server-side-rendering) — why the
79
- snapshot carries condition results.
80
- - [Server snapshot](/reference/sdk/ssr/serialize) — every parameter.
81
- - [Your first server-rendered page](/tutorials/first-server-rendered-page).
@@ -1,32 +0,0 @@
1
- ---
2
- type: how-to
3
- layout: docs
4
- ---
5
-
6
- # How to set a Content Security Policy
7
-
8
- This guide shows you how to let the Picked SDK load its resources under a CSP.
9
-
10
- ## Steps
11
-
12
- Add the Picked domains to your policy.
13
-
14
- As an HTTP header:
15
-
16
- ```
17
- Content-Security-Policy: connect-src 'self' https://api.picked.app https://evnts.pckd.dev; img-src 'self' https://img.picked-content.com;
18
- ```
19
-
20
- Or as a `<meta>` tag:
21
-
22
- ```html
23
- <meta
24
- http-equiv="Content-Security-Policy"
25
- content="connect-src 'self' https://api.picked.app https://evnts.pckd.dev; img-src 'self' https://img.picked-content.com;"
26
- />
27
- ```
28
-
29
- ## Related
30
-
31
- - [Content Security Policy](/reference/sdk/content-security-policy) — what each domain is
32
- for.
@@ -1,69 +0,0 @@
1
- ---
2
- type: how-to
3
- layout: docs
4
- ---
5
-
6
- # How to set up MFA
7
-
8
- This guide shows you how to add a second factor to an account. Every MFA mutation needs
9
- authentication.
10
-
11
- ## 1. Add a factor
12
-
13
- ```graphql
14
- mutation {
15
- mfaFactorEnroll(input: {
16
- factorType: PHONE
17
- phone: "+15551234567"
18
- friendlyName: "My Phone"
19
- }) {
20
- factor { id factorType status }
21
- }
22
- }
23
- ```
24
-
25
- A new factor has the status `UNVERIFIED`.
26
-
27
- ## 2. Send a challenge
28
-
29
- ```graphql
30
- mutation {
31
- mfaChallengeSend(input: { factorId: "factor-id" }) {
32
- challengeId
33
- }
34
- }
35
- ```
36
-
37
- This sends a code to the telephone number of the factor.
38
-
39
- ## 3. Verify the challenge
40
-
41
- ```graphql
42
- mutation {
43
- mfaChallengeVerify(input: {
44
- factorId: "factor-id"
45
- challengeId: "challenge-id"
46
- code: "123456"
47
- }) {
48
- session { accessToken refreshToken aal }
49
- }
50
- }
51
- ```
52
-
53
- The session moves to `AAL2`, and the factor status changes to `VERIFIED`.
54
-
55
- ## Remove a factor
56
-
57
- ```graphql
58
- mutation {
59
- mfaFactorUnenroll(input: { factorId: "factor-id" }) {
60
- success
61
- }
62
- }
63
- ```
64
-
65
- ## Related
66
-
67
- - [Authorization and scopes](/reference/management-api/authorization-and-scopes) — which
68
- operations need `AAL2`.
69
- - [Authentication](/reference/management-api/authentication) — every mutation.
@@ -1,122 +0,0 @@
1
- ---
2
- type: how-to
3
- layout: docs
4
- ---
5
-
6
- # How to switch workspaces
7
-
8
- This guide shows you how to point your local tooling at a different project or workspace.
9
- Your application then renders that workspace's content and types on your machine. It expects
10
- a `picked.config.ts` and the [CLI](/reference/tools/cli).
11
-
12
- Your tooling reads the project and surface named in the committed `picked.config.ts`. The
13
- CLI writes your choice to `.picked/settings.json` instead. That file is per-developer and
14
- Git ignores it, so the committed default stays as it is and one command puts it back.
15
-
16
- See [Workspaces](/reference/dashboard/workspaces) for what Live, Draft, and Archived mean.
17
-
18
- ## 1. Sign in
19
-
20
- ```bash
21
- picked login
22
- ```
23
-
24
- This opens your browser for a one-time OAuth sign-in and stores a session under
25
- `~/.picked/`. Confirm it with `picked whoami`. See
26
- [CLI authentication](/how-to/authenticate-the-cli).
27
-
28
- ## 2. Find a workspace
29
-
30
- ```bash
31
- picked workspace list
32
- ```
33
-
34
- ```
35
- Acme Corp. (acme-corporation)
36
- Storefront [proj_a1b2]
37
- Default Storefront [LIVE] (live)
38
- Checkout rework [DRAFT]
39
- ```
40
-
41
- Note the **project id** (`proj_a1b2`) and the name or the id of the workspace you want.
42
-
43
- ## 3. Switch to the draft
44
-
45
- ```bash
46
- picked workspace use --project proj_a1b2 --workspace ws_draft
47
- ```
48
-
49
- ```
50
- Active workspace: Checkout rework [DRAFT] in project proj_a1b2 (source: preview)
51
- Generated types at /app/src/picked-env.d.ts
52
- ```
53
-
54
- A command that names **one specific workspace** (draft, live, or archived):
55
-
56
- - writes the selection (and its [preview token](/reference/delivery-api/preview-caching-crawling)) to
57
- `.picked/settings.json`,
58
- - switches the resolved `source` to `preview` for that project, and
59
- - regenerates `picked-env.d.ts` from that workspace's schema (skip with `--no-generate`).
60
-
61
- To browse instead, run `picked workspace use` with no flags. The interactive picker lists
62
- every project, with **Published (live version)** and each of its workspaces.
63
-
64
- ## 4. See the draft in your app
65
-
66
- Both readers of the selection use `.picked/settings.json` with no change to your
67
- configuration:
68
-
69
- - **Type generation** now reads the draft schema. Rerun `picked generate types` after more
70
- edits.
71
- - The **[Vite plugin](/reference/tools/vite-plugin)** reads the draft's configuration and
72
- content in development and in a build. It sends the preview token to the
73
- [Delivery API](/reference/delivery-api). Restart the dev server to apply a switch.
74
-
75
- Your application renders the unpublished draft on your machine, with types.
76
-
77
- ## 5. Switch back to live
78
-
79
- ```bash
80
- picked workspace use --project proj_a1b2
81
- ```
82
-
83
- A command that names a project with no `--workspace`, or **Published (live version)** in the
84
- picker, discards the preview token and returns `source` to `published`. To confirm what is
85
- active:
86
-
87
- ```bash
88
- picked status
89
- ```
90
-
91
- ```
92
- Config default: project proj_a1b2 (source: published)
93
- Active selection: none (using the config default).
94
- ```
95
-
96
- ## CI and headless runs
97
-
98
- `.picked/settings.json` is a local, per-developer file. Do not commit it. To choose one
99
- workspace in CI with no selection file, set the environment directly:
100
-
101
- ```bash
102
- PICKED_PROJECT_ID=proj_a1b2 \
103
- PICKED_PREVIEW_TOKEN="$DRAFT_TOKEN" \
104
- picked generate types --check
105
- ```
106
-
107
- `PICKED_PREVIEW_TOKEN` applies only when the resolved `source` is `preview`. See the
108
- [CLI environment variables](/reference/tools/cli#environment-variables) for the full
109
- precedence order.
110
-
111
- :::note
112
- A preview token is a long-lived credential for one workspace. Keep it out of the version
113
- control system, as you do with each other credential. Git ignores `.picked/settings.json`
114
- for this reason, because `picked workspace use` writes a token there.
115
- :::
116
-
117
- ## Related
118
-
119
- - [CLI](/reference/tools/cli) — every command and flag.
120
- - [Workspaces](/reference/dashboard/workspaces) — Live, Draft, and Archived states.
121
- - [Type generation](/reference/sdk/type-generation) — how the schema becomes types.
122
- - [Preview, cache, and crawlers](/reference/delivery-api/preview-caching-crawling) — preview tokens on the Delivery API.
@@ -1,73 +0,0 @@
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.
@@ -1,52 +0,0 @@
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.
@@ -1,45 +0,0 @@
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.
@@ -1,60 +0,0 @@
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'
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,59 +0,0 @@
1
- ---
2
- type: map
3
- layout: docs
4
- ---
5
-
6
- # Picked documentation
7
-
8
- Picked lets you build personalized UI flows in a visual editor. The SDK then serves them
9
- to the visitors on your site.
10
-
11
- There are two paths to follow. Choose the one that matches your work.
12
-
13
- ## Work in the dashboard
14
-
15
- Build experiences, write content, and publish.
16
-
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.
20
-
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.
23
-
24
- Then:
25
-
26
- - **[Build](/how-to/create-an-experience)** — experiences, flows, conditions, and A/B
27
- tests.
28
- - **[Content](/how-to/define-a-page-layout)** — Models, Blocks, entries, 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.
35
-
36
- ## Integrate with code
37
-
38
- Add Picked to a site or an application. Your code then renders the experiences that the
39
- dashboard describes.
40
-
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.
43
-
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.
46
-
47
- Then:
48
-
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.
@@ -1,53 +0,0 @@
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.
@@ -1,38 +0,0 @@
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 where your own code calls the API,
11
- such as a server-side integration. It does not sign the
12
- [CLI](/reference/tools/cli) in.
13
-
14
- <Screenshot
15
- route="/{orgSlug}/api-keys"
16
- alt="The API keys list for an organization on the Picked dashboard"
17
- />
18
-
19
- ## Use an API key
20
-
21
- Put your API key in the `x-api-key` header of each request to the
22
- [Picked API](/tutorials/first-api-call).
23
-
24
- ```
25
- x-api-key: your-api-key
26
- ```
27
-
28
- ## Scopes
29
-
30
- An API key carries scopes, and the scopes limit what the key can reach. Choose the
31
- scopes that your integration needs when you create the key. A key can do only the
32
- operations that its scopes permit.
33
-
34
- ## Related
35
-
36
- - [How to create and revoke an API key](/how-to/create-and-revoke-an-api-key)
37
- - [How to authenticate with an API key](/how-to/authenticate-with-an-api-key) — the API
38
- side.