@picked/client 0.0.1-dev.1789541668638 → 0.0.1-next.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (443) hide show
  1. package/README.md +8 -0
  2. package/dist/cjs/index.js +1 -4
  3. package/dist/cjs/plugins/create-experience/index.js +1 -1
  4. package/dist/cjs/plugins/experience-browserstorage-plugin/index.js +1 -0
  5. package/dist/cjs/plugins/history-browserstorage-plugin/index.js +1 -0
  6. package/dist/cjs/plugins/responses-browserstorage-plugin/index.js +1 -0
  7. package/dist/cjs/plugins/responses-indexeddb-plugin/index.js +1 -0
  8. package/dist/cjs/plugins/shopify/index.js +1 -0
  9. package/dist/cjs/plugins/single-page-app/index.js +1 -1
  10. package/dist/cjs/plugins/window-object/index.js +1 -1
  11. package/dist/cjs/server/index.js +1 -1
  12. package/dist/esm/index.js +739 -1814
  13. package/dist/esm/plugins/create-experience/index.js +398 -490
  14. package/dist/esm/plugins/experience-browserstorage-plugin/index.js +38 -0
  15. package/dist/esm/plugins/history-browserstorage-plugin/index.js +26 -0
  16. package/dist/esm/plugins/responses-browserstorage-plugin/index.js +36 -0
  17. package/dist/esm/plugins/responses-indexeddb-plugin/index.js +101 -0
  18. package/dist/esm/plugins/shopify/index.js +59 -0
  19. package/dist/esm/plugins/single-page-app/index.js +35 -31
  20. package/dist/esm/plugins/window-object/index.js +9 -9
  21. package/dist/esm/server/index.js +89 -141
  22. package/dist/experience-instance-6ZKZS7dF.cjs +1 -0
  23. package/dist/experience-instance-BA0EXYg5.js +712 -0
  24. package/dist/id-BKIWbSTy.cjs +1 -0
  25. package/dist/id-BW-g3y32.js +6 -0
  26. package/dist/logger-BsmHUUw1.cjs +1 -0
  27. package/dist/logger-C9a75KZn.js +5 -0
  28. package/dist/object-BbFTsGh3.cjs +1 -0
  29. package/dist/object-JwZ58NOH.js +28 -0
  30. package/dist/storage-BPJwmlva.cjs +1 -0
  31. package/dist/storage-D87xFySf.js +85 -0
  32. package/dist/supports-BvrzQAVk.js +79 -0
  33. package/dist/supports-C0y3-V5V.cjs +1 -0
  34. package/dist/types/client.d.ts +23 -119
  35. package/dist/types/client.d.ts.map +1 -1
  36. package/dist/types/entities/component/component.d.ts +6 -45
  37. package/dist/types/entities/component/component.d.ts.map +1 -1
  38. package/dist/types/entities/experience/experience.d.ts +99 -160
  39. package/dist/types/entities/experience/experience.d.ts.map +1 -1
  40. package/dist/types/entities/experience-instance/experience-instance.d.ts +113 -83
  41. package/dist/types/entities/experience-instance/experience-instance.d.ts.map +1 -1
  42. package/dist/types/entities/feature/feature.d.ts +8 -118
  43. package/dist/types/entities/feature/feature.d.ts.map +1 -1
  44. package/dist/types/entities/field/field.d.ts +64 -96
  45. package/dist/types/entities/field/field.d.ts.map +1 -1
  46. package/dist/types/entities/framework/framework.d.ts +7 -32
  47. package/dist/types/entities/framework/framework.d.ts.map +1 -1
  48. package/dist/types/entities/history/history.d.ts +6 -6
  49. package/dist/types/entities/history/history.d.ts.map +1 -1
  50. package/dist/types/entities/plugin/plugin.d.ts +2 -41
  51. package/dist/types/entities/plugin/plugin.d.ts.map +1 -1
  52. package/dist/types/entities/predicate/predicate.d.ts +7 -30
  53. package/dist/types/entities/predicate/predicate.d.ts.map +1 -1
  54. package/dist/types/entities/project/project.d.ts +9 -0
  55. package/dist/types/entities/project/project.d.ts.map +1 -0
  56. package/dist/types/entities/response/response.d.ts +21 -57
  57. package/dist/types/entities/response/response.d.ts.map +1 -1
  58. package/dist/types/exports.d.ts +4 -22
  59. package/dist/types/exports.d.ts.map +1 -1
  60. package/dist/types/index.d.ts +3 -12
  61. package/dist/types/index.d.ts.map +1 -1
  62. package/dist/types/logic-engine.d.ts +11 -13
  63. package/dist/types/logic-engine.d.ts.map +1 -1
  64. package/dist/types/picked.d.ts +184 -381
  65. package/dist/types/picked.d.ts.map +1 -1
  66. package/dist/types/ping.d.ts +10 -0
  67. package/dist/types/ping.d.ts.map +1 -0
  68. package/dist/types/plugins/create-experience/create-experience.d.ts +44 -119
  69. package/dist/types/plugins/create-experience/create-experience.d.ts.map +1 -1
  70. package/dist/types/plugins/create-experience/index.d.ts +2 -2
  71. package/dist/types/plugins/create-experience/index.d.ts.map +1 -1
  72. package/dist/types/plugins/create-experience/plugin.d.ts +2 -3
  73. package/dist/types/plugins/create-experience/plugin.d.ts.map +1 -1
  74. package/dist/types/plugins/create-experience/serialization.d.ts.map +1 -1
  75. package/dist/types/plugins/experience-browserstorage-plugin/index.d.ts.map +1 -0
  76. package/dist/types/plugins/experience-browserstorage-plugin/plugin.d.ts +6 -0
  77. package/dist/types/plugins/experience-browserstorage-plugin/plugin.d.ts.map +1 -0
  78. package/dist/types/plugins/history-browserstorage-plugin/index.d.ts.map +1 -0
  79. package/dist/types/plugins/{history-browser-storage → history-browserstorage-plugin}/plugin.d.ts +1 -2
  80. package/dist/types/plugins/history-browserstorage-plugin/plugin.d.ts.map +1 -0
  81. package/dist/types/plugins/responses-browserstorage-plugin/index.d.ts.map +1 -0
  82. package/dist/types/plugins/responses-browserstorage-plugin/plugin.d.ts +6 -0
  83. package/dist/types/plugins/responses-browserstorage-plugin/plugin.d.ts.map +1 -0
  84. package/dist/types/plugins/responses-indexeddb-plugin/index.d.ts.map +1 -0
  85. package/dist/types/plugins/responses-indexeddb-plugin/plugin.d.ts +3 -0
  86. package/dist/types/plugins/responses-indexeddb-plugin/plugin.d.ts.map +1 -0
  87. package/dist/types/plugins/shopify/index.d.ts +2 -0
  88. package/dist/types/plugins/shopify/index.d.ts.map +1 -0
  89. package/dist/types/plugins/shopify/plugin.d.ts +3 -0
  90. package/dist/types/plugins/shopify/plugin.d.ts.map +1 -0
  91. package/dist/types/plugins/shopify/shopify.d.ts +28 -0
  92. package/dist/types/plugins/shopify/shopify.d.ts.map +1 -0
  93. package/dist/types/plugins/single-page-app/plugin.d.ts +2 -2
  94. package/dist/types/plugins/single-page-app/plugin.d.ts.map +1 -1
  95. package/dist/types/plugins/window-object/plugin.d.ts +2 -2
  96. package/dist/types/server/index.d.ts +3 -18
  97. package/dist/types/server/index.d.ts.map +1 -1
  98. package/dist/types/utils/dom.d.ts +6 -4
  99. package/dist/types/utils/dom.d.ts.map +1 -1
  100. package/dist/types/utils/events.d.ts +38 -83
  101. package/dist/types/utils/events.d.ts.map +1 -1
  102. package/dist/types/utils/global-obj.d.ts +2 -1
  103. package/dist/types/utils/global-obj.d.ts.map +1 -1
  104. package/dist/types/utils/id.d.ts.map +1 -1
  105. package/dist/types/utils/indexed-db.d.ts +1 -2
  106. package/dist/types/utils/indexed-db.d.ts.map +1 -1
  107. package/dist/types/utils/logger.d.ts +1 -2
  108. package/dist/types/utils/logger.d.ts.map +1 -1
  109. package/dist/types/utils/node-tree/get-next-node-from-conditional.d.ts +3 -0
  110. package/dist/types/utils/node-tree/get-next-node-from-conditional.d.ts.map +1 -0
  111. package/dist/types/utils/node-tree/get-next-node.d.ts +1 -1
  112. package/dist/types/utils/node-tree/get-next-node.d.ts.map +1 -1
  113. package/dist/types/utils/node-tree/get-origin-node.d.ts +1 -1
  114. package/dist/types/utils/node-tree/get-origin-node.d.ts.map +1 -1
  115. package/dist/types/utils/node-tree/min-max-steps-to-leaf.d.ts +7 -17
  116. package/dist/types/utils/node-tree/min-max-steps-to-leaf.d.ts.map +1 -1
  117. package/dist/types/utils/node-tree/min-max-steps-to-origin.d.ts +8 -19
  118. package/dist/types/utils/node-tree/min-max-steps-to-origin.d.ts.map +1 -1
  119. package/dist/types/utils/node-tree/next-reachable-step-nodes.d.ts +7 -31
  120. package/dist/types/utils/node-tree/next-reachable-step-nodes.d.ts.map +1 -1
  121. package/dist/types/utils/nodes.d.ts +2 -3
  122. package/dist/types/utils/nodes.d.ts.map +1 -1
  123. package/dist/types/utils/object.d.ts +8 -0
  124. package/dist/types/utils/object.d.ts.map +1 -1
  125. package/dist/types/utils/rules-logic.d.ts +3 -33
  126. package/dist/types/utils/rules-logic.d.ts.map +1 -1
  127. package/dist/types/utils/search-params.d.ts.map +1 -1
  128. package/dist/types/utils/state-snaphot.d.ts +16 -0
  129. package/dist/types/utils/state-snaphot.d.ts.map +1 -0
  130. package/dist/types/utils/storage.d.ts +11 -374
  131. package/dist/types/utils/storage.d.ts.map +1 -1
  132. package/dist/types/utils/supports.d.ts +0 -87
  133. package/dist/types/utils/supports.d.ts.map +1 -1
  134. package/package.json +49 -182
  135. package/dist/.tsbuildinfo +0 -1
  136. package/dist/api-C7q_7vxn.js +0 -22
  137. package/dist/api-Ctvh1qkk.cjs +0 -1
  138. package/dist/cjs/form/index.js +0 -1
  139. package/dist/cjs/plugins/dom-observer/index.js +0 -1
  140. package/dist/cjs/plugins/dynamic-experiences/index.js +0 -1
  141. package/dist/cjs/plugins/experience-browser-storage/index.js +0 -1
  142. package/dist/cjs/plugins/history-browser-storage/index.js +0 -1
  143. package/dist/cjs/plugins/responses-browser-storage/index.js +0 -1
  144. package/dist/cjs/plugins/responses-indexeddb/index.js +0 -1
  145. package/dist/cjs/plugins/telemetry/index.js +0 -1
  146. package/dist/cjs/plugins/web-components/index.js +0 -1
  147. package/dist/cjs/preview/index.js +0 -1
  148. package/dist/docs/_root.css +0 -101
  149. package/dist/docs/explanation/conditions-and-the-logic-engine.md +0 -94
  150. package/dist/docs/explanation/content-references.md +0 -99
  151. package/dist/docs/explanation/feature-flag-allocation.md +0 -218
  152. package/dist/docs/explanation/how-picked-works.md +0 -124
  153. package/dist/docs/explanation/how-pickedql-works.md +0 -76
  154. package/dist/docs/explanation/pages-and-flows.md +0 -64
  155. package/dist/docs/explanation/the-content-model.md +0 -87
  156. package/dist/docs/explanation/the-two-apis.md +0 -68
  157. package/dist/docs/explanation/why-server-side-rendering.md +0 -76
  158. package/dist/docs/explanation/workspaces-and-versions.md +0 -71
  159. package/dist/docs/how-to/add-a-step-field-or-action.md +0 -43
  160. package/dist/docs/how-to/analytics/index.md +0 -316
  161. package/dist/docs/how-to/archive-or-delete-a-workspace.md +0 -46
  162. package/dist/docs/how-to/authenticate-the-cli.md +0 -97
  163. package/dist/docs/how-to/authenticate-with-a-magic-link.md +0 -40
  164. package/dist/docs/how-to/authenticate-with-a-password.md +0 -51
  165. package/dist/docs/how-to/authenticate-with-an-api-key.md +0 -51
  166. package/dist/docs/how-to/authenticate-with-oauth.md +0 -40
  167. package/dist/docs/how-to/build-a-flow.md +0 -83
  168. package/dist/docs/how-to/connect-the-mcp-server.md +0 -38
  169. package/dist/docs/how-to/create-a-content-entry.md +0 -48
  170. package/dist/docs/how-to/create-a-project.md +0 -29
  171. package/dist/docs/how-to/create-an-experience.md +0 -42
  172. package/dist/docs/how-to/create-and-revoke-an-api-key.md +0 -42
  173. package/dist/docs/how-to/debug-with-the-chrome-extension.md +0 -57
  174. package/dist/docs/how-to/define-a-page-layout.md +0 -46
  175. package/dist/docs/how-to/fill-and-publish-a-page.md +0 -66
  176. package/dist/docs/how-to/install-the-gtm-template.md +0 -84
  177. package/dist/docs/how-to/install-the-sdk.md +0 -93
  178. package/dist/docs/how-to/install-the-vite-plugin.md +0 -69
  179. package/dist/docs/how-to/invite-and-remove-members.md +0 -35
  180. package/dist/docs/how-to/point-one-entry-at-another.md +0 -61
  181. package/dist/docs/how-to/preview-a-workspace.md +0 -28
  182. package/dist/docs/how-to/publish-a-workspace.md +0 -30
  183. package/dist/docs/how-to/read-a-feature-flag.md +0 -113
  184. package/dist/docs/how-to/read-a-referenced-entry.md +0 -109
  185. package/dist/docs/how-to/register-a-component.md +0 -55
  186. package/dist/docs/how-to/register-an-action-handler.md +0 -67
  187. package/dist/docs/how-to/render-a-step-form.md +0 -131
  188. package/dist/docs/how-to/render-an-unpublished-preview.md +0 -41
  189. package/dist/docs/how-to/reuse-a-section.md +0 -53
  190. package/dist/docs/how-to/reuse-a-step-field-or-action.md +0 -28
  191. package/dist/docs/how-to/roll-back-a-published-version.md +0 -26
  192. package/dist/docs/how-to/run-an-ab-test.md +0 -49
  193. package/dist/docs/how-to/run-code-on-a-form-submission.md +0 -125
  194. package/dist/docs/how-to/server-render-a-page.md +0 -81
  195. package/dist/docs/how-to/set-a-content-security-policy.md +0 -32
  196. package/dist/docs/how-to/set-up-mfa.md +0 -69
  197. package/dist/docs/how-to/switch-workspaces.md +0 -122
  198. package/dist/docs/how-to/upload-and-use-an-asset.mdx +0 -73
  199. package/dist/docs/how-to/validate-a-field.md +0 -52
  200. package/dist/docs/how-to/write-a-condition.md +0 -45
  201. package/dist/docs/how-to/write-a-predicate.md +0 -60
  202. package/dist/docs/index.md +0 -59
  203. package/dist/docs/reference/dashboard/actions.mdx +0 -53
  204. package/dist/docs/reference/dashboard/api-keys.mdx +0 -38
  205. package/dist/docs/reference/dashboard/conditions.mdx +0 -42
  206. package/dist/docs/reference/dashboard/content/asset-library.mdx +0 -63
  207. package/dist/docs/reference/dashboard/content/blocks.mdx +0 -57
  208. package/dist/docs/reference/dashboard/content/content-entries.mdx +0 -95
  209. package/dist/docs/reference/dashboard/content/models.mdx +0 -108
  210. package/dist/docs/reference/dashboard/content/pages.mdx +0 -61
  211. package/dist/docs/reference/dashboard/experiences.mdx +0 -51
  212. package/dist/docs/reference/dashboard/features.mdx +0 -154
  213. package/dist/docs/reference/dashboard/fields.mdx +0 -106
  214. package/dist/docs/reference/dashboard/flow-builder/canvas.mdx +0 -58
  215. package/dist/docs/reference/dashboard/flow-builder/condition-builder.md +0 -57
  216. package/dist/docs/reference/dashboard/flow-builder/keyboard-shortcuts.md +0 -72
  217. package/dist/docs/reference/dashboard/flow-builder/nodes.md +0 -63
  218. package/dist/docs/reference/dashboard/projects.mdx +0 -44
  219. package/dist/docs/reference/dashboard/reports.mdx +0 -43
  220. package/dist/docs/reference/dashboard/steps.mdx +0 -37
  221. package/dist/docs/reference/dashboard/team-management.md +0 -29
  222. package/dist/docs/reference/dashboard/workspace-versioning.mdx +0 -30
  223. package/dist/docs/reference/dashboard/workspaces.mdx +0 -76
  224. package/dist/docs/reference/delivery-api/experience-content.md +0 -152
  225. package/dist/docs/reference/delivery-api/index.md +0 -45
  226. package/dist/docs/reference/delivery-api/preview-caching-crawling.md +0 -79
  227. package/dist/docs/reference/delivery-api/project-config.md +0 -65
  228. package/dist/docs/reference/delivery-api/workspace-schema.md +0 -85
  229. package/dist/docs/reference/glossary.md +0 -181
  230. package/dist/docs/reference/management-api/authentication.md +0 -74
  231. package/dist/docs/reference/management-api/authorization-and-scopes.md +0 -285
  232. package/dist/docs/reference/management-api/error-handling.md +0 -233
  233. package/dist/docs/reference/management-api/pagination.md +0 -192
  234. package/dist/docs/reference/pickedql/data-sources.md +0 -174
  235. package/dist/docs/reference/pickedql/dimensions.md +0 -103
  236. package/dist/docs/reference/pickedql/filtering.md +0 -64
  237. package/dist/docs/reference/pickedql/index.md +0 -18
  238. package/dist/docs/reference/pickedql/schema.md +0 -172
  239. package/dist/docs/reference/pickedql/virtual-functions.md +0 -248
  240. package/dist/docs/reference/sdk/actions.md +0 -30
  241. package/dist/docs/reference/sdk/analytics-events.md +0 -445
  242. package/dist/docs/reference/sdk/conditions.md +0 -147
  243. package/dist/docs/reference/sdk/content-security-policy.md +0 -21
  244. package/dist/docs/reference/sdk/content.md +0 -213
  245. package/dist/docs/reference/sdk/experiences.md +0 -51
  246. package/dist/docs/reference/sdk/features.md +0 -256
  247. package/dist/docs/reference/sdk/fields.md +0 -255
  248. package/dist/docs/reference/sdk/index.md +0 -68
  249. package/dist/docs/reference/sdk/plugins/create-experience.md +0 -123
  250. package/dist/docs/reference/sdk/plugins/dynamic-experiences.md +0 -74
  251. package/dist/docs/reference/sdk/plugins/index.md +0 -29
  252. package/dist/docs/reference/sdk/plugins/window-object.md +0 -25
  253. package/dist/docs/reference/sdk/predicates.md +0 -43
  254. package/dist/docs/reference/sdk/ssr/index.md +0 -33
  255. package/dist/docs/reference/sdk/ssr/rendering-and-hydration.md +0 -103
  256. package/dist/docs/reference/sdk/ssr/serialize.md +0 -80
  257. package/dist/docs/reference/sdk/ssr/slots-and-placements.md +0 -59
  258. package/dist/docs/reference/sdk/steps.md +0 -86
  259. package/dist/docs/reference/sdk/type-generation.md +0 -196
  260. package/dist/docs/reference/tools/chrome-extension.md +0 -16
  261. package/dist/docs/reference/tools/cli.md +0 -146
  262. package/dist/docs/reference/tools/image-optimisation-service.md +0 -104
  263. package/dist/docs/reference/tools/mcp.md +0 -90
  264. package/dist/docs/reference/tools/vite-plugin.md +0 -163
  265. package/dist/docs/tutorials/first-api-call.md +0 -228
  266. package/dist/docs/tutorials/first-experience-in-the-dashboard.mdx +0 -143
  267. package/dist/docs/tutorials/first-experience.mdx +0 -254
  268. package/dist/docs/tutorials/first-server-rendered-page.mdx +0 -186
  269. package/dist/dom-BqcToNL0.js +0 -82
  270. package/dist/dom-DlLH3FxV.cjs +0 -1
  271. package/dist/emit-D-tLiWL1.cjs +0 -1
  272. package/dist/emit-Ds2EG7CB.js +0 -14
  273. package/dist/esm/form/index.js +0 -565
  274. package/dist/esm/plugins/dom-observer/index.js +0 -87
  275. package/dist/esm/plugins/dynamic-experiences/index.js +0 -5
  276. package/dist/esm/plugins/experience-browser-storage/index.js +0 -38
  277. package/dist/esm/plugins/history-browser-storage/index.js +0 -26
  278. package/dist/esm/plugins/responses-browser-storage/index.js +0 -71
  279. package/dist/esm/plugins/responses-indexeddb/index.js +0 -89
  280. package/dist/esm/plugins/telemetry/index.js +0 -100
  281. package/dist/esm/plugins/web-components/index.js +0 -19
  282. package/dist/esm/preview/index.js +0 -2
  283. package/dist/experience-instance-B9S6Yf0N.js +0 -711
  284. package/dist/experience-instance-D8rOg6We.cjs +0 -1
  285. package/dist/id-Bo4RBeOs.js +0 -4
  286. package/dist/id-Js-62re-.cjs +0 -1
  287. package/dist/inert-script-report-B_bMPRzp.js +0 -18
  288. package/dist/inert-script-report-ijRHPtcY.cjs +0 -1
  289. package/dist/logger-CSTvAyyB.cjs +0 -1
  290. package/dist/logger-DMN6TxJJ.js +0 -4
  291. package/dist/object-BUDGxEqy.js +0 -25
  292. package/dist/object-CIkt7Fkr.cjs +0 -1
  293. package/dist/plugin-ChafFq6S.js +0 -194
  294. package/dist/plugin-Dn25Gffy.cjs +0 -1
  295. package/dist/preview-channel-CSr96XAo.js +0 -98
  296. package/dist/preview-channel-Cx0e6fye.cjs +0 -1
  297. package/dist/protocol-Bb_vpLKE.cjs +0 -1
  298. package/dist/protocol-C5KkkiZc.js +0 -84
  299. package/dist/provider-B8wvmeC8.js +0 -98
  300. package/dist/provider-BBLlQOjV.cjs +0 -1
  301. package/dist/registry-C1t8l3t9.cjs +0 -1
  302. package/dist/registry-CXZv0uLg.js +0 -18
  303. package/dist/rules-logic-CGZIYgAI.cjs +0 -1
  304. package/dist/rules-logic-HesIUCu6.js +0 -13
  305. package/dist/storage-1MW3-_As.js +0 -103
  306. package/dist/storage-DUw9UJ2h.cjs +0 -1
  307. package/dist/supports-CO9bJGNl.js +0 -92
  308. package/dist/supports-DBzjGaWD.cjs +0 -1
  309. package/dist/types/data-source/api.d.ts +0 -60
  310. package/dist/types/data-source/api.d.ts.map +0 -1
  311. package/dist/types/data-source/provider.d.ts +0 -103
  312. package/dist/types/data-source/provider.d.ts.map +0 -1
  313. package/dist/types/data-source/registry.d.ts +0 -26
  314. package/dist/types/data-source/registry.d.ts.map +0 -1
  315. package/dist/types/data-source/request-observer.d.ts +0 -62
  316. package/dist/types/data-source/request-observer.d.ts.map +0 -1
  317. package/dist/types/data-source/virtual-data.d.ts +0 -19
  318. package/dist/types/data-source/virtual-data.d.ts.map +0 -1
  319. package/dist/types/entities/action/action.d.ts +0 -85
  320. package/dist/types/entities/action/action.d.ts.map +0 -1
  321. package/dist/types/entities/component/lazyComponent.d.ts +0 -11
  322. package/dist/types/entities/component/lazyComponent.d.ts.map +0 -1
  323. package/dist/types/entities/condition/condition.d.ts +0 -29
  324. package/dist/types/entities/condition/condition.d.ts.map +0 -1
  325. package/dist/types/entities/content/content.d.ts +0 -53
  326. package/dist/types/entities/content/content.d.ts.map +0 -1
  327. package/dist/types/entities/content/reference.d.ts +0 -101
  328. package/dist/types/entities/content/reference.d.ts.map +0 -1
  329. package/dist/types/entities/field/policies.d.ts +0 -35
  330. package/dist/types/entities/field/policies.d.ts.map +0 -1
  331. package/dist/types/entities/response/response-validation.d.ts +0 -75
  332. package/dist/types/entities/response/response-validation.d.ts.map +0 -1
  333. package/dist/types/entities/session/session.d.ts +0 -46
  334. package/dist/types/entities/session/session.d.ts.map +0 -1
  335. package/dist/types/entities/step/step.d.ts +0 -56
  336. package/dist/types/entities/step/step.d.ts.map +0 -1
  337. package/dist/types/form/build-responses.d.ts +0 -18
  338. package/dist/types/form/build-responses.d.ts.map +0 -1
  339. package/dist/types/form/create-field-evaluator.d.ts +0 -28
  340. package/dist/types/form/create-field-evaluator.d.ts.map +0 -1
  341. package/dist/types/form/create-field-validation.d.ts +0 -60
  342. package/dist/types/form/create-field-validation.d.ts.map +0 -1
  343. package/dist/types/form/create-form.d.ts +0 -153
  344. package/dist/types/form/create-form.d.ts.map +0 -1
  345. package/dist/types/form/create-submit-pipeline.d.ts +0 -116
  346. package/dist/types/form/create-submit-pipeline.d.ts.map +0 -1
  347. package/dist/types/form/get-step-fields.d.ts +0 -19
  348. package/dist/types/form/get-step-fields.d.ts.map +0 -1
  349. package/dist/types/form/index.d.ts +0 -11
  350. package/dist/types/form/index.d.ts.map +0 -1
  351. package/dist/types/lifecycle/condition-selection.d.ts +0 -146
  352. package/dist/types/lifecycle/condition-selection.d.ts.map +0 -1
  353. package/dist/types/lifecycle/lifecycle.d.ts +0 -48
  354. package/dist/types/lifecycle/lifecycle.d.ts.map +0 -1
  355. package/dist/types/lifecycle/rules-logic.d.ts +0 -25
  356. package/dist/types/lifecycle/rules-logic.d.ts.map +0 -1
  357. package/dist/types/lifecycle/state-snapshot.d.ts +0 -38
  358. package/dist/types/lifecycle/state-snapshot.d.ts.map +0 -1
  359. package/dist/types/plugins/dom-observer/index.d.ts +0 -3
  360. package/dist/types/plugins/dom-observer/index.d.ts.map +0 -1
  361. package/dist/types/plugins/dom-observer/plugin.d.ts +0 -50
  362. package/dist/types/plugins/dom-observer/plugin.d.ts.map +0 -1
  363. package/dist/types/plugins/dynamic-experiences/hash.d.ts +0 -105
  364. package/dist/types/plugins/dynamic-experiences/hash.d.ts.map +0 -1
  365. package/dist/types/plugins/dynamic-experiences/index.d.ts +0 -7
  366. package/dist/types/plugins/dynamic-experiences/index.d.ts.map +0 -1
  367. package/dist/types/plugins/dynamic-experiences/plugin.d.ts +0 -49
  368. package/dist/types/plugins/dynamic-experiences/plugin.d.ts.map +0 -1
  369. package/dist/types/plugins/dynamic-experiences/types.d.ts +0 -45
  370. package/dist/types/plugins/dynamic-experiences/types.d.ts.map +0 -1
  371. package/dist/types/plugins/experience-browser-storage/index.d.ts.map +0 -1
  372. package/dist/types/plugins/experience-browser-storage/plugin.d.ts +0 -7
  373. package/dist/types/plugins/experience-browser-storage/plugin.d.ts.map +0 -1
  374. package/dist/types/plugins/history-browser-storage/index.d.ts.map +0 -1
  375. package/dist/types/plugins/history-browser-storage/plugin.d.ts.map +0 -1
  376. package/dist/types/plugins/responses-browser-storage/index.d.ts.map +0 -1
  377. package/dist/types/plugins/responses-browser-storage/plugin.d.ts +0 -18
  378. package/dist/types/plugins/responses-browser-storage/plugin.d.ts.map +0 -1
  379. package/dist/types/plugins/responses-indexeddb/index.d.ts.map +0 -1
  380. package/dist/types/plugins/responses-indexeddb/plugin.d.ts +0 -3
  381. package/dist/types/plugins/responses-indexeddb/plugin.d.ts.map +0 -1
  382. package/dist/types/plugins/telemetry/emit.d.ts +0 -18
  383. package/dist/types/plugins/telemetry/emit.d.ts.map +0 -1
  384. package/dist/types/plugins/telemetry/index.d.ts +0 -4
  385. package/dist/types/plugins/telemetry/index.d.ts.map +0 -1
  386. package/dist/types/plugins/telemetry/plugin-summary.d.ts +0 -10
  387. package/dist/types/plugins/telemetry/plugin-summary.d.ts.map +0 -1
  388. package/dist/types/plugins/telemetry/plugin.d.ts +0 -45
  389. package/dist/types/plugins/telemetry/plugin.d.ts.map +0 -1
  390. package/dist/types/plugins/web-components/index.d.ts +0 -2
  391. package/dist/types/plugins/web-components/index.d.ts.map +0 -1
  392. package/dist/types/plugins/web-components/plugin.d.ts +0 -4
  393. package/dist/types/plugins/web-components/plugin.d.ts.map +0 -1
  394. package/dist/types/preview/index.d.ts +0 -18
  395. package/dist/types/preview/index.d.ts.map +0 -1
  396. package/dist/types/preview-bridge/index.d.ts +0 -14
  397. package/dist/types/preview-bridge/index.d.ts.map +0 -1
  398. package/dist/types/preview-channel.d.ts +0 -16
  399. package/dist/types/preview-channel.d.ts.map +0 -1
  400. package/dist/types/preview-receiver/apply-ops.d.ts +0 -32
  401. package/dist/types/preview-receiver/apply-ops.d.ts.map +0 -1
  402. package/dist/types/preview-receiver/index.d.ts +0 -32
  403. package/dist/types/preview-receiver/index.d.ts.map +0 -1
  404. package/dist/types/preview-receiver/protocol.d.ts +0 -69
  405. package/dist/types/preview-receiver/protocol.d.ts.map +0 -1
  406. package/dist/types/schema-registry.d.ts +0 -206
  407. package/dist/types/schema-registry.d.ts.map +0 -1
  408. package/dist/types/server/serialize.d.ts +0 -87
  409. package/dist/types/server/serialize.d.ts.map +0 -1
  410. package/dist/types/typed-content.d.ts +0 -17
  411. package/dist/types/typed-content.d.ts.map +0 -1
  412. package/dist/types/utils/client-telemetry.d.ts +0 -25
  413. package/dist/types/utils/client-telemetry.d.ts.map +0 -1
  414. package/dist/types/utils/content-path.d.ts +0 -37
  415. package/dist/types/utils/content-path.d.ts.map +0 -1
  416. package/dist/types/utils/html-asset-value.d.ts +0 -20
  417. package/dist/types/utils/html-asset-value.d.ts.map +0 -1
  418. package/dist/types/utils/inert-script-report.d.ts +0 -40
  419. package/dist/types/utils/inert-script-report.d.ts.map +0 -1
  420. package/dist/types/utils/node-tree/get-next-node-from-action.d.ts +0 -25
  421. package/dist/types/utils/node-tree/get-next-node-from-action.d.ts.map +0 -1
  422. package/dist/types/utils/node-tree/get-next-node-from-condition.d.ts +0 -17
  423. package/dist/types/utils/node-tree/get-next-node-from-condition.d.ts.map +0 -1
  424. package/dist/types/utils/node-tree/node-adjacency.d.ts +0 -50
  425. package/dist/types/utils/node-tree/node-adjacency.d.ts.map +0 -1
  426. package/dist/types/utils/node-tree/node-tree-index.d.ts +0 -57
  427. package/dist/types/utils/node-tree/node-tree-index.d.ts.map +0 -1
  428. package/dist/types/utils/picked-config.d.ts +0 -39
  429. package/dist/types/utils/picked-config.d.ts.map +0 -1
  430. package/dist/types/utils/preview-session.d.ts +0 -12
  431. package/dist/types/utils/preview-session.d.ts.map +0 -1
  432. package/dist/types/utils/rehydrate-scripts.d.ts +0 -50
  433. package/dist/types/utils/rehydrate-scripts.d.ts.map +0 -1
  434. package/dist/types/utils/render-string.d.ts +0 -24
  435. package/dist/types/utils/render-string.d.ts.map +0 -1
  436. package/dist/types/utils/user-timing.d.ts +0 -21
  437. package/dist/types/utils/user-timing.d.ts.map +0 -1
  438. package/dist/version-CLjPfmxk.cjs +0 -1
  439. package/dist/version-CPKulHMH.js +0 -256
  440. /package/dist/types/plugins/{experience-browser-storage → experience-browserstorage-plugin}/index.d.ts +0 -0
  441. /package/dist/types/plugins/{history-browser-storage → history-browserstorage-plugin}/index.d.ts +0 -0
  442. /package/dist/types/plugins/{responses-browser-storage → responses-browserstorage-plugin}/index.d.ts +0 -0
  443. /package/dist/types/plugins/{responses-indexeddb → responses-indexeddb-plugin}/index.d.ts +0 -0
