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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (291) hide show
  1. package/dist/.tsbuildinfo +1 -0
  2. package/dist/api-03c5jvVk.js +38 -0
  3. package/dist/api-CQxCVIrm.cjs +1 -0
  4. package/dist/cjs/form/index.js +1 -1
  5. package/dist/cjs/index.js +2 -2
  6. package/dist/cjs/plugins/dom-observer/index.js +1 -1
  7. package/dist/cjs/plugins/dynamic-experiences/index.js +1 -1
  8. package/dist/cjs/server/index.js +1 -1
  9. package/dist/docs/explanation/conditions-and-the-logic-engine.md +94 -0
  10. package/dist/docs/explanation/feature-flag-allocation.md +176 -0
  11. package/dist/docs/explanation/how-picked-works.md +124 -0
  12. package/dist/docs/explanation/how-pickedql-works.md +76 -0
  13. package/dist/docs/explanation/pages-and-flows.md +64 -0
  14. package/dist/docs/explanation/the-content-model.md +77 -0
  15. package/dist/docs/explanation/the-two-apis.md +68 -0
  16. package/dist/docs/explanation/why-server-side-rendering.md +76 -0
  17. package/dist/docs/explanation/workspaces-and-versions.md +71 -0
  18. package/dist/docs/how-to/add-a-step-field-or-action.md +43 -0
  19. package/dist/docs/{pickedql/examples.md → how-to/analytics/index.md} +53 -28
  20. package/dist/docs/how-to/archive-or-delete-a-workspace.md +46 -0
  21. package/dist/docs/how-to/authenticate-with-a-magic-link.md +40 -0
  22. package/dist/docs/how-to/authenticate-with-a-password.md +51 -0
  23. package/dist/docs/how-to/authenticate-with-an-api-key.md +51 -0
  24. package/dist/docs/how-to/authenticate-with-oauth.md +40 -0
  25. package/dist/docs/how-to/build-a-flow.md +83 -0
  26. package/dist/docs/how-to/connect-the-mcp-server.md +38 -0
  27. package/dist/docs/how-to/create-a-project.md +29 -0
  28. package/dist/docs/how-to/create-an-experience.md +42 -0
  29. package/dist/docs/how-to/create-and-revoke-an-api-key.md +37 -0
  30. package/dist/docs/how-to/debug-with-the-chrome-extension.md +57 -0
  31. package/dist/docs/how-to/define-a-page-layout.md +39 -0
  32. package/dist/docs/how-to/fill-and-publish-a-page.md +50 -0
  33. package/dist/docs/how-to/install-the-gtm-template.md +84 -0
  34. package/dist/docs/how-to/install-the-sdk.md +68 -0
  35. package/dist/docs/how-to/install-the-vite-plugin.md +56 -0
  36. package/dist/docs/how-to/invite-and-remove-members.md +34 -0
  37. package/dist/docs/how-to/preview-a-workspace.md +28 -0
  38. package/dist/docs/how-to/publish-a-workspace.md +30 -0
  39. package/dist/docs/how-to/read-a-feature-flag.md +101 -0
  40. package/dist/docs/how-to/register-a-component.md +55 -0
  41. package/dist/docs/how-to/register-an-action-handler.md +67 -0
  42. package/dist/docs/how-to/render-a-step-form.md +132 -0
  43. package/dist/docs/how-to/render-an-unpublished-preview.md +41 -0
  44. package/dist/docs/how-to/reuse-a-section.md +37 -0
  45. package/dist/docs/how-to/reuse-a-step-field-or-action.md +28 -0
  46. package/dist/docs/how-to/roll-back-a-published-version.md +26 -0
  47. package/dist/docs/how-to/run-an-ab-test.md +49 -0
  48. package/dist/docs/how-to/run-code-on-a-form-submission.md +125 -0
  49. package/dist/docs/how-to/server-render-a-page.md +81 -0
  50. package/dist/docs/how-to/set-a-content-security-policy.md +32 -0
  51. package/dist/docs/how-to/set-up-mfa.md +69 -0
  52. package/dist/docs/how-to/upload-and-use-an-asset.mdx +73 -0
  53. package/dist/docs/how-to/validate-a-field.md +52 -0
  54. package/dist/docs/how-to/write-a-condition.md +45 -0
  55. package/dist/docs/how-to/write-a-predicate.md +60 -0
  56. package/dist/docs/index.md +41 -59
  57. package/dist/docs/reference/dashboard/actions.mdx +53 -0
  58. package/dist/docs/reference/dashboard/api-keys.mdx +37 -0
  59. package/dist/docs/reference/dashboard/conditions.mdx +42 -0
  60. package/dist/docs/reference/dashboard/content/asset-library.mdx +63 -0
  61. package/dist/docs/reference/dashboard/content/content-entries.mdx +44 -0
  62. package/dist/docs/reference/dashboard/content/layouts.mdx +62 -0
  63. package/dist/docs/reference/dashboard/content/pages.mdx +35 -0
  64. package/dist/docs/reference/dashboard/content/sections.mdx +28 -0
  65. package/dist/docs/reference/dashboard/experiences.mdx +51 -0
  66. package/dist/docs/reference/dashboard/features.mdx +114 -0
  67. package/dist/docs/reference/dashboard/fields.mdx +100 -0
  68. package/dist/docs/reference/dashboard/flow-builder/canvas.mdx +58 -0
  69. package/dist/docs/reference/dashboard/flow-builder/condition-builder.md +57 -0
  70. package/dist/docs/reference/dashboard/flow-builder/keyboard-shortcuts.md +72 -0
  71. package/dist/docs/reference/dashboard/flow-builder/nodes.md +63 -0
  72. package/dist/docs/reference/dashboard/projects.mdx +44 -0
  73. package/dist/docs/reference/dashboard/reports.mdx +43 -0
  74. package/dist/docs/reference/dashboard/steps.mdx +37 -0
  75. package/dist/docs/reference/dashboard/team-management.md +29 -0
  76. package/dist/docs/reference/dashboard/workspace-versioning.mdx +30 -0
  77. package/dist/docs/reference/dashboard/workspaces.mdx +76 -0
  78. package/dist/docs/{delivery-api → reference/delivery-api}/experience-content.md +17 -5
  79. package/dist/docs/reference/delivery-api/index.md +45 -0
  80. package/dist/docs/reference/delivery-api/preview-caching-crawling.md +79 -0
  81. package/dist/docs/{delivery-api → reference/delivery-api}/project-config.md +15 -6
  82. package/dist/docs/reference/glossary.md +173 -0
  83. package/dist/docs/reference/management-api/authentication.md +74 -0
  84. package/dist/docs/{api → reference/management-api}/authorization-and-scopes.md +70 -47
  85. package/dist/docs/reference/management-api/error-handling.md +233 -0
  86. package/dist/docs/{api → reference/management-api}/pagination.md +36 -20
  87. package/dist/docs/reference/pickedql/data-sources.md +174 -0
  88. package/dist/docs/reference/pickedql/dimensions.md +87 -0
  89. package/dist/docs/{pickedql → reference/pickedql}/filtering.md +17 -6
  90. package/dist/docs/reference/pickedql/index.md +18 -0
  91. package/dist/docs/reference/pickedql/schema.md +172 -0
  92. package/dist/docs/reference/pickedql/virtual-functions.md +237 -0
  93. package/dist/docs/reference/sdk/actions.md +30 -0
  94. package/dist/docs/{sdk → reference/sdk}/conditions.md +15 -5
  95. package/dist/docs/reference/sdk/content-security-policy.md +21 -0
  96. package/dist/docs/reference/sdk/experiences.md +51 -0
  97. package/dist/docs/reference/sdk/features.md +233 -0
  98. package/dist/docs/reference/sdk/fields.md +209 -0
  99. package/dist/docs/reference/sdk/index.md +68 -0
  100. package/dist/docs/{sdk → reference/sdk}/plugins/create-experience.md +25 -34
  101. package/dist/docs/reference/sdk/plugins/dynamic-experiences.md +74 -0
  102. package/dist/docs/reference/sdk/plugins/index.md +29 -0
  103. package/dist/docs/{sdk → reference/sdk}/plugins/window-object.md +6 -0
  104. package/dist/docs/reference/sdk/predicates.md +43 -0
  105. package/dist/docs/reference/sdk/ssr/index.md +33 -0
  106. package/dist/docs/reference/sdk/ssr/rendering-and-hydration.md +103 -0
  107. package/dist/docs/reference/sdk/ssr/serialize.md +77 -0
  108. package/dist/docs/reference/sdk/ssr/slots-and-placements.md +59 -0
  109. package/dist/docs/reference/sdk/steps.md +87 -0
  110. package/dist/docs/reference/tools/chrome-extension.md +16 -0
  111. package/dist/docs/reference/tools/image-optimisation-service.md +104 -0
  112. package/dist/docs/reference/tools/mcp.md +88 -0
  113. package/dist/docs/reference/tools/vite-plugin.md +88 -0
  114. package/dist/docs/tutorials/first-api-call.md +228 -0
  115. package/dist/docs/tutorials/first-experience-in-the-dashboard.mdx +143 -0
  116. package/dist/docs/tutorials/first-experience.mdx +255 -0
  117. package/dist/docs/tutorials/first-server-rendered-page.mdx +186 -0
  118. package/dist/{dom-BwmTHeT7.js → dom-BqcToNL0.js} +1 -3
  119. package/dist/{dom-CDrHc_j9.cjs → dom-DlLH3FxV.cjs} +1 -1
  120. package/dist/esm/form/index.js +2 -4
  121. package/dist/esm/index.js +225 -186
  122. package/dist/esm/plugins/dom-observer/index.js +1 -1
  123. package/dist/esm/plugins/dynamic-experiences/index.js +3 -3
  124. package/dist/esm/preview/index.js +1 -1
  125. package/dist/esm/server/index.js +33 -31
  126. package/dist/{experience-instance-DOJShRk5.js → experience-instance-DGk11d8a.js} +3 -3
  127. package/dist/experience-instance-Dej3P1sE.cjs +1 -0
  128. package/dist/plugin-CHOVsx7Z.js +287 -0
  129. package/dist/plugin-DsaGXQHx.cjs +1 -0
  130. package/dist/{preview-channel-DW9J8t4B.js → preview-channel-CSr96XAo.js} +1 -1
  131. package/dist/{protocol-DSqOlW2r.js → protocol-C5KkkiZc.js} +1 -1
  132. package/dist/types/client.d.ts +7 -6
  133. package/dist/types/data-source/api.d.ts +60 -0
  134. package/dist/types/data-source/api.d.ts.map +1 -0
  135. package/dist/types/data-source/provider.d.ts +97 -0
  136. package/dist/types/data-source/provider.d.ts.map +1 -0
  137. package/dist/types/entities/action/action.d.ts +5 -4
  138. package/dist/types/entities/action/action.d.ts.map +1 -1
  139. package/dist/types/entities/component/component.d.ts +6 -5
  140. package/dist/types/entities/component/component.d.ts.map +1 -1
  141. package/dist/types/entities/condition/condition.d.ts +5 -5
  142. package/dist/types/entities/content/content.d.ts +4 -3
  143. package/dist/types/entities/experience/experience.d.ts +11 -10
  144. package/dist/types/entities/experience/experience.d.ts.map +1 -1
  145. package/dist/types/entities/experience-instance/experience-instance.d.ts +10 -9
  146. package/dist/types/entities/feature/feature.d.ts +19 -2
  147. package/dist/types/entities/feature/feature.d.ts.map +1 -1
  148. package/dist/types/entities/field/field.d.ts +7 -6
  149. package/dist/types/entities/framework/framework.d.ts +7 -6
  150. package/dist/types/entities/framework/framework.d.ts.map +1 -1
  151. package/dist/types/entities/history/history.d.ts +6 -6
  152. package/dist/types/entities/plugin/plugin.d.ts +3 -2
  153. package/dist/types/entities/plugin/plugin.d.ts.map +1 -1
  154. package/dist/types/entities/predicate/predicate.d.ts +4 -3
  155. package/dist/types/entities/predicate/predicate.d.ts.map +1 -1
  156. package/dist/types/entities/response/response-validation.d.ts +3 -2
  157. package/dist/types/entities/response/response.d.ts +12 -11
  158. package/dist/types/entities/session/session.d.ts +2 -1
  159. package/dist/types/entities/step/step.d.ts +6 -5
  160. package/dist/types/exports.d.ts +2 -1
  161. package/dist/types/exports.d.ts.map +1 -1
  162. package/dist/types/form/build-responses.d.ts +2 -1
  163. package/dist/types/form/create-field-evaluator.d.ts +4 -3
  164. package/dist/types/form/create-field-validation.d.ts +5 -4
  165. package/dist/types/form/create-form.d.ts +7 -6
  166. package/dist/types/form/create-submit-pipeline.d.ts +7 -6
  167. package/dist/types/form/get-step-fields.d.ts +3 -2
  168. package/dist/types/lifecycle/condition-selection.d.ts +14 -4
  169. package/dist/types/lifecycle/lifecycle.d.ts +4 -3
  170. package/dist/types/lifecycle/rules-logic.d.ts +4 -3
  171. package/dist/types/lifecycle/state-snapshot.d.ts +4 -3
  172. package/dist/types/picked.d.ts +79 -62
  173. package/dist/types/picked.d.ts.map +1 -1
  174. package/dist/types/ping.d.ts +1 -1
  175. package/dist/types/ping.d.ts.map +1 -1
  176. package/dist/types/plugins/create-experience/create-experience.d.ts +9 -8
  177. package/dist/types/plugins/create-experience/create-experience.d.ts.map +1 -1
  178. package/dist/types/plugins/create-experience/plugin.d.ts +3 -2
  179. package/dist/types/plugins/create-experience/plugin.d.ts.map +1 -1
  180. package/dist/types/plugins/create-experience/serialization.d.ts.map +1 -1
  181. package/dist/types/plugins/dom-observer/plugin.d.ts +1 -1
  182. package/dist/types/plugins/dynamic-experiences/hash.d.ts +40 -5
  183. package/dist/types/plugins/dynamic-experiences/hash.d.ts.map +1 -1
  184. package/dist/types/plugins/dynamic-experiences/index.d.ts +2 -0
  185. package/dist/types/plugins/dynamic-experiences/index.d.ts.map +1 -1
  186. package/dist/types/plugins/dynamic-experiences/plugin.d.ts +4 -36
  187. package/dist/types/plugins/dynamic-experiences/plugin.d.ts.map +1 -1
  188. package/dist/types/plugins/dynamic-experiences/types.d.ts +42 -11
  189. package/dist/types/plugins/dynamic-experiences/types.d.ts.map +1 -1
  190. package/dist/types/plugins/experience-browser-storage/plugin.d.ts +1 -1
  191. package/dist/types/plugins/experience-browser-storage/plugin.d.ts.map +1 -1
  192. package/dist/types/plugins/history-browser-storage/plugin.d.ts +1 -1
  193. package/dist/types/plugins/history-browser-storage/plugin.d.ts.map +1 -1
  194. package/dist/types/plugins/responses-browser-storage/plugin.d.ts +1 -1
  195. package/dist/types/plugins/responses-browser-storage/plugin.d.ts.map +1 -1
  196. package/dist/types/plugins/responses-indexeddb/plugin.d.ts +1 -1
  197. package/dist/types/plugins/single-page-app/plugin.d.ts +1 -1
  198. package/dist/types/plugins/single-page-app/plugin.d.ts.map +1 -1
  199. package/dist/types/plugins/web-components/plugin.d.ts +2 -1
  200. package/dist/types/plugins/window-object/plugin.d.ts +2 -2
  201. package/dist/types/preview-channel.d.ts +5 -1
  202. package/dist/types/preview-receiver/index.d.ts +18 -1
  203. package/dist/types/preview-receiver/protocol.d.ts +10 -1
  204. package/dist/types/server/index.d.ts +3 -3
  205. package/dist/types/server/serialize.d.ts +8 -2
  206. package/dist/types/server/serialize.d.ts.map +1 -1
  207. package/dist/types/utils/dom.d.ts +2 -1
  208. package/dist/types/utils/events.d.ts +6 -6
  209. package/dist/types/utils/events.d.ts.map +1 -1
  210. package/dist/types/utils/global-obj.d.ts +1 -1
  211. package/dist/types/utils/global-obj.d.ts.map +1 -1
  212. package/dist/types/utils/id.d.ts.map +1 -1
  213. package/dist/types/utils/logger.d.ts +2 -1
  214. package/dist/types/utils/logger.d.ts.map +1 -1
  215. package/dist/types/utils/node-tree/get-next-node-from-action.d.ts +2 -1
  216. package/dist/types/utils/node-tree/get-next-node-from-condition.d.ts +2 -1
  217. package/dist/types/utils/node-tree/get-next-node.d.ts +1 -1
  218. package/dist/types/utils/node-tree/get-next-node.d.ts.map +1 -1
  219. package/dist/types/utils/node-tree/get-origin-node.d.ts +1 -1
  220. package/dist/types/utils/node-tree/get-origin-node.d.ts.map +1 -1
  221. package/dist/types/utils/node-tree/min-max-steps-to-leaf.d.ts +1 -1
  222. package/dist/types/utils/node-tree/min-max-steps-to-leaf.d.ts.map +1 -1
  223. package/dist/types/utils/node-tree/min-max-steps-to-origin.d.ts +1 -1
  224. package/dist/types/utils/node-tree/min-max-steps-to-origin.d.ts.map +1 -1
  225. package/dist/types/utils/node-tree/next-reachable-step-nodes.d.ts +1 -1
  226. package/dist/types/utils/node-tree/next-reachable-step-nodes.d.ts.map +1 -1
  227. package/dist/types/utils/nodes.d.ts +1 -1
  228. package/dist/types/utils/picked-config.d.ts +2 -1
  229. package/dist/types/utils/rehydrate-scripts.d.ts +6 -0
  230. package/dist/types/utils/rehydrate-scripts.d.ts.map +1 -1
  231. package/dist/types/utils/rules-logic.d.ts +6 -2
  232. package/dist/types/utils/storage.d.ts +1 -1
  233. package/dist/types/utils/storage.d.ts.map +1 -1
  234. package/package.json +22 -23
  235. package/dist/api-CPL40b7A.js +0 -40
  236. package/dist/api-Dz5rgRgQ.cjs +0 -1
  237. package/dist/docs/actions.mdx +0 -78
  238. package/dist/docs/api/authentication.md +0 -376
  239. package/dist/docs/api/error-handling.md +0 -211
  240. package/dist/docs/api/index.md +0 -197
  241. package/dist/docs/api-keys.mdx +0 -40
  242. package/dist/docs/chrome-extension.md +0 -51
  243. package/dist/docs/conditions.mdx +0 -59
  244. package/dist/docs/content/asset-library.mdx +0 -93
  245. package/dist/docs/content/content-entries.mdx +0 -30
  246. package/dist/docs/content/layouts.mdx +0 -70
  247. package/dist/docs/content/pages.mdx +0 -67
  248. package/dist/docs/content/sections.mdx +0 -33
  249. package/dist/docs/delivery-api/index.md +0 -46
  250. package/dist/docs/delivery-api/preview-caching-crawling.md +0 -59
  251. package/dist/docs/experiences.mdx +0 -42
  252. package/dist/docs/features.mdx +0 -58
  253. package/dist/docs/fields.mdx +0 -79
  254. package/dist/docs/flow-builder/building-flows.md +0 -61
  255. package/dist/docs/flow-builder/condition-builder.md +0 -54
  256. package/dist/docs/flow-builder/keyboard-shortcuts.md +0 -66
  257. package/dist/docs/flow-builder/nodes.md +0 -43
  258. package/dist/docs/flow-builder/overview.mdx +0 -50
  259. package/dist/docs/gtm-template.md +0 -69
  260. package/dist/docs/guides/build-a-personalized-page.mdx +0 -143
  261. package/dist/docs/image-optimisation-service.md +0 -80
  262. package/dist/docs/mcp.md +0 -120
  263. package/dist/docs/pickedql/data-sources.md +0 -145
  264. package/dist/docs/pickedql/dimensions.md +0 -65
  265. package/dist/docs/pickedql/index.md +0 -36
  266. package/dist/docs/pickedql/schema.md +0 -156
  267. package/dist/docs/pickedql/virtual-functions.md +0 -204
  268. package/dist/docs/projects.mdx +0 -37
  269. package/dist/docs/reports.mdx +0 -18
  270. package/dist/docs/sdk/actions.md +0 -66
  271. package/dist/docs/sdk/content-security-policy.md +0 -32
  272. package/dist/docs/sdk/experiences.md +0 -46
  273. package/dist/docs/sdk/features.md +0 -212
  274. package/dist/docs/sdk/fields.md +0 -263
  275. package/dist/docs/sdk/index.md +0 -83
  276. package/dist/docs/sdk/plugins/dynamic-experiences.md +0 -58
  277. package/dist/docs/sdk/plugins/index.md +0 -9
  278. package/dist/docs/sdk/predicates.md +0 -112
  279. package/dist/docs/sdk/ssr/index.md +0 -62
  280. package/dist/docs/sdk/ssr/rendering-and-hydration.md +0 -141
  281. package/dist/docs/sdk/ssr/serialize.md +0 -86
  282. package/dist/docs/sdk/ssr/slots-and-placements.md +0 -35
  283. package/dist/docs/sdk/steps.md +0 -434
  284. package/dist/docs/steps.mdx +0 -44
  285. package/dist/docs/team-management.md +0 -40
  286. package/dist/docs/vite-plugin.md +0 -82
  287. package/dist/docs/workspace-versioning.mdx +0 -28
  288. package/dist/docs/workspaces.mdx +0 -102
  289. package/dist/experience-instance-DurC3pE-.cjs +0 -1
  290. package/dist/plugin-CFXwbXeM.js +0 -247
  291. package/dist/plugin-m4qekgtA.cjs +0 -1
