@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,37 @@
1
+ ---
2
+ type: reference
3
+ layout: docs
4
+ ---
5
+
6
+ import { Screenshot } from '../../../../components/Screenshot'
7
+
8
+ # Steps
9
+
10
+ A step is one screen or card that a visitor sees during an experience. Each step
11
+ holds one or more fields. A field collects data or shows content.
12
+
13
+ <Screenshot
14
+ route="/{orgSlug}/{projectId}/workspaces/{workspaceId}/steps"
15
+ alt="The steps list for a workspace on the Picked dashboard"
16
+ />
17
+
18
+ ## Set up a step
19
+
20
+ **Name**: The name that the dashboard shows. Your visitors do not see it.
21
+
22
+ **Key**: The identifier that your application uses for this step. Your
23
+ visitors do not see it.
24
+
25
+ **Layout Name**: The name of the component layout that renders this step. Examples
26
+ are `card`, `modal`, and `fullscreen`.
27
+
28
+ A step can also carry a **Step Layout**. A step layout is a reusable CMS schema, and
29
+ it gives the step a Content Entry. See [Page and Step Layouts](/reference/dashboard/content/layouts).
30
+
31
+ ## Related
32
+
33
+ - [How to add a step, a field, an action, or a condition](/how-to/add-a-step-field-or-action)
34
+
35
+ - [How to build a flow](/how-to/build-a-flow) — add a step and assign fields to it.
36
+ - [How to reuse a step, a field, or an action](/how-to/reuse-a-step-field-or-action)
37
+ - [Page and step layouts](/reference/dashboard/content/layouts) — the step layout schema.
@@ -0,0 +1,29 @@
1
+ ---
2
+ type: reference
3
+ layout: docs
4
+ ---
5
+
6
+ # Team management
7
+
8
+ Control who can reach your organization and what each person can do. An organization
9
+ is the top-level container for your projects and members.
10
+
11
+ ## Organizations
12
+
13
+ An organization groups your projects, your members, and your settings. You can belong
14
+ to more than one organization.
15
+
16
+ To move between organizations, use the organization control at the top of the
17
+ sidebar.
18
+
19
+ ## Roles and permissions
20
+
21
+ Each member holds a role, and the role controls what the member can reach. A role
22
+ decides whether a member can create a project, edit an experience, control other
23
+ members, or read a report.
24
+
25
+ Give each member the smallest role that the work of that member needs.
26
+
27
+ ## Related
28
+
29
+ - [How to invite and remove members](/how-to/invite-and-remove-members)
@@ -0,0 +1,30 @@
1
+ ---
2
+ type: reference
3
+ layout: docs
4
+ ---
5
+
6
+ import { Screenshot } from '../../../../components/Screenshot'
7
+
8
+ # Workspace versioning
9
+
10
+ When you publish, Picked makes an immutable snapshot of your workspace. A project
11
+ always serves exactly one version, the *live* version. A roll-back moves the live
12
+ pointer of the project to an earlier snapshot. It changes no data.
13
+
14
+ <Screenshot
15
+ route="/{orgSlug}/{projectId}/publish-history"
16
+ alt="The Publish history page with published workspace versions and the Live and Restore actions"
17
+ hide={['[data-testid="version-row-relative-time"]']}
18
+ />
19
+
20
+ ## Publish history
21
+
22
+ The **Publish history** page lists each published version of every workspace in the
23
+ project, the newest first. The version that Picked serves now carries a **Live**
24
+ badge.
25
+
26
+ ## Related
27
+
28
+ - [About workspaces and versions](/explanation/workspaces-and-versions) — why a roll-back
29
+ changes no data.
30
+ - [How to roll back a published version](/how-to/roll-back-a-published-version)
@@ -0,0 +1,76 @@
1
+ ---
2
+ type: reference
3
+ layout: docs
4
+ ---
5
+
6
+ import { Screenshot } from '../../../../components/Screenshot'
7
+
8
+ # Workspaces
9
+
10
+ A workspace is one version of the configuration of your project. Use a workspace to hold
11
+ a change, to see a preview of it, and to publish it when it is ready.
12
+
13
+ <Screenshot
14
+ route="/{orgSlug}/{projectId}/workspaces"
15
+ alt="The workspaces list inside a project on the Picked dashboard"
16
+ hide={['[data-testid="workspace-row-relative-time"]']}
17
+ />
18
+
19
+ ## How workspaces work
20
+
21
+ Each project has a workspace that holds your experiences, feature flags, steps, fields,
22
+ actions, and conditions. When you make a change in the dashboard, that change stays in
23
+ the workspace until you publish it. A change to a flow, to a feature flag, or to a step
24
+ all behave the same way.
25
+
26
+ A workspace is in one of three states:
27
+
28
+ - **Live** — the workspace that the SDK serves to your visitors. Each project has
29
+ exactly one live workspace.
30
+ - **Draft** — a workspace that no visitor sees. You can edit a draft, see a preview
31
+ of it, and publish it to make it live.
32
+ - **Archived** — a draft that you put to one side. An archived workspace is still
33
+ editable, but it does not appear in the default workspaces list.
34
+
35
+ ## Change previews
36
+
37
+ The publish modal shows a side-by-side change preview. It compares the current
38
+ workspace against the last published snapshot. Use it to see exactly what your
39
+ visitors get after you publish.
40
+
41
+ <Screenshot
42
+ route="/{orgSlug}/{projectId}/workspaces/{workspaceId}/experiences?action=publish"
43
+ alt="The publish modal with a change preview of added experiences, steps, and conditions"
44
+ selector='[role="dialog"]'
45
+ wait='[role="dialog"]'
46
+ hide={['[data-testid="publish-diff-replaces-version"]']}
47
+ renderWidth={720}
48
+ renderHeight={579}
49
+ />
50
+
51
+ The preview puts the changes into groups: experiences, feature flags, steps, fields,
52
+ actions, and conditions. Each row shows whether the record was **added**, **removed**,
53
+ or **modified**. For a modified record, expand the row to see which properties changed.
54
+
55
+ Some changes break other records. An example is a field that you remove while other
56
+ steps still point at it. The change preview shows a banner above the diff for these
57
+ entries, so that you can look at them again before you publish.
58
+
59
+ The first publish of a workspace has no earlier snapshot to compare against. The
60
+ publish modal shows the contents of the workspace as the first publish, with no diff.
61
+
62
+ ## Unpublished changes
63
+
64
+ The workspace records whether anything changed since the last publish. The toolbar then
65
+ shows a warning badge. It counts a change to any of these:
66
+
67
+ - An experience or a feature flag.
68
+ - A step, a field, an action, or a condition.
69
+
70
+ ## Related
71
+
72
+ - [About workspaces and versions](/explanation/workspaces-and-versions) — why a draft and
73
+ a version are separate.
74
+ - [How to see a preview of a workspace](/how-to/preview-a-workspace)
75
+ - [How to publish a workspace](/how-to/publish-a-workspace)
76
+ - [How to archive or delete a workspace](/how-to/archive-or-delete-a-workspace)
@@ -1,4 +1,5 @@
1
1
  ---