@@ -1,103 +0,0 @@
1
- ---
2
- type: reference
3
- layout: docs
4
- ---
5
-
6
- # Rendering and Hydration
7
-
8
- Seed a Picked client from the server snapshot, render your slots, and hydrate. This
9
- page covers React and Svelte.
10
-
11
- ## React: `PickedProvider`
12
-
13
- `PickedProvider` gives a client to each component below it. Its props are a union of
14
- two modes:
15
-
16
- | Props | Mode | Description |
17
- | --- | --- | --- |
18
- | `{ options, snapshot? }` | Create | The provider calls `createClient(options)` and hydrates the client from the snapshot. |
19
- | `{ client, snapshot? }` | Adopt | The provider uses a client that is there already, such as a global one for the whole application. It can also seed that client from the snapshot. |
20
-
21
- The provider seeds the client at once, so the server and the first paint on the
22
- client give the same markup. In the browser the provider calls `client.start()` from
23
- an effect. `start()` is idempotent, so it changes nothing on a client that already
24
- started.
25
-
26
- ```tsx
27
- import { PickedProvider, ExperienceSlot } from '@picked/react'
28
-
29
- <PickedProvider options={options} snapshot={snapshot}>
30
- <ExperienceSlot name="page" />
31
- </PickedProvider>
32
- ```
33
-
34
- ## Svelte: `setPickedContext`
35
-
36
- `setPickedContext` does the same work in the Svelte style. Call it one time at the
37
- top of the `<script>` block of a component. It takes the same two modes,
38
- `{ options, snapshot? }` or `{ client, snapshot? }`, and it returns the client.
39
-
40
- ```svelte
41
- <script lang="ts">
42
- import { ExperienceSlot, setPickedContext } from '@picked/svelte'
43
-
44
- setPickedContext({ options, snapshot })
45
- </script>
46
-
47
- <ExperienceSlot name="page" />
48
- ```
49
-
50
- ## Render the page component
51
-
52
- The SDK does not connect content to a component. You own the component that a Page
53
- renders. Register it under the name that the Page uses. The Page Layout in the dashboard
54
- points at that same name. The component reads the resolved entry data
55
- through a content hook: `useStepContent()` in React, and `getStepContent()` in
56
- Svelte.
57
-
58
- :::code-group
59
-
60
- ```tsx [React]
61
- import { useStepContent } from '@picked/react/hooks'
62
-
63
- export function CMSPage() {
64
- const content = useStepContent()
65
- if (!content) {
66
- return <p>Loading page content…</p>
67
- }
68
-
69
- const title = typeof content.title === 'string' ? content.title : ''
70
- return (
71
- <article>
72
- <h1>{title}</h1>
73
- </article>
74
- )
75
- }
76
- ```
77
-
78
- ```svelte [Svelte]
79
- <script lang="ts">
80
- import { getStepContent } from '@picked/svelte/hooks'
81
-
82
- const content = getStepContent()
83
- </script>
84
-
85
- {#if $content}
86
- <article>
87
- <h1>{typeof $content.title === 'string' ? $content.title : ''}</h1>
88
- </article>
89
- {:else}
90
- <p>Loading page content…</p>
91
- {/if}
92
- ```
93
-
94
- :::
95
-
96
- `useStepContent()` returns the `data` object of the entry directly. It returns `null`
97
- while no content is registered. `getStepContent()` returns a store, and you read it
98
- with `$content`.
99
-
100
- ## Related
101
-
102
- - [How to server-render a page](/how-to/server-render-a-page) — the full example.
103
- - [Slots and placements](/reference/sdk/ssr/slots-and-placements)
@@ -1,80 +0,0 @@
1
- ---
2
- type: reference
3
- layout: docs
4
- ---
5
-
6
- # Server Snapshot
7
-
8
- `serialize()` finds which experiences match a URL and reads their content on the
9
- server. It returns a snapshot as plain JSON, and you pass that snapshot to the
10
- client.
11
-
12
- ## The `serialize(client, params)` function
13
-
14
- ```ts
15
- import { createClient } from 'picked'
16
- import { serialize } from '@picked/client/server'
17
-
18
- const client = createClient(options)
19
-
20
- const snapshot = await serialize(client, {
21
- projectConfig,
22
- attributes: { location: { pathname: '/promo' } },
23
- })
24
- ```
25
-
26
- `serialize()` does this. It registers the project configuration on the client at once. It
27
- evaluates the condition of each experience against `attributes.location`. It reads
28
- the content for each experience whose steps point at layout content. It removes the
29
- duplicate content blobs, which it finds by their IDs. It then returns a `PickedSnapshot`.
30
-
31
- The content that it reads holds the entries of the steps. It also holds the entries that
32
- a [reference field](/reference/dashboard/content/models#reference-fields) reaches.
33
-
34
- Give `serialize()` one client for each request. It does not support two calls at the
35
- same time on one client.
36
-
37
- ```ts
38
- serialize(client: Picked, params: SerializeParams): Promise<PickedSnapshot>
39
- ```
40
-
41
- ## Parameters
42
-
43
- | Parameter | Type | Default | Description |
44
- | --- | --- | --- | --- |
45
- | `projectConfig` | `ProjectConfig` | required | The published configuration, or the preview configuration, to register and choose against. |
46
- | `attributes.location` | `Partial<SerializeLocation>` | none | The URL fields that go into the selection context, such as `pathname`. |
47
- | `getContent` | `SerializeGetContent` | runtime API | Your own function to read content, in place of the runtime API. |
48
- | `previewToken` | `string` | none | The SDK sends this with the content request, so that preview content resolves during a preview render. |
49
- | `timeoutMs` | `number` | `10000` | The limit for each content request. After the limit, the SDK skips that blob and continues. |
50
-
51
- `SerializeLocation` carries the URL fields `href`, `pathname`, `search`, `hostname`,
52
- `origin`, `protocol`, `port`, `host`, and `hash`. Pass only the fields that your
53
- conditions read.
54
-
55
- ## The snapshot
56
-
57
- ```ts
58
- interface PickedSnapshot {
59
- versionId: string | null
60
- projectConfig: ProjectConfig
61
- content: ContentBlob[]
62
- conditionResults: Record<string, boolean>
63
- }
64
- ```
65
-
66
- | Field | Description |
67
- | --- | --- |
68
- | `versionId` | The project version that the snapshot was chosen against. It is `null` when the version is not known, for example in a preview. |
69
- | `projectConfig` | The options that the server chose with. They travel to the client, so that the client renders against exactly the same options. |
70
- | `content` | The content blobs for the chosen experiences, with the duplicates removed. It holds the entries of the steps, and every entry that a reference field reaches. The server render and the first paint in the browser therefore resolve the same pointers. |
71
- | `conditionResults` | The condition results that the server kept, under a key made from the rule hash. The client then reuses the choice of the server. |
72
-
73
- The snapshot is plain JSON. Write it into your HTML response with `JSON.stringify`
74
- and read it back on the client.
75
-
76
- ## Related
77
-
78
- - [How to server-render a page](/how-to/server-render-a-page)
79
- - [How to render an unpublished preview](/how-to/render-an-unpublished-preview)
80
- - [Content](/reference/sdk/content) — how to read a content record in a component.
@@ -1,59 +0,0 @@
1
- ---
2
- type: reference
3
- layout: docs
4
- ---
5
-
6
- # Slots and Placements
7
-
8
- A slot is a named mount point. `<ExperienceSlot name="page" />` renders every
9
- experience that points at that slot and whose condition matches.
10
-
11
- ## What a slot is
12
-
13
- The `name` of a slot points at the `.picked-slot-<name>` selector. So
14
- `<ExperienceSlot name="page" />` renders every experience with the target selector
15
- `.picked-slot-page`, when the condition of that experience is active.
16
-
17
- The slot reads the active state of each experience from the seeded snapshot. It
18
- therefore renders at once, both in server-side rendering and at the first paint of
19
- the hydration.
20
-
21
- ```tsx
22
- <ExperienceSlot name="page" />
23
- ```
24
-
25
- ## Point an experience at a slot
26
-
27
- Set the target selector of the experience to `.picked-slot-<name>`. An experience
28
- that points at `.picked-slot-page` renders into `<ExperienceSlot name="page" />`. The
29
- name of the slot and the end of the selector must match.
30
-
31
- ## Placement order
32
-
33
- When more than one experience points at the same slot, they render in this placement
34
- order:
35
-
36
- ```
37
- replace -> before -> prepend -> append -> after
38
- ```
39
-
40
- `replace` wins. An active experience with the `replace` placement renders alone, and
41
- it replaces every other match in the slot. In every other case each active experience
42
- renders, in placement order.
43
-
44
- ## More than one experience in one slot
45
-
46
- The slot collects each experience that points at its selector. It drops each one
47
- whose condition is not active. It then sorts the rest into placement order. When a `replace`
48
- experience is among the active ones, only that experience renders. With no active
49
- `replace`, the slot renders every active experience in the order `before`, `prepend`,
50
- `append`, `after`.
51
-
52
- One Page can therefore take a whole slot with `replace`, while another slot holds
53
- several experiences that use the other placements. A condition decides which
54
- experiences are active. See [Conditions](/reference/dashboard/conditions).
55
-
56
- ## Related
57
-
58
- - [About server-side rendering](/explanation/why-server-side-rendering) — why placements
59
- have an order.
@@ -1,86 +0,0 @@
1
- ---
2
- type: reference
3
- layout: docs
4
- ---
5
-
6
- # Steps
7
-
8
- Render your steps with `<StepRouter>` and `<Step>` from `@picked/react` or
9
- `@picked/svelte`. Reach the active step through `useStep()` or `getStep()`.
10
-
11
- ## Reach the step context
12
-
13
- Inside a `Step` component, or inside any component that a `Step` renders, call
14
- `getStep()` or `useStep()` to reach the reactive context of the step:
15
-
16
- :::code-group
17
-
18
- ```tsx [React]
19
- import { useStep, useStoreGlobal } from '@picked/react/hooks'
20
-
21
- function ContactForm() {
22
- const { step, fields } = useStep()
23
- const currentStep = useStoreGlobal(step)
24
- const currentFields = useStoreGlobal(fields)
25
-
26
- return (
27
- <>
28
- <h1>{currentStep.label}</h1>
29
-
30
- {currentFields.map((field) => (
31
- <div key={field.id}>
32
- <label>{field.label}</label>
33
- <input
34
- name={field.id}
35
- value={field.value ?? ''}
36
- onChange={field.onChange}
37
- onBlur={field.onBlur}
38
- />
39
- {field.error && field.touched && <p className="error">{field.error.userMessage}</p>}
40
- </div>
41
- ))}
42
- </>
43
- )
44
- }
45
- ```
46
-
47
- ```svelte [Svelte]
48
- <script lang="ts">
49
- import { getStep } from '@picked/svelte/hooks'
50
-
51
- const { step, fields } = getStep()
52
- </script>
53
-
54
- <h1>{$step.label}</h1>
55
-
56
- {#each $fields as field}
57
- <label>{field.label}</label>
58
- <input
59
- name={field.id}
60
- value={field.value ?? ''}
61
- onchange={field.onChange}
62
- onblur={field.onBlur}
63
- />
64
- {#if field.error && field.touched}
65
- <p class="error">{field.error.userMessage}</p>
66
- {/if}
67
- {/each}
68
- ```
69
-
70
- :::
71
-
72
- `getStep()` in Svelte, and `useStep()` in React, return a `StepContext` with these
73
- properties:
74
-
75
- | Property | Type | Description |
76
- | ---------- | --------------------------------------------- | ------------------------------------------------------------------------------ |
77
- | `step` | `Store<ExperienceStep>` | A reactive store that holds the `id` and the `label` of the step |
78
- | `fields` | `Store<FormField[]>` | A reactive store of the fields, with their current values, errors, and handlers |
79
- | `isActive` | `Store<boolean>` (Svelte) / `boolean` (React) | Whether the router holds this step as the active one |
80
- | `form` | Object | The handlers for a form submission. See [Forms](#forms). |
81
-
82
- ## Related
83
-
84
- - [How to render a step form](/how-to/render-a-step-form)
85
- - [How to run code on a form submission](/how-to/run-code-on-a-form-submission)
86
- - [About how Picked works](/explanation/how-picked-works) — why a flow is a graph.
@@ -1,196 +0,0 @@
1
- ---
2
- type: reference
3
- layout: docs
4
- ---
5
-
6
- # Type Generation
7
-
8
- Picked can generate TypeScript types from your workspace schema so field values, feature keys, content models, and step layouts are typed in your app.
9
-
10
- ## Quick start
11
-
12
- ### 1. Add `picked.config.ts`
13
-
14
- Create a `picked.config.ts` in your project root:
15
-
16
- ```typescript
17
- import { defineConfig } from 'picked/config'
18
-
19
- export default defineConfig({
20
- projectId: 'your-project-id',
21
- typesOutput: './src/picked-env.d.ts',
22
- })
23
- ```
24
-
25
- | Option | Description |
26
- | --- | --- |
27
- | `projectId` | **Required.** Your Picked project id. |
28
- | `typesOutput` | Path for generated types (defaults to `./src/picked-env.d.ts`). |
29
- | `source` | Schema surface to type against: `'published'` (default) or `'preview'`. |
30
- | `previewToken` | Workspace preview token. Required when `source` is `'preview'`, and read only then. |
31
-
32
- The `source` value matches the `x-picked-source` field on the [workspace schema](/reference/delivery-api/workspace-schema) document — it controls whether tooling fetches the published or preview workspace shape.
33
-
34
- A preview token reads one workspace, and it does not expire. Leave both `source` and
35
- `previewToken` out of the committed file, and pick a workspace instead:
36
-
37
- ```bash
38
- picked login
39
- picked workspace use
40
- ```
41
-
42
- That writes the choice, and that workspace's token, to `.picked/settings.json`, which is
43
- per-developer and which Git ignores. Each developer points at their own workspace, and the
44
- committed file holds no token.
45
-
46
- You can also set the values here. Every developer then reads the same workspace:
47
-
48
- ```typescript
49
- export default defineConfig({
50
- projectId: 'your-project-id',
51
- source: 'preview',
52
- previewToken: 'the-workspace-preview-token',
53
- })
54
- ```
55
-
56
- Three places can give the token. Tooling reads the first of them that has one: the
57
- `PICKED_PREVIEW_TOKEN` environment variable, then the workspace that
58
- [`picked workspace use`](/reference/tools/cli) chose, then this `previewToken` option.
59
-
60
- ### 2. Enable the Vite plugin (recommended)
61
-
62
- If you use Vite, add `@picked/vite-plugin-picked`. Type generation runs automatically on `dev` and `build` when `generateTypes` is enabled (the default):
63
-
64
- ```typescript
65
- import { picked } from '@picked/vite-plugin-picked'
66
-
67
- export default defineConfig({
68
- plugins: [picked()],
69
- })
70
- ```
71
-
72
- The project id comes from `picked.config.ts`. A failure stops the
73
- run. See [the plugin reference](/reference/tools/vite-plugin) for `generateTypes` and every
74
- other option.
75
-
76
- ### 3. Or use the CLI
77
-
78
- Install [`picked`](/reference/tools/cli) and run:
79
-
80
- ```bash
81
- picked generate types
82
- ```
83
-
84
- ## Keep the types current
85
-
86
- Commit `picked-env.d.ts`. A workspace changes after you commit it, so the file goes stale,
87
- and stale types describe fields your workspace no longer has.
88
-
89
- Run this check in CI, next to your other checks:
90
-
91
- ```bash
92
- picked generate types --check
93
- ```
94
-
95
- `--check` writes no file. It reads the live workspace schema and compares it with the
96
- committed file. A match gives status `0`. A difference gives status `1` and names the file:
97
-
98
- ```
99
- Types are out of date: /home/runner/work/your-app/src/picked-env.d.ts
100
- ```
101
-
102
- To clear it, run `picked generate types` and commit the result. The check reads no cached
103
- schema, so an API it cannot reach fails the check.
104
-
105
- :::note
106
- `--check` reads the workspace that the resolved configuration names. A CI run that has no
107
- `.picked/settings.json` reads the workspace your committed `picked.config.ts` names.
108
- :::
109
-
110
- ## Workspace selection
111
-
112
- Tooling reads `projectId` and `source` from your committed `picked.config.ts`. The Picked [CLI](/reference/tools/cli) points that tooling at a different project or a draft workspace, and leaves the file as it is. It writes the selection to `.picked/settings.json`, which is per-developer and which Git ignores. That selection supersedes the committed default.
113
-
114
- See [How to switch workspaces](/how-to/switch-workspaces) for the full set of steps.
115
-
116
- ## Generated output
117
-
118
- The generated `picked-env.d.ts` file looks like:
119
-
120
- ```typescript
121
- // GENERATED by `@picked/typegen` — do not edit by hand.
122
- // Reference: `https://docs.picked.app/reference/sdk/type-generation`
123
-
124
- export type WelcomePage = { /* ... */ }
125
- export type FieldValues = { /* ... */ }
126
- export type FeatureKey =
127
- | 'default'
128
- | 'hero'
129
- | 'winter-sale'
130
-
131
- declare module '@picked/client' {
132
- interface PickedSchemaRegistry {
133
- contentModels: {
134
- 'welcome-page': WelcomePage
135
- }
136
- stepContentModels: {
137
- 'intro': 'welcome-page'
138
- }
139
- featureValues: {
140
- 'hero':
141
- | false
142
- | 'hero-a'
143
- | 'hero-b'
144
- }
145
- fieldValues: FieldValues
146
- featureKeys: FeatureKey
147
- }
148
- }
149
- ```
150
-
151
- Commit this file to the version control system, or regenerate it in CI after you publish a workspace change.
152
-
153
- ### Feature flag values
154
-
155
- A Text feature flag declares the values that it can serve, so `useFeatureResult` narrows
156
- the bucket to those values:
157
-
158
- ```typescript
159
- const result = useFeatureResult('hero')
160
- ```
161
-
162
- The `bucket` property then has the type `false | 'hero-a' | 'hero-b'`.
163
-
164
- `featureValues` holds the Text feature flags alone. A Boolean feature flag, and a feature
165
- flag that your application defines, both keep the general `boolean | string` type. The
166
- `FeatureValueFor<'hero'>` type gives the same union on its own.
167
-
168
- ## Keys the application defines
169
-
170
- An application can define a feature, an action, a field, a step, or an experience of its
171
- own. It does this through `createClient` options or through a `register` method. The
172
- workspace has no record of such a key, so the generated types have none either.
173
-
174
- A hook still accepts one. Each key type holds the keys of the workspace and any other
175
- string. Your editor shows the workspace keys, and no local key is an error:
176
-
177
- ```typescript
178
- useFeature('winter-sale') // from the workspace, and suggested
179
- useFeature('summer-sales-experiment') // from createClient, and accepted
180
- ```
181
-
182
- Each key type has a `Known` form that holds the workspace keys alone —
183
- `KnownFeatureKeys`, `KnownActionKeys`, `KnownFieldKeys`, `KnownStepKeys`, and
184
- `KnownExperienceKeys`. Use one where you want the workspace set and nothing else.
185
-
186
- ## Cache
187
-
188
- Type generation writes its artefacts under `.picked/`: the schema JSON and a manifest. The first run adds this directory to `.gitignore` for you.
189
-
190
- ## Related
191
-
192
- - [CLI](/reference/tools/cli) — commands, authentication, and environment variables.
193
- - [How to switch workspaces](/how-to/switch-workspaces) — read a draft workspace on your machine.
194
- - [Vite plugin](/reference/tools/vite-plugin) — the build-time prefetch and the dev launcher.
195
- - [Workspace schema](/reference/delivery-api/workspace-schema) — the schema endpoint.
196
- - [Delivery API](/reference/delivery-api) — the published surface and the preview surface.
@@ -1,16 +0,0 @@
1
- ---
2
- type: reference
3
- layout: docs
4
- ---
5
-
6
- # Chrome Extension
7
-
8
- The extension for the Picked Developer Tools adds a Picked panel to Chrome DevTools.
9
- Use the panel to check and debug your Picked integration on any page that runs the
10
- SDK.
11
-
12
- ![Picked Developer Tools](/chrome-extension-screenshot.jpg)
13
-
14
- ## Related
15
-
16
- - [How to debug with the Chrome extension](/how-to/debug-with-the-chrome-extension)
@@ -1,146 +0,0 @@
1
- ---
2
- type: reference
3
- layout: docs
4
- ---
5
-
6
- # CLI
7
-
8
- `picked` is the command-line tool for local Picked development. It generates TypeScript
9
- types from your workspace schema and lets you switch which project or workspace your local
10
- tooling loads — without hand-editing `picked.config.ts`.
11
-
12
- ## Installation
13
-
14
- The [`picked`](/reference/sdk) package holds this command, the client, and the
15
- `picked.config` helpers:
16
-
17
- ```bash
18
- npm install picked
19
- ```
20
-
21
- The command reads `picked.config.ts` from the current directory, so run it from your
22
- project root. See [How to authenticate the CLI](/how-to/authenticate-the-cli) to sign in.
23
-
24
- `@picked/cli` holds the command on its own, for a project that wants no other part of the
25
- package.
26
-
27
- ## Commands
28
-
29
- | Command | Description |
30
- | --- | --- |
31
- | `picked login` | Sign in with your browser (OAuth) to the API origin of the current directory. Stores a session under `~/.picked/auth/`. |
32
- | `picked logout` | Clear the stored session for the current directory's API origin. |
33
- | `picked whoami` | Print the identity signed in to the API origin of the current directory. |
34
- | `picked status` | Print the resolved selection and the committed `picked.config` default. |
35
- | `picked workspace list` | List each org, project, and workspace that you can read. Alias `ls`. `--json` gives machine output. |
36
- | `picked workspace use` | Set the active project or workspace. Alias `picked use`. Interactive, or `--project` and `--workspace`. |
37
- | `picked generate types` | Read the workspace schema and write `picked-env.d.ts`. `--check` verifies and writes nothing. |
38
-
39
- ### `picked generate types`
40
-
41
- Writes the typed schema declaration. See [Type generation](/reference/sdk/type-generation)
42
- for the `picked.config.ts` reference and the generated output.
43
-
44
- ```bash
45
- picked generate types
46
- ```
47
-
48
- In CI, `--check` writes nothing and fails when the committed types are stale:
49
-
50
- ```bash
51
- picked generate types --check
52
- # → "Types are up to date (`…/src/picked-env.d.ts`)." (status 0)
53
- # → "Types are out of date: `…/src/picked-env.d.ts`" (status 1)
54
- ```
55
-
56
- ### `picked workspace list`
57
-
58
- ```bash
59
- picked workspace list
60
- ```
61
-
62
- ```
63
- Acme Corp. (acme-corporation)
64
- Storefront [proj_a1b2]
65
- Default Storefront [LIVE] (live)
66
- Checkout rework [DRAFT]
67
- ```
68
-
69
- `--json` gives a machine-readable tree. Each prompt and heading goes to `stderr`, so the
70
- `stdout` of `--json` stays clean when you send it to another command.
71
-
72
- ### `picked workspace use`
73
-
74
- Sets the active selection, then regenerates types. See
75
- [How to switch workspaces](/how-to/switch-workspaces) for the full set of steps.
76
-
77
- ```bash
78
- picked workspace use # interactive picker
79
- picked workspace use --project proj_a1b2 # the project's published (live) version
80
- picked workspace use --project proj_a1b2 --workspace ws_id # preview a specific workspace via its token
81
- ```
82
-
83
- ```
84
- Active workspace: Checkout rework [DRAFT] in project proj_a1b2 (source: preview)
85
- Generated types at /app/src/picked-env.d.ts
86
- ```
87
-
88
- `--no-generate` sets the selection and leaves the types as they are.
89
-
90
- :::warning
91
- `picked workspace use` regenerates types by default. Types that no longer match the
92
- workspace give no error, and a developer can fail to see the problem for a long time. Use
93
- `--no-generate` only when you regenerate the types yourself.
94
- :::
95
-
96
- ## Authentication
97
-
98
- `picked login` signs in through the browser. It uses an authorization-code flow with PKCE
99
- against the Picked OAuth server. `picked whoami` prints the identity for the current origin.
100
- `picked logout` clears it.
101
-
102
- The CLI holds one auth config file for each API origin, outside each repository. Every
103
- command reads and writes only the origin that the current directory resolves to, and never
104
- a session for another API.
105
-
106
- | File | Contents |
107
- | --- | --- |
108
- | `~/.picked/auth/<origin>.json` | The OAuth session for one API origin — access token, refresh token, expiry — with the CLI's registered client id for that origin. File mode `600`. Refreshed as it nears expiry. |
109
-
110
- An API deployment with no OAuth client registration rejects `picked login`, and has no
111
- other flow.
112
-
113
- A CLI session is a developer credential. It is not an
114
- [API key](/reference/dashboard/api-keys), which authenticates server-to-server calls, and
115
- not [dashboard sign-in](/reference/management-api/authentication).
116
-
117
- ## Environment variables
118
-
119
- | Variable | Effect |
120
- | --- | --- |
121
- | `PICKED_API_URL` | The API origin that the CLI reads. Supersedes `picked.config` `apiUrl` and the `https://api.picked.app` default. |
122
- | `PICKED_PROJECT_ID` | Supersedes the resolved project id, above the active selection and the committed configuration. |
123
- | `PICKED_PREVIEW_TOKEN` | Supersedes the preview token. Applies only when the resolved source is `preview`. |
124
-
125
- ### How the selection resolves
126
-
127
- Tooling — `picked generate types` and the
128
- [Vite plugin](/reference/tools/vite-plugin) — resolves the configuration in this order. Each
129
- layer supersedes the layer before it:
130
-
131
- 1. **`picked.config.ts`** — the committed default: `projectId`, `source`, and
132
- `previewToken`.
133
- 2. **`.picked/settings.json`** — the per-developer active selection that
134
- `picked workspace use` writes. It supersedes `projectId` and `source`, and Git ignores it.
135
- 3. **Environment variables** — `PICKED_PROJECT_ID` and `PICKED_PREVIEW_TOKEN` supersede
136
- both, for a CI or headless run.
137
-
138
- `picked status` prints the resolved result.
139
-
140
- ## Related
141
-
142
- - [How to authenticate the CLI](/how-to/authenticate-the-cli) — install and sign in.
143
- - [How to switch workspaces](/how-to/switch-workspaces) — the draft-preview workflow.
144
- - [Type generation](/reference/sdk/type-generation) — `picked.config.ts` and the generated types.
145
- - [Vite plugin](/reference/tools/vite-plugin) — reads the same selection in development and in a build.
146
- - [Preview, cache, and crawlers](/reference/delivery-api/preview-caching-crawling) — how a preview token behaves.