@@ -0,0 +1,42 @@
1
+ ---
2
+ type: how-to
3
+ layout: docs
4
+ ---
5
+
6
+ # How to create an experience
7
+
8
+ An experience is a Flow or a Page. This guide adds a **Flow**: the interactive kind, of
9
+ more than one step, which the browser renders. A **Page** is the standalone kind that your
10
+ server renders for a search engine, and
11
+ [How to fill and publish a page](/how-to/fill-and-publish-a-page) covers it.
12
+
13
+ [About pages and flows](/explanation/pages-and-flows) sets out the difference, and which
14
+ kind a piece of work needs.
15
+
16
+ ## Steps
17
+
18
+ 1. Open your project.
19
+ 2. Click **Flows** in the sidebar. The experiences list opens.
20
+ 3. Click **New experience**.
21
+ 4. Enter a name.
22
+ 5. Leave **Type** on the **Flow** option.
23
+ 6. Open **Advanced**.
24
+ 7. Enter a component name. It must match a component that you register in your
25
+ application.
26
+ 8. Click **Create flow**.
27
+
28
+ The flow editor opens with an empty canvas.
29
+
30
+ ## Set the options
31
+
32
+ Click the canvas background to open the experience inspector.
33
+
34
+ - **Condition** — the experience starts only for a visitor who matches it. Keep it blank
35
+ to start for every visitor.
36
+ - **Initialize Open** — the experience opens by itself when the page loads.
37
+
38
+ ## Related
39
+
40
+ - [How to build a flow](/how-to/build-a-flow) — add your first node.
41
+ - [About pages and flows](/explanation/pages-and-flows) — Page or Flow.
42
+ - [Experiences](/reference/dashboard/experiences) — every option.
@@ -0,0 +1,37 @@
1
+ ---
2
+ type: how-to
3
+ layout: docs
4
+ ---
5
+
6
+ # How to create and revoke an API key
7
+
8
+ This guide shows you how to give your code access to the Picked API. Use a key for a
9
+ server-side integration or for a CI/CD workflow.
10
+
11
+ ## Create a key
12
+
13
+ 1. Open your organization.
14
+ 2. Click **API Keys**.
15
+ 3. Click **Create API Key**.
16
+ 4. Enter a **Name**, such as `Production key`.
17
+ 5. Set **Project** to one project. The default, **All projects**, gives the key every
18
+ project.
19
+ 6. Choose the **Permissions** that your integration needs.
20
+ 7. Click **Create API Key**.
21
+
22
+ :::warning
23
+ Copy the key immediately. The dashboard does not show it again.
24
+ :::
25
+
26
+ ## Revoke a key
27
+
28
+ 1. Open the API keys list.
29
+ 2. Click **Revoke** next to the key.
30
+ 3. Click **Revoke Key** to confirm.
31
+
32
+ Picked invalidates the key immediately. No later request can use it.
33
+
34
+ ## Related
35
+
36
+ - [API keys](/reference/dashboard/api-keys) — the scopes.
37
+ - [Authentication](/reference/management-api/authentication) — how to send the key.
@@ -0,0 +1,57 @@
1
+ ---
2
+ type: how-to
3
+ layout: docs
4
+ ---
5
+
6
+ # How to debug with the Chrome extension
7
+
8
+ This guide shows you how to add a Picked panel to Chrome DevTools and check your
9
+ integration on any page that runs the SDK.
10
+
11
+ ## 1. Install the extension
12
+
13
+ Install it from the
14
+ [Chrome Web Store](https://chromewebstore.google.com/detail/picked-developer-tools/nimmdamgnhlhdpngnalkpmnleebngidh).
15
+
16
+ ## 2. Add the devtools plugin
17
+
18
+ ```typescript
19
+ import { createClient } from '@picked/client'
20
+ import { svelteDevtoolsPlugin } from '@picked/svelte/plugins/devtools'
21
+
22
+ const picked = createClient({
23
+ projectId: 'your-project-id',
24
+ plugins: [svelteDevtoolsPlugin()],
25
+ })
26
+ ```
27
+
28
+ The extension then connects to the SDK.
29
+
30
+ ## 3. Add a tool of your own
31
+
32
+ A custom tool is a framework-adapted component, and it receives the live Picked client
33
+ exactly as an experience component does.
34
+
35
+ ```typescript
36
+ import { adaptReactComponent } from '@picked/react'
37
+ import { svelteDevtoolsPlugin } from '@picked/svelte/plugins/devtools'
38
+ import MyTool from './MyTool'
39
+
40
+ const picked = createClient({
41
+ projectId: 'your-project-id',
42
+ plugins: [
43
+ svelteDevtoolsPlugin({
44
+ customTools: [
45
+ { id: 'my-tool', label: 'My Tool', component: adaptReactComponent(MyTool) },
46
+ ],
47
+ }),
48
+ ],
49
+ })
50
+ ```
51
+
52
+ Your tools appear under a **Custom Tools** tab. In React use `usePicked()`, and in Svelte
53
+ use `getPicked()`.
54
+
55
+ ## Related
56
+
57
+ - [Chrome extension](/reference/tools/chrome-extension) — the panel reference.
@@ -0,0 +1,39 @@
1
+ ---
2
+ type: how-to
3
+ layout: docs
4
+ ---
5
+
6
+ # How to define a page layout
7
+
8
+ This guide shows you how to define the shape of a page. A layout sets which fields a page
9
+ can hold, and it holds no data itself.
10
+
11
+ ## Steps
12
+
13
+ 1. Open your workspace.
14
+ 2. Click **Pages** in the sidebar, then **Page Layouts**.
15
+ 3. Click **New model**.
16
+ 4. Set **Category** to **Page layout**.
17
+ 5. Enter a **Name** and a **Key**. The key is stable, and your SDK code and your API
18
+ calls both use it.
19
+ 6. Add your fields. Choose a type for each one.
20
+ 7. Click **Create model**.
21
+
22
+ The category is fixed when you create the layout. You cannot change it later.
23
+
24
+ ## Make a field repeatable
25
+
26
+ Turn on **repeatable** on any field. It then renders as a sortable list of values. Use it
27
+ for a gallery, or for a list of features.
28
+
29
+ ## Group related fields
30
+
31
+ Add a **Group** field to hold a set of fields under one key. Make the group repeatable to
32
+ describe a list of objects, such as a list of feature cards.
33
+
34
+ ## Related
35
+
36
+ - [About the content model](/explanation/the-content-model) — why the schema and the data
37
+ are separate.
38
+ - [Page and step layouts](/reference/dashboard/content/layouts) — every field type.
39
+ - [How to reuse a section](/how-to/reuse-a-section).
@@ -0,0 +1,50 @@
1
+ ---
2
+ type: how-to
3
+ layout: docs
4
+ ---
5
+
6
+ # How to fill and publish a page
7
+
8
+ This guide shows you how to make a server-rendered Page and put content in it. You need a
9
+ page layout first. See [How to define a page layout](/how-to/define-a-page-layout).
10
+
11
+ ## 1. Create the page
12
+
13
+ 1. Open your project.
14
+ 2. Choose a workspace.
15
+ 3. Click **Pages** in the sidebar.
16
+ 4. Click **New experience**.
17
+ 5. Choose the **Page** type.
18
+ 6. Choose a page layout.
19
+ 7. Click **Create page**.
20
+
21
+ Picked makes a content entry and links it to the page on the first save.
22
+
23
+ ## 2. Fill in the content
24
+
25
+ 1. Open the **Properties** tab.
26
+ 2. Fill in each field. The inspector on the right edits the field that you choose.
27
+ 3. Watch the preview panel as the page fills in.
28
+
29
+ ## 3. Correct every error
30
+
31
+ An invalid field shows an error next to it while you edit. Correct each one before you
32
+ publish. Picked serves valid content only.
33
+
34
+ ## 4. Publish
35
+
36
+ Publish the workspace to make the page live. See
37
+ [How to publish a workspace](/how-to/publish-a-workspace).
38
+
39
+ ## Change the layout later
40
+
41
+ Use the change-layout control on the **Settings** tab. When you unlink a layout, Picked
42
+ separates the content entry from the page. It deletes no entry, but the page then has no
43
+ content to render.
44
+
45
+ ## Related
46
+
47
+ - [About pages and flows](/explanation/pages-and-flows) — when to choose a Page.
48
+ - [Your first server-rendered page](/tutorials/first-server-rendered-page) — the whole
49
+ path, with the SDK.
50
+ - [Pages](/reference/dashboard/content/pages) — the editor reference.
@@ -0,0 +1,84 @@
1
+ ---
2
+ type: how-to
3
+ layout: docs
4
+ ---
5
+
6
+ # How to install the GTM template
7
+
8
+ This guide shows you how to track an ecommerce event in Google Tag Manager and send it to
9
+ Picked. You need a GTM container and your Picked Tag ID.
10
+
11
+ ## Automatic installation
12
+
13
+ Install the template from the GTM Community Gallery:
14
+
15
+ 1. In Tag Manager, click **Templates**.
16
+ 2. In the **Tag Templates** section, click **Search Gallery**.
17
+ 3. Search for `Picked Ecommerce`.
18
+ 4. Click the Picked Ecommerce template to read its detail.
19
+ 5. Click the **Add to workspace** button.
20
+ 6. Read the permissions that it needs.
21
+ 7. Click **Add**.
22
+
23
+ ![The Picked Ecommerce template in the GTM Community Gallery](/gtm/picked-ecommerce-gtm.png)
24
+
25
+ ## Manual installation
26
+
27
+ To import the template file yourself:
28
+
29
+ 1. Download the
30
+ [template file](https://github.com/picked-app/gtm-template/blob/main/template.tpl)
31
+ from GitHub with the download icon.
32
+ 2. In Google Tag Manager, go to **Templates**.
33
+ 3. Click **New**.
34
+ 4. Open the three-dot menu.
35
+ 5. Click **Import**.
36
+ 6. Choose the file that you downloaded.
37
+ 7. Click **Save**.
38
+
39
+ ## Setup
40
+
41
+ ### 1. Create a Tag ID variable
42
+
43
+ Sign in to the [Picked Dashboard](https://dashboard.picked.app) and copy the Tag ID of
44
+ your project. Save it as a constant variable in GTM, for example `Picked Tag ID`.
45
+
46
+ ![How to create a variable in GTM for the Picked Tag ID](/gtm/gtm-variable.png)
47
+
48
+ ### 2. Create an ecommerce data variable
49
+
50
+ Create a **Data Layer Variable** with the variable name `ecommerce`. It captures what
51
+ GA4 Enhanced Ecommerce writes to the data layer.
52
+
53
+ ![The variable for the data layer of GA4 Enhanced Ecommerce](/gtm/gtm-ecommerce-variable.png)
54
+
55
+ ### 3. Create event triggers
56
+
57
+ Add a trigger for each ecommerce event that you want to track, for example
58
+ `add_to_cart`, `purchase`, or `view_item`.
59
+
60
+ ![The event triggers that record an ecommerce event](/gtm/gtm-triggers.png)
61
+
62
+ ### 4. Create tags
63
+
64
+ Create a new tag for each event. Choose the tag template called **Picked Ecommerce**. Assign
65
+ the trigger that matches. Then set the options below.
66
+
67
+ ![The tags that use the Picked Ecommerce template](/gtm/gtm-tags.png)
68
+
69
+ ## Options
70
+
71
+ | Option | Description |
72
+ | --- | --- |
73
+ | **Tag ID** | The Tag ID of your Picked project. Find it in the [Picked Dashboard](https://dashboard.picked.app). |
74
+ | **Event** | The ecommerce event to track, for example `add_to_cart` or `purchase`. |
75
+ | **Send ecommerce data** | Turn this on to send the data from GA4 Enhanced Ecommerce to Picked. Turn it on for every ecommerce event. |
76
+ | **GA4 Enhanced Ecommerce Data** | The GTM variable that holds the data from GA4 Enhanced Ecommerce. Use the data layer variable from step 2. |
77
+ | **Additional data** | An optional GTM variable, for more metadata with the event. |
78
+
79
+ ![The options on a Picked Ecommerce tag](/gtm/gtm-tag.png)
80
+
81
+ ## Related
82
+
83
+ - [About how Picked works](/explanation/how-picked-works) — what Picked does with the
84
+ event.
@@ -0,0 +1,68 @@
1
+ ---
2
+ type: how-to
3
+ layout: docs
4
+ ---
5
+
6
+ # How to install the SDK
7
+
8
+ This guide shows you how to add the Picked client to a web application. You need a project
9
+ ID from the dashboard.
10
+
11
+ ## 1. Install the packages
12
+
13
+ :::code-group
14
+
15
+ ```bash [React]
16
+ npm install @picked/client @picked/react effector effector-react
17
+ ```
18
+
19
+ ```bash [Svelte]
20
+ npm install @picked/client @picked/svelte effector
21
+ ```
22
+
23
+ :::
24
+
25
+ ## 2. Create and start the client
26
+
27
+ :::code-group
28
+
29
+ ```tsx [React]
30
+ import { createClient } from '@picked/client'
31
+ import { dynamicExperiencesPlugin } from '@picked/client/plugins/dynamic-experiences'
32
+ import { reactFrameworkPlugin } from '@picked/react/plugins/framework'
33
+
34
+ export const picked = createClient({
35
+ projectId: 'your-project-id',
36
+ plugins: [reactFrameworkPlugin({ components: {} }), dynamicExperiencesPlugin()],
37
+ })
38
+
39
+ picked.start()
40
+ ```
41
+
42
+ ```ts [Svelte]
43
+ import { createClient } from '@picked/client'
44
+ import { dynamicExperiencesPlugin } from '@picked/client/plugins/dynamic-experiences'
45
+ import { svelteFrameworkPlugin } from '@picked/svelte/plugins/framework'
46
+
47
+ export const picked = createClient({
48
+ projectId: 'your-project-id',
49
+ plugins: [svelteFrameworkPlugin({ components: {} }), dynamicExperiencesPlugin()],
50
+ })
51
+
52
+ picked.start()
53
+ ```
54
+
55
+ :::
56
+
57
+ `start()` is idempotent. A second call changes nothing on a client that started already.
58
+
59
+ ## 3. Add the optional plugins
60
+
61
+ - `windowObjectPlugin()` puts the client on `window.Picked`, which helps when you debug.
62
+ - `singlePageAppPlugin()` starts the client again on a history event.
63
+
64
+ ## Related
65
+
66
+ - [Add Picked to your application](/tutorials/first-experience) — the whole path.
67
+ - [SDK installation](/reference/sdk) — every client option.
68
+ - [How to register a component](/how-to/register-a-component).
@@ -0,0 +1,56 @@
1
+ ---
2
+ type: how-to
3
+ layout: docs
4
+ ---
5
+
6
+ # How to install the Vite plugin
7
+
8
+ This guide shows you how to embed your project configuration at build time, so the SDK makes no
9
+ API request at runtime.
10
+
11
+ ## 1. Install
12
+
13
+ :::code-group
14
+
15
+ ```bash [npm]
16
+ npm install @picked/vite-plugin-picked
17
+ ```
18
+
19
+ ```bash [pnpm]
20
+ pnpm add @picked/vite-plugin-picked
21
+ ```
22
+
23
+ ```bash [yarn]
24
+ yarn add @picked/vite-plugin-picked
25
+ ```
26
+
27
+ :::
28
+
29
+ ## 2. Add it to your config
30
+
31
+ ```typescript
32
+ import { defineConfig } from 'vite'
33
+ import { picked } from '@picked/vite-plugin-picked'
34
+
35
+ export default defineConfig({
36
+ plugins: [
37
+ picked({
38
+ projectId: 'your-project-id',
39
+ }),
40
+ ],
41
+ })
42
+ ```
43
+
44
+ When Vite starts, the plugin reads your project configuration and embeds them in your bundle.
45
+ The SDK then reads the embedded configuration and makes no network request.
46
+
47
+ :::note
48
+ When a preview token is there at runtime, the SDK ignores the embedded configuration and reads
49
+ fresh data from the API.
50
+ :::
51
+
52
+ ## Related
53
+
54
+ - [Vite plugin](/reference/tools/vite-plugin) — every option.
55
+ - [About how Picked works](/explanation/how-picked-works) — where build-time configuration sit
56
+ in the startup order.
@@ -0,0 +1,34 @@
1
+ ---
2
+ type: how-to
3
+ layout: docs
4
+ ---
5
+
6
+ # How to invite and remove members
7
+
8
+ This guide shows you how to control who reaches your organization.
9
+
10
+ ## Invite a member
11
+
12
+ 1. Open your organization.
13
+ 2. Click **Members**.
14
+ 3. Click **Invite member**.
15
+ 4. Enter an email address.
16
+ 5. Choose a role. Give the smallest role that the work needs.
17
+ 6. Click **Send invitation**.
18
+
19
+ The person receives an email with a link to join. A person with no Picked account must
20
+ create one first.
21
+
22
+ ## Remove a member
23
+
24
+ 1. Open your organization.
25
+ 2. Click **Members**.
26
+ 3. Find the member.
27
+ 4. Click **Remove** next to the name.
28
+ 5. Confirm.
29
+
30
+ The member loses access to every project in the organization immediately.
31
+
32
+ ## Related
33
+
34
+ - [Team management](/reference/dashboard/team-management) — the roles.
@@ -0,0 +1,28 @@
1
+ ---
2
+ type: how-to
3
+ layout: docs
4
+ ---
5
+
6
+ # How to see a preview of a workspace
7
+
8
+ This guide shows you how to see an unpublished change on your own site before your
9
+ visitors get it. You need a draft workspace with at least one change in it.
10
+
11
+ ## Steps
12
+
13
+ 1. Click **Preview** in the workspace toolbar.
14
+ 2. Enter the URL of your site.
15
+ 3. Set each feature flag to the **Default** value, to **On**, or to **Off**. This step
16
+ is optional.
17
+ 4. Click **Open preview**.
18
+
19
+ Your site opens in a new tab with the unpublished workspace applied.
20
+
21
+ The preview sends the workspace state to the SDK in the query parameters. The visitors on
22
+ your live site therefore see no change.
23
+
24
+ ## Related
25
+
26
+ - [About workspaces and versions](/explanation/workspaces-and-versions) — why a preview
27
+ cannot reach production.
28
+ - [Workspaces](/reference/dashboard/workspaces) — the workspace states.
@@ -0,0 +1,30 @@
1
+ ---
2
+ type: how-to
3
+ layout: docs
4
+ ---
5
+
6
+ # How to publish a workspace
7
+
8
+ This guide shows you how to make the changes in a workspace live. You need a draft
9
+ workspace with at least one unpublished change.
10
+
11
+ The **Publish** button is active only when the workspace holds an unpublished change. A
12
+ badge in the toolbar shows the current state.
13
+
14
+ ## Steps
15
+
16
+ 1. Click **Publish** in the workspace toolbar.
17
+ 2. Read the change preview in the publish modal.
18
+ 3. Expand any modified row to see which properties changed.
19
+ 4. Read the banner above the diff, if one is there. It reports a change that breaks
20
+ another record.
21
+ 5. Click **Publish** to confirm.
22
+
23
+ Picked makes an immutable snapshot of your workspace, and the SDK serves it to your
24
+ visitors.
25
+
26
+ ## Related
27
+
28
+ - [About workspaces and versions](/explanation/workspaces-and-versions) — why the modal
29
+ shows a diff.
30
+ - [How to roll back a published version](/how-to/roll-back-a-published-version).
@@ -0,0 +1,101 @@
1
+ ---
2
+ type: how-to
3
+ layout: docs
4
+ ---
5
+
6
+ # How to read a feature flag
7
+
8
+ This guide shows you how to read the resolved bucket of a feature flag in your
9
+ application. You need a feature flag in your project first, either from the dashboard or
10
+ [defined in SDK code](/reference/sdk/features#define-a-feature-flag-in-sdk-code).
11
+
12
+ Which accessor you pick decides *when* the visitor enters the test, so read
13
+ [About feature flag allocation](/explanation/feature-flag-allocation) before you choose.
14
+
15
+ ## 1. Choose an accessor
16
+
17
+ Each accessor returns a different value, and they differ in whether a read resolves the
18
+ feature flag. A read that resolves the feature flag commits the visitor to a bucket and reports the
19
+ decision.
20
+
21
+ | API | Returns | Does a read resolve the feature flag? |
22
+ | --- | --- | --- |
23
+ | `useFeature` / `getFeature` | `() => Promise<bucket>` | Only when you call the function that it returns |
24
+ | `useFeatureResult` / `getFeatureResult` | `{ id, bucket }`, and `undefined` until it resolves | Yes, as soon as the component renders |
25
+ | `useFeatureEnabled` / `getFeatureEnabled` | `boolean \| undefined`, the dashboard **Enabled** feature flag | No |
26
+ | `client.features.listStore` | Every registered feature flag, each with an `isResolved` feature flag | No |
27
+ | `client.features.getById(id)` | A store that holds one feature flag | No |
28
+
29
+ Some decisions must wait for data that you do not have yet, such as a cart, a quote, or
30
+ the profile of a signed-in user. For those, use `useFeature` or `getFeature`. Call the
31
+ function they return after the data arrives.
32
+
33
+ ## 2. Read the bucket
34
+
35
+ :::code-group
36
+
37
+ ```tsx [React]
38
+ import { useFeatureResult } from '@picked/react/hooks'
39
+
40
+ function MyComponent() {
41
+ // { id, bucket }, or undefined until the feature flag resolves.
42
+ const result = useFeatureResult('my-feature')
43
+
44
+ return (
45
+ <div>
46
+ {result?.bucket === 'control' && <p>Control</p>}
47
+ {result?.bucket === 'variant-a' && <p>Variant A</p>}
48
+ </div>
49
+ )
50
+ }
51
+ ```
52
+
53
+ ```svelte [Svelte]
54
+ <script lang="ts">
55
+ import { getFeatureResult } from '@picked/svelte/hooks'
56
+
57
+ // A store that holds { id, bucket }, or undefined until the feature flag resolves.
58
+ const result = getFeatureResult('my-feature')
59
+ </script>
60
+
61
+ {#if $result?.bucket === 'control'}
62
+ <p>Control</p>
63
+ {:else if $result?.bucket === 'variant-a'}
64
+ <p>Variant A</p>
65
+ {/if}
66
+ ```
67
+
68
+ :::
69
+
70
+ :::warning
71
+ `useFeatureResult` and `getFeatureResult` resolve the feature flag as soon as the component
72
+ renders, and they commit the visitor to a bucket at that moment.
73
+ :::
74
+
75
+ ## 3. Read it without a framework
76
+
77
+ The event bus works with any framework, and with none:
78
+
79
+ ```ts
80
+ import { createClient } from '@picked/client'
81
+
82
+ const client = createClient({
83
+ /* Put your client options here. */
84
+ })
85
+
86
+ client.eventBus.watch((event) => {
87
+ if (event.type === 'feature_decide' && event.feature.id === 'my-feature') {
88
+ console.log(event.feature) // { id: 'my-feature', key: 'v1', bucket: 'control' }
89
+ }
90
+ })
91
+ ```
92
+
93
+ `feature_decide` fires only when the SDK makes a new decision. A visitor who returns
94
+ restores the decision from storage and fires nothing, so watch
95
+ `client.features.listStore` when you need the current state instead.
96
+
97
+ ## Related
98
+
99
+ - [About feature flag allocation](/explanation/feature-flag-allocation) — when the
100
+ visitor enters the test.
101
+ - [SDK feature flags](/reference/sdk/features) — the definition shape and the overrides.
@@ -0,0 +1,55 @@
1
+ ---
2
+ type: how-to
3
+ layout: docs
4
+ ---
5
+
6
+ # How to register a component
7
+
8
+ This guide shows you how to connect a component in your application to an experience in
9
+ the dashboard.
10
+
11
+ ## Steps
12
+
13
+ 1. Wrap your component with the adapter for your framework.
14
+ 2. Pass it in the `components` object of `createClient()`.
15
+ 3. Use the same key as the component name of the experience.
16
+
17
+ :::code-group
18
+
19
+ ```tsx [React]
20
+ import { createClient } from '@picked/client'
21
+ import { adaptReactComponent } from '@picked/react'
22
+ import { MyWidget } from './MyWidget'
23
+
24
+ const picked = createClient({
25
+ projectId: 'your-project-id',
26
+ components: {
27
+ MyWidget: adaptReactComponent(MyWidget),
28
+ },
29
+ })
30
+ ```
31
+
32
+ ```ts [Svelte]
33
+ import { createClient } from '@picked/client'
34
+ import { adaptSvelteComponent } from '@picked/svelte'
35
+ import MyWidget from './MyWidget.svelte'
36
+
37
+ const picked = createClient({
38
+ projectId: 'your-project-id',
39
+ components: {
40
+ MyWidget: adaptSvelteComponent(MyWidget),
41
+ },
42
+ })
43
+ ```
44
+
45
+ :::
46
+
47
+ :::warning
48
+ `components` takes an adapted component. A plain React or Svelte component does not work
49
+ without `adaptReactComponent` or `adaptSvelteComponent`.
50
+ :::
51
+
52
+ ## Related
53
+
54
+ - [SDK experiences](/reference/sdk/experiences) — the experience shape.
55
+ - [How to install the SDK](/how-to/install-the-sdk).