2
+ type: reference
2
3
  layout: docs
3
4
  ---
4
5
 
@@ -16,7 +17,7 @@ GET /api/v1/projects/:projectId/experiences/:id/content
16
17
  | --- | --- | --- |
17
18
  | `projectId` | path | The project the experience belongs to. |
18
19
  | `id` | path | The experience to fetch content for. |
19
- | `preview_token` | query | Optional. Returns preview (unpublished) content when present. |
20
+ | `preview_token` | query | Optional. With it, the endpoint returns preview content, which is unpublished. |
20
21
 
21
22
  ## Response
22
23
 
@@ -40,11 +41,14 @@ GET /api/v1/projects/:projectId/experiences/:id/content
40
41
  | `versionId` | `string \| null` | The published version id, or `null` on preview. |
41
42
  | `content[].id` | `string` | The Content Entry id. |
42
43
  | `content[].contentModelKey` | `string \| null` | The layout's Key, or `null` when it cannot be resolved. |
43
- | `content[].data` | `object` | The entry data, matching the layout schema. |
44
+ | `content[].data` | `object` | The entry data. It matches the layout schema. |
44
45
 
45
- ## HTML asset inlining
46
+ ## An HTML asset comes back in the response
46
47
 
47
- When the layout has an [HTML asset](/content/asset-library) field, its value arrives inlined. The reference is rewritten to `{ id, content }`, where `content` is the uploaded HTML as a string (or `null` when it cannot be resolved):
48
+ A layout can have an [HTML asset](/reference/dashboard/content/asset-library) field. The value of that
49
+ field arrives inside the response. The endpoint changes the reference to
50
+ `{ id, content }`. There, `content` holds the HTML that you uploaded, as a string. It
51
+ is `null` when the endpoint cannot resolve it:
48
52
 
49
53
  ```json
50
54
  {
@@ -82,4 +86,12 @@ curl https://api.picked.app/api/v1/projects/proj_123/experiences/exp_123/content
82
86
  }
83
87
  ```
84
88
 
85
- See [Project Config](/delivery-api/project-config) for the endpoint that links steps to entries, [Asset Library](/content/asset-library) for HTML assets, and [Server Snapshot](/sdk/ssr/serialize) for how the SDK consumes this content.
89
+ See [Project Config](/reference/delivery-api/project-config) for the endpoint that links a step
90
+ to an entry. See [Asset Library](/reference/dashboard/content/asset-library) for an HTML asset. See
91
+ [Server Snapshot](/reference/sdk/ssr/serialize) for how the SDK reads this content.
92
+
93
+ ## Related
94
+
95
+ - [About the two APIs](/explanation/the-two-apis)
96
+ - [Project config](/reference/delivery-api/project-config)
97
+ - [Preview, cache, and crawlers](/reference/delivery-api/preview-caching-crawling)
@@ -0,0 +1,45 @@
1
+ ---
2
+ type: reference
3
+ layout: docs
4
+ ---
5
+
6
+ # Delivery API
7
+
8
+ The Delivery API is a public REST API. It is read-only, and it serves the published
9
+ configuration of your project together with your page content. It is separate from the
10
+ GraphQL management API.
11
+
12
+ ## Base URL and versioning
13
+
14
+ All Delivery API routes are versioned under `/api/v1`:
15
+
16
+ ```
17
+ https://api.picked.app/api/v1
18
+ ```
19
+
20
+ ## Published content and preview content
21
+
22
+ Each endpoint serves two surfaces:
23
+
24
+ - **Published** content is anonymous. Anybody can read your published configuration and
25
+ your published content.
26
+ - **Preview** content needs a `preview_token` query parameter. With it you can render
27
+ an unpublished draft before you make it live.
28
+
29
+ The management API holds the preview token of a workspace in the `previewToken`
30
+ field. The preview action in the dashboard also makes one for you.
31
+
32
+ ## Endpoints
33
+
34
+ | Endpoint | Description |
35
+ | --- | --- |
36
+ | [Project Config](/reference/delivery-api/project-config) | `GET /api/v1/projects/:projectId` returns the published configuration of the project, with the content link of each step. |
37
+ | [Experience Content](/reference/delivery-api/experience-content) | `GET /api/v1/projects/:projectId/experiences/:id/content` returns the Content Entries of an experience. |
38
+
39
+ Both endpoints share some behaviour. See
40
+ [Preview, cache, and crawlers](/reference/delivery-api/preview-caching-crawling).
41
+
42
+ ## Related
43
+
44
+ - [About the two APIs](/explanation/the-two-apis) — which one to use, and why they are
45
+ separate.
@@ -0,0 +1,79 @@
1
+ ---
2
+ type: reference
3
+ layout: docs
4
+ ---
5
+
6
+ # Preview, cache, and crawlers
7
+
8
+ Both Delivery API endpoints share this behaviour: the preview token, the cache, CORS,
9
+ and what a crawler can read.
10
+
11
+ ## Preview tokens
12
+
13
+ Pass `?preview_token=<token>` to read unpublished content. Both endpoints take it,
14
+ and both return `versionId: null` for a preview. An invalid token returns `401`.
15
+
16
+ ```bash
17
+ curl "https://api.picked.app/api/v1/projects/proj_123?preview_token=<token>"
18
+ ```
19
+
20
+ The [management API](/tutorials/first-api-call) holds the preview token of a workspace in the
21
+ `previewToken` field. The preview action in the dashboard also makes one for you.
22
+
23
+ Use the same token for the project configuration request and for the experience content
24
+ request. Both then come from the same preview.
25
+
26
+ ## Cache
27
+
28
+ The cache rules depend on the surface and on the client that makes the request. The
29
+ SDK sends a `Picked-Client: sdk` request header:
30
+
31
+ | Request | `Cache-Control` |
32
+ | --- | --- |
33
+ | Published, `Picked-Client: sdk` | `public, s-maxage=60, stale-while-revalidate=86400` |
34
+ | Published, other clients | `private, no-store` |
35
+ | Preview | `no-store` |
36
+
37
+ A published response that a cache can hold also sends `Vary: Picked-Client`. A shared
38
+ cache therefore keys on the client header. It never gives a body that it cached for
39
+ the SDK to a request from another client.
40
+
41
+ ## CORS
42
+
43
+ Both endpoints can be read from another origin. An `OPTIONS` preflight returns `204`
44
+ with the CORS headers:
45
+
46
+ | Header | Value |
47
+ | --- | --- |
48
+ | `Access-Control-Allow-Origin` | `*` |
49
+ | `Access-Control-Allow-Methods` | `GET, OPTIONS` |
50
+ | `Access-Control-Allow-Headers` | `Content-Type, Picked-Client, Picked-Version, traceparent, tracestate` |
51
+
52
+ ## Crawlers and search rank
53
+
54
+ A crawler can read both endpoints, so a search engine can read your published
55
+ content. A preview URL is disallowed, so a draft never reaches the index. These are
56
+ the `robots.txt` rules:
57
+
58
+ ```
59
+ User-agent: *
60
+
61
+ # Let a crawler read the public project configuration and experience content.
62
+ Allow: /api/v1/projects
63
+ Allow: /api/v1/projects/*/experiences/*/content
64
+
65
+ # Keep a preview response, which is a draft, away from a crawler.
66
+ Disallow: /api/v1/projects/*preview_token=
67
+
68
+ # Everything else stays disallowed: GraphQL, MCP, internal routes, and the ping.
69
+ Disallow: /
70
+ ```
71
+
72
+ See [Project Config](/reference/delivery-api/project-config) and
73
+ [Experience Content](/reference/delivery-api/experience-content) for the endpoints.
74
+
75
+ ## Related
76
+
77
+ - [About the two APIs](/explanation/the-two-apis) — how a preview stays out of the search
78
+ index.
79
+ - [How to render an unpublished preview](/how-to/render-an-unpublished-preview)
@@ -1,4 +1,5 @@
1
1
  ---
2
+ type: reference
2
3
  layout: docs
3
4
  ---
4
5
 
@@ -15,21 +16,23 @@ GET /api/v1/projects/:projectId
15
16
  | Parameter | In | Description |
16
17
  | --- | --- | --- |
17
18
  | `projectId` | path | The project to fetch config for. |
18
- | `preview_token` | query | Optional. Returns the preview (unpublished) config when present. |
19
+ | `preview_token` | query | Optional. With it, the endpoint returns the preview configuration, which are unpublished. |
19
20
 
20
21
  ## Response
21
22
 
22
- The response carries the project's experiences and steps. Each step includes `layoutContentId`, the reference to the Content Entry that backs that step's layout. Use it to know which experiences have content to fetch from the [Experience Content](/delivery-api/experience-content) endpoint.
23
+ The response carries the project's experiences and steps. Each step includes `layoutContentId`, the reference to the Content Entry that backs that step's layout. Use it to know which experiences have content to fetch from the [Experience Content](/reference/delivery-api/experience-content) endpoint.
23
24
 
24
25
  | Field | Type | Description |
25
26
  | --- | --- | --- |
26
27
  | `id` | `string` | The project id. |
27
28
  | `versionId` | `string \| null` | The published version id, or `null` on preview. |
28
- | `steps[].layoutContentId` | `string \| null` | The Content Entry backing this step, or `null` when the step has no content. |
29
+ | `steps[].layoutContentId` | `string \| null` | The Content Entry of this step, or `null` when the step has no content. |
29
30
 
30
- ## Published vs preview
31
+ ## Published content and preview content
31
32
 
32
- On the published surface, `versionId` is the published version id. On the preview surface (`?preview_token=...`), `versionId` is `null` because there is no published version. See [Preview, Caching & Crawling](/delivery-api/preview-caching-crawling).
33
+ For published content, `versionId` holds the ID of the published version. For preview
34
+ content, which you read with `?preview_token=...`, `versionId` is `null`, because
35
+ there is no published version. See [Preview, cache, and crawlers](/reference/delivery-api/preview-caching-crawling).
33
36
 
34
37
  ## Example
35
38
 
@@ -53,4 +56,10 @@ curl https://api.picked.app/api/v1/projects/proj_123
53
56
  }
54
57
  ```
55
58
 
56
- Pass the config to `serialize()` on your server to produce an SSR snapshot. See [Server Snapshot](/sdk/ssr/serialize).
59
+ Pass the config to `serialize()` on your server to produce an SSR snapshot. See [Server Snapshot](/reference/sdk/ssr/serialize).
60
+
61
+ ## Related
62
+
63
+ - [About the two APIs](/explanation/the-two-apis)
64
+ - [Experience content](/reference/delivery-api/experience-content)
65
+ - [How to server-render a page](/how-to/server-render-a-page)
@@ -0,0 +1,173 @@
1
+ ---
2
+ type: reference
3
+ layout: docs
4
+ ---
5
+
6
+ # Glossary
7
+
8
+ Every term that Picked uses, and what each one means. The dashboard, the API, and the SDK
9
+ sometimes use different words for the same thing. This page gives the word that the
10
+ documentation uses, and it names the others.
11
+
12
+ ## Accounts and access
13
+
14
+ | Term | What it is |
15
+ | --- | --- |
16
+ | **Organization** | The top level. It holds your projects, your members, and your settings. You can belong to more than one. |
17
+ | **Member** | A person in an organization. Each member holds one role. |
18
+ | **Role** | What a member can reach. It decides whether a member can create a project, edit an experience, or read a report. |
19
+ | **API key** | A credential for a server-to-server integration. It belongs to an organization, it can belong to one project, and it carries scopes. |
20
+ | **Scope** | One permission, written `resource/action`, such as `organization/read`. A scope decides which operations a caller can do. |
21
+ | **Session** | The result of a sign-in. It holds an access token, a refresh token, and the time at which the access token expires. |
22
+ | **User** | A person who signs in to the Picked dashboard. A user is not a visitor. |
23
+ | **Invitation** | An offer to join an organization, sent to an email address. It waits until the person accepts it. |
24
+ | **MFA factor** | A second credential on an account, such as a telephone number. |
25
+
26
+ ## Projects and versions
27
+
28
+ | Term | What it is |
29
+ | --- | --- |
30
+ | **Project** | One site or one application. Each project has its own experiences, content, and configuration. |
31
+ | **Project configuration** | The published settings of a project: its experiences and steps, and the content link on each step. The Delivery API serves it, and the SDK reads it. The SDK parameter is `projectConfig`. |
32
+ | **Workspace** | One version of the configuration of a project. You hold a change in a workspace, see a preview of it, and publish it. |
33
+ | **Draft** | A workspace that no visitor sees. |
34
+ | **Live** | The workspace whose snapshot the SDK serves. Each project has exactly one. |
35
+ | **Archived** | A draft that you put to one side. It is still editable, and it is out of the default list. |
36
+ | **Version** | An immutable snapshot of a workspace, made when you publish. The **Publish history** page lists them. |
37
+ | **Preview** | A view of an unpublished workspace on your own site. It reaches your browser only. |
38
+ | **Preview environment** | A named target that a preview opens against. |
39
+ | **Project settings** | The settings of one project, which you edit in the dashboard. These are not the project configuration that the Delivery API serves. |
40
+
41
+ ## Experiences
42
+
43
+ | Term | What it is |
44
+ | --- | --- |
45
+ | **Experience** | Personalized content that Picked serves to a visitor. It is a Flow or a Page. |
46
+ | **Flow** | An interactive experience of more than one step, which the browser renders. |
47
+ | **Page** | A standalone experience that your server renders from a content entry, for content that a search engine must read. |
48
+ | **Step** | One screen that a visitor sees. It holds fields. |
49
+ | **Field** | A data input inside a step. It collects a name, an email address, a preference, or a choice. |
50
+ | **Field option** | One choice in a field that has a fixed set of choices. Each option carries a value, and it can carry a condition. |
51
+ | **Action** | A side effect that starts when the flow reaches it. Your application registers a handler for it. |
52
+ | **Condition** | A rule that decides whether a visitor sees something, or which branch a flow takes. |
53
+ | **Predicate** | A function that you register on the client, so a condition can read data that only your application holds. |
54
+ | **Response** | A value that a visitor sends through a field. |
55
+ | **Origin** | The node where every flow starts. |
56
+ | **Node** | One part of a flow on the canvas: an origin, a step, an action, or a condition. |
57
+ | **Handle** | A connection point on a node. An input handle is on the left, an output handle on the right. |
58
+ | **Key** | The stable identifier of a step, a field, an action, or a condition. Your application and your API calls both use it. You set it one time, and you cannot change it. |
59
+ | **Layout name** | The name of the component that renders a step, such as `card` or `modal`. |
60
+ | **Target** | The element that an experience renders against, found by its target selector. |
61
+
62
+ ## Feature flags
63
+
64
+ | Term | What it is |
65
+ | --- | --- |
66
+ | **Feature flag** | A control that decides which visitors see a change, so you can run an A/B test or release in stages. The API type is `Feature`. |
67
+ | **Weight** | The percentage of visitors that Picked allocates to a feature flag, from 0 to 100. |
68
+ | **Allocation** | The act that puts a visitor in a feature flag. It happens when something first reads the bucket. |
69
+ | **Bucket** | The value a feature flag resolves to for one visitor. |
70
+ | **Exposure** | The moment a visitor enters a test. It is the same moment as the allocation. |
71
+ | **Version** | A number on a feature flag that forms part of the cache key. It is not part of the allocation. |
72
+
73
+ ## Content
74
+
75
+ | Term | What it is |
76
+ | --- | --- |
77
+ | **Page layout** | A reusable schema that sets which fields a Page can hold. The API type is `ContentModel`, and the dashboard list page is titled **Models**. |
78
+ | **Step layout** | The same, for one Step inside a Flow. |
79
+ | **Section** | A reusable schema fragment that you put inside one or more layouts. The API type is `ContentBlock`, and the dashboard list page is titled **Blocks**. |
80
+ | **Content entry** | One instance of a layout, filled with real values. The dashboard list page is titled **Content**. |
81
+ | **Asset** | A file that your content points at: an image, a video, a document, or HTML. |
82
+ | **Asset library** | The project-level store that holds your assets. |
83
+ | **Design system** | A set of shared design decisions for a project. |
84
+ | **Content schema** | The set of fields that a layout or a section defines. |
85
+ | **Asset version** | One file that somebody uploaded for an asset. The library keeps the earlier versions. |
86
+ | **Validation error** | A report that one field in a content entry does not match its schema. It carries the path to the exact field. |
87
+
88
+ ## The SDK
89
+
90
+ | Term | What it is |
91
+ | --- | --- |
92
+ | **Client** | The object that `createClient()` returns. It holds your configuration and runs the experiences. |
93
+ | **Plugin** | A piece of behaviour that you pass to the `plugins` array of the client. |
94
+ | **Component name** | The identifier that points an experience at a component in your application. |
95
+ | **Adapter** | The function that lets the client render a framework component: `adaptReactComponent` or `adaptSvelteComponent`. |
96
+ | **Slot** | A named mount point, rendered by `<ExperienceSlot name="…" />`. It maps to the `.picked-slot-<name>` selector. |
97
+ | **Placement** | Where an experience renders against its target: `replace`, `before`, `prepend`, `append`, or `after`. |
98
+ | **Target selector** | The selector that an experience renders into. |
99
+ | **Snapshot** | The plain JSON that `serialize()` returns on your server, and that seeds the client in the browser. |
100
+ | **Precondition** | A gate that decides whether Picked starts at all. |
101
+ | **Visitor** | The person on your site. Picked gives each one a stable ID. A visitor is not a user. |
102
+ | **Framework plugin** | The plugin that lets the client render a React or a Svelte component. |
103
+
104
+ ## APIs and analytics
105
+
106
+ | Term | What it is |
107
+ | --- | --- |
108
+ | **Delivery API** | The public, anonymous, read-only REST API that serves your published configuration and content. |
109
+ | **Management API** | The authenticated GraphQL API that controls your projects, experiences, and content. |
110
+ | **Preview token** | A token that lets a Delivery API request read unpublished content. |
111
+ | **PickedQL** | The SQL query language for your Picked analytics data. |
112
+ | **Virtual table** | A table name in PickedQL, such as `metrics`, that maps to the real tables below it. |
113
+ | **Virtual function** | A short function in PickedQL, such as `control_users()`, that expands to a full aggregate expression. |
114
+ | **Dimension** | A column that PickedQL joins for you, such as `device_category`. |
115
+ | **Report** | An embedded analytics dashboard or question, attached to a project. |
116
+
117
+ ## Tools
118
+
119
+ | Term | What it is |
120
+ | --- | --- |
121
+ | **MCP connection** | A link between a Picked project and an AI tool, over the Model Context Protocol. The dashboard calls this **MCP connections**. |
122
+ | **Integration** | A connection between Picked and another service. |
123
+ | **Tag ID** | The identifier of a project, which the template for Google Tag Manager uses. |
124
+
125
+ ## Verbs
126
+
127
+ The actions that Picked names, and what each one does. Where an API mutation uses the
128
+ word exactly, the table says so.
129
+
130
+ ### You act on the dashboard
131
+
132
+ | Verb | What it does |
133
+ | --- | --- |
134
+ | **Create** | Makes a new record. |
135
+ | **Update** | Changes a record that exists. |
136
+ | **Delete** | Removes a record permanently. You cannot reverse it. |
137
+ | **Publish** | Makes an immutable snapshot of a workspace and serves it to your visitors. |
138
+ | **Archive** | Moves a draft workspace out of the default list. It stays editable. |
139
+ | **Unarchive** | Returns an archived workspace to the default list. |
140
+ | **Duplicate** | Copies a workspace, and everything in it, into a new draft. |
141
+ | **Restore** | Moves the live pointer of a project to an earlier version. It changes no data. |
142
+ | **Preview** | Opens your site with an unpublished workspace applied, for your browser only. |
143
+ | **Invite** | Sends an invitation to join an organization. |
144
+ | **Revoke** | Invalidates an API key or an invitation immediately. |
145
+ | **Install** | Connects an integration to your project. |
146
+
147
+ ### Picked acts on a visitor
148
+
149
+ | Verb | What it does |
150
+ | --- | --- |
151
+ | **Allocate** | Puts a visitor in a feature flag. |
152
+ | **Resolve** | Gives a feature flag its bucket for one visitor. The first read resolves it. |
153
+ | **Decide** | Runs the `decide` function of a feature flag. |
154
+ | **Evaluate** | Runs a condition against the current state. |
155
+ | **Invoke** | Calls a predicate from inside a condition. |
156
+ | **Serve** | Sends published content to a visitor. |
157
+
158
+ ### Your code acts on the SDK
159
+
160
+ | Verb | What it does |
161
+ | --- | --- |
162
+ | **Register** | Adds a component, an action, a predicate, or a feature flag to the client. |
163
+ | **Start** | Runs the client. `start()` is idempotent. |
164
+ | **Adapt** | Wraps a framework component so the client can render it. |
165
+ | **Serialize** | Builds a snapshot on your server, with `serialize()`. |
166
+ | **Seed** | Gives the client a snapshot, so the first render matches the server. |
167
+ | **Hydrate** | Takes over the server markup in the browser. |
168
+ | **Render** | Puts a component into the page. |
169
+
170
+ ## Related
171
+
172
+ - [About how Picked works](/explanation/how-picked-works) — how these parts fit together.
173
+ - [Projects](/reference/dashboard/projects) — the dashboard surface.
@@ -0,0 +1,74 @@
1
+ ---
2
+ type: reference
3
+ layout: docs
4
+ ---
5
+
6
+ # Authentication
7
+
8
+ The Picked API supports four ways to authenticate. They are a session from an email
9
+ address and a password, an OAuth provider, a magic link, and an API key. This guide
10
+ covers each one. It also covers how to control a session and how to use multi-factor
11
+ authentication (MFA).
12
+
13
+ ## Use a session
14
+
15
+ After the caller has a session, it puts the access token in the `Authorization`
16
+ header of every request that needs authentication:
17
+
18
+ ```
19
+ Authorization: Bearer <accessToken>
20
+ ```
21
+
22
+ The `expiresAt` field of the session gives the time at which the access token
23
+ expires. The caller must refresh the session before that time.
24
+
25
+ ### Authenticator assurance levels
26
+
27
+ The session holds an `aal` field, and it gives the strength of the authentication:
28
+
29
+ | Level | Meaning |
30
+ |-------|---------|
31
+ | `AAL1` | One factor: an email address and a password, OAuth, or a magic link |
32
+ | `AAL2` | More than one factor: the user completed an MFA challenge |
33
+
34
+ Some operations need `AAL2`. When a caller at `AAL1` tries one of them, the API
35
+ returns an authorization error.
36
+
37
+ ## The mutations
38
+
39
+ | Mutation | What it does |
40
+ | --- | --- |
41
+ | `sessionCreate` | Authenticates an email address and a password. Returns a session, or `requiresMfa`. |
42
+ | `sessionRefresh` | Exchanges a refresh token for a new session. Needs no `Authorization` header. |
43
+ | `accountCreate` | Creates an account. `metadata` takes any JSON. |
44
+ | `accountVerifyEmail` | Completes email verification with the token from the email. |
45
+ | `accountResendVerification` | Sends the verification email again. |
46
+ | `oauthAuthorize` | Returns the authorization URL for a provider. Google is supported. |
47
+ | `oauthCallback` | Exchanges an OAuth code for a session. |
48
+ | `magicLinkSend` | Sends a sign-in link to an email address. |
49
+ | `magicLinkVerify` | Exchanges a magic-link token for a session. |
50
+ | `passwordResetSend` | Sends a password reset email. |
51
+ | `passwordReset` | Completes a reset with the token from the email. |
52
+ | `passwordUpdate` | Changes a password. Needs authentication. |
53
+ | `mfaFactorEnroll` | Adds an MFA factor. A new factor is `UNVERIFIED`. |
54
+ | `mfaChallengeSend` | Sends a code to the telephone number of the factor. |
55
+ | `mfaChallengeVerify` | Verifies a challenge. Moves the session to `AAL2`. |
56
+ | `mfaFactorUnenroll` | Removes an MFA factor. |
57
+ | `apiKeyCreate` | Creates an API key. Only a user with a session can call it. |
58
+ | `apiKeyRevoke` | Invalidates a key immediately. |
59
+
60
+ ## Credentials
61
+
62
+ | Credential | Header |
63
+ | --- | --- |
64
+ | Session access token | `Authorization: Bearer <accessToken>` |
65
+ | API key | `x-api-key: pk_live_abc123...` |
66
+
67
+ ## Related
68
+
69
+ - [How to authenticate with a password](/how-to/authenticate-with-a-password)
70
+ - [How to authenticate with OAuth](/how-to/authenticate-with-oauth)
71
+ - [How to authenticate with a magic link](/how-to/authenticate-with-a-magic-link)
72
+ - [How to set up MFA](/how-to/set-up-mfa)
73
+ - [How to authenticate with an API key](/how-to/authenticate-with-an-api-key)
74
+ - [Authorization and scopes](/reference/management-api/authorization-and-scopes)