@picked/client 0.0.1-dev.1785826066660 → 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 (169) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/{api-d0qKmzPH.js → api-03c5jvVk.js} +1 -1
  3. package/dist/{api-Djuh2gfe.cjs → api-CQxCVIrm.cjs} +1 -1
  4. package/dist/cjs/index.js +2 -2
  5. package/dist/cjs/plugins/dynamic-experiences/index.js +1 -1
  6. package/dist/cjs/server/index.js +1 -1
  7. package/dist/docs/explanation/conditions-and-the-logic-engine.md +94 -0
  8. package/dist/docs/explanation/feature-flag-allocation.md +176 -0
  9. package/dist/docs/explanation/how-picked-works.md +124 -0
  10. package/dist/docs/explanation/how-pickedql-works.md +76 -0
  11. package/dist/docs/explanation/pages-and-flows.md +64 -0
  12. package/dist/docs/explanation/the-content-model.md +77 -0
  13. package/dist/docs/explanation/the-two-apis.md +68 -0
  14. package/dist/docs/explanation/why-server-side-rendering.md +76 -0
  15. package/dist/docs/explanation/workspaces-and-versions.md +71 -0
  16. package/dist/docs/how-to/add-a-step-field-or-action.md +43 -0
  17. package/dist/docs/{pickedql/examples.md → how-to/analytics/index.md} +19 -6
  18. package/dist/docs/how-to/archive-or-delete-a-workspace.md +46 -0
  19. package/dist/docs/how-to/authenticate-with-a-magic-link.md +40 -0
  20. package/dist/docs/how-to/authenticate-with-a-password.md +51 -0
  21. package/dist/docs/how-to/authenticate-with-an-api-key.md +51 -0
  22. package/dist/docs/how-to/authenticate-with-oauth.md +40 -0
  23. package/dist/docs/{flow-builder/building-flows.md → how-to/build-a-flow.md} +13 -9
  24. package/dist/docs/how-to/connect-the-mcp-server.md +38 -0
  25. package/dist/docs/how-to/create-a-project.md +29 -0
  26. package/dist/docs/how-to/create-an-experience.md +42 -0
  27. package/dist/docs/how-to/create-and-revoke-an-api-key.md +37 -0
  28. package/dist/docs/how-to/debug-with-the-chrome-extension.md +57 -0
  29. package/dist/docs/how-to/define-a-page-layout.md +39 -0
  30. package/dist/docs/how-to/fill-and-publish-a-page.md +50 -0
  31. package/dist/docs/{gtm-template.md → how-to/install-the-gtm-template.md} +9 -3
  32. package/dist/docs/how-to/install-the-sdk.md +68 -0
  33. package/dist/docs/how-to/install-the-vite-plugin.md +56 -0
  34. package/dist/docs/how-to/invite-and-remove-members.md +34 -0
  35. package/dist/docs/how-to/preview-a-workspace.md +28 -0
  36. package/dist/docs/how-to/publish-a-workspace.md +30 -0
  37. package/dist/docs/how-to/read-a-feature-flag.md +101 -0
  38. package/dist/docs/how-to/register-a-component.md +55 -0
  39. package/dist/docs/how-to/register-an-action-handler.md +67 -0
  40. package/dist/docs/how-to/render-a-step-form.md +132 -0
  41. package/dist/docs/how-to/render-an-unpublished-preview.md +41 -0
  42. package/dist/docs/how-to/reuse-a-section.md +37 -0
  43. package/dist/docs/how-to/reuse-a-step-field-or-action.md +28 -0
  44. package/dist/docs/how-to/roll-back-a-published-version.md +26 -0
  45. package/dist/docs/how-to/run-an-ab-test.md +49 -0
  46. package/dist/docs/how-to/run-code-on-a-form-submission.md +125 -0
  47. package/dist/docs/how-to/server-render-a-page.md +81 -0
  48. package/dist/docs/how-to/set-a-content-security-policy.md +32 -0
  49. package/dist/docs/how-to/set-up-mfa.md +69 -0
  50. package/dist/docs/how-to/upload-and-use-an-asset.mdx +73 -0
  51. package/dist/docs/how-to/validate-a-field.md +52 -0
  52. package/dist/docs/how-to/write-a-condition.md +45 -0
  53. package/dist/docs/how-to/write-a-predicate.md +60 -0
  54. package/dist/docs/index.md +41 -70
  55. package/dist/docs/reference/dashboard/actions.mdx +53 -0
  56. package/dist/docs/{api-keys.mdx → reference/dashboard/api-keys.mdx} +7 -15
  57. package/dist/docs/reference/dashboard/conditions.mdx +42 -0
  58. package/dist/docs/reference/dashboard/content/asset-library.mdx +63 -0
  59. package/dist/docs/{content → reference/dashboard/content}/content-entries.mdx +11 -3
  60. package/dist/docs/{content → reference/dashboard/content}/layouts.mdx +11 -35
  61. package/dist/docs/reference/dashboard/content/pages.mdx +35 -0
  62. package/dist/docs/reference/dashboard/content/sections.mdx +28 -0
  63. package/dist/docs/{experiences.mdx → reference/dashboard/experiences.mdx} +9 -16
  64. package/dist/docs/{features.mdx → reference/dashboard/features.mdx} +26 -41
  65. package/dist/docs/{fields.mdx → reference/dashboard/fields.mdx} +26 -20
  66. package/dist/docs/{flow-builder/overview.mdx → reference/dashboard/flow-builder/canvas.mdx} +8 -13
  67. package/dist/docs/{flow-builder → reference/dashboard/flow-builder}/condition-builder.md +5 -13
  68. package/dist/docs/{flow-builder → reference/dashboard/flow-builder}/keyboard-shortcuts.md +7 -1
  69. package/dist/docs/{flow-builder → reference/dashboard/flow-builder}/nodes.md +10 -3
  70. package/dist/docs/reference/dashboard/projects.mdx +44 -0
  71. package/dist/docs/reference/dashboard/reports.mdx +43 -0
  72. package/dist/docs/reference/dashboard/steps.mdx +37 -0
  73. package/dist/docs/{team-management.md → reference/dashboard/team-management.md} +5 -22
  74. package/dist/docs/{workspace-versioning.mdx → reference/dashboard/workspace-versioning.mdx} +6 -10
  75. package/dist/docs/reference/dashboard/workspaces.mdx +76 -0
  76. package/dist/docs/{delivery-api → reference/delivery-api}/experience-content.md +11 -4
  77. package/dist/docs/reference/delivery-api/index.md +45 -0
  78. package/dist/docs/{delivery-api → reference/delivery-api}/preview-caching-crawling.md +12 -5
  79. package/dist/docs/{delivery-api → reference/delivery-api}/project-config.md +11 -4
  80. package/dist/docs/reference/glossary.md +173 -0
  81. package/dist/docs/reference/management-api/authentication.md +74 -0
  82. package/dist/docs/{api → reference/management-api}/authorization-and-scopes.md +10 -3
  83. package/dist/docs/{api → reference/management-api}/error-handling.md +9 -3
  84. package/dist/docs/{api → reference/management-api}/pagination.md +6 -0
  85. package/dist/docs/{pickedql → reference/pickedql}/data-sources.md +16 -9
  86. package/dist/docs/{pickedql → reference/pickedql}/dimensions.md +7 -0
  87. package/dist/docs/{pickedql → reference/pickedql}/filtering.md +7 -0
  88. package/dist/docs/reference/pickedql/index.md +18 -0
  89. package/dist/docs/{pickedql → reference/pickedql}/schema.md +13 -6
  90. package/dist/docs/{pickedql → reference/pickedql}/virtual-functions.md +7 -0
  91. package/dist/docs/reference/sdk/actions.md +30 -0
  92. package/dist/docs/{sdk → reference/sdk}/conditions.md +8 -1
  93. package/dist/docs/reference/sdk/content-security-policy.md +21 -0
  94. package/dist/docs/reference/sdk/experiences.md +51 -0
  95. package/dist/docs/{sdk → reference/sdk}/features.md +30 -117
  96. package/dist/docs/{sdk → reference/sdk}/fields.md +10 -88
  97. package/dist/docs/reference/sdk/index.md +68 -0
  98. package/dist/docs/{sdk → reference/sdk}/plugins/create-experience.md +10 -22
  99. package/dist/docs/reference/sdk/plugins/dynamic-experiences.md +74 -0
  100. package/dist/docs/reference/sdk/plugins/index.md +29 -0
  101. package/dist/docs/{sdk → reference/sdk}/plugins/window-object.md +6 -0
  102. package/dist/docs/reference/sdk/predicates.md +43 -0
  103. package/dist/docs/reference/sdk/ssr/index.md +33 -0
  104. package/dist/docs/{sdk → reference/sdk}/ssr/rendering-and-hydration.md +4 -63
  105. package/dist/docs/{sdk → reference/sdk}/ssr/serialize.md +6 -33
  106. package/dist/docs/{sdk → reference/sdk}/ssr/slots-and-placements.md +7 -1
  107. package/dist/docs/reference/sdk/steps.md +87 -0
  108. package/dist/docs/reference/tools/chrome-extension.md +16 -0
  109. package/dist/docs/{image-optimisation-service.md → reference/tools/image-optimisation-service.md} +8 -0
  110. package/dist/docs/{mcp.md → reference/tools/mcp.md} +5 -45
  111. package/dist/docs/{vite-plugin.md → reference/tools/vite-plugin.md} +34 -35
  112. package/dist/docs/{api/index.md → tutorials/first-api-call.md} +27 -15
  113. package/dist/docs/tutorials/first-experience-in-the-dashboard.mdx +143 -0
  114. package/dist/docs/tutorials/first-experience.mdx +255 -0
  115. package/dist/docs/tutorials/first-server-rendered-page.mdx +186 -0
  116. package/dist/esm/index.js +290 -319
  117. package/dist/esm/plugins/dynamic-experiences/index.js +3 -3
  118. package/dist/esm/server/index.js +22 -22
  119. package/dist/plugin-CHOVsx7Z.js +287 -0
  120. package/dist/plugin-DsaGXQHx.cjs +1 -0
  121. package/dist/types/data-source/api.d.ts +60 -0
  122. package/dist/types/data-source/api.d.ts.map +1 -0
  123. package/dist/types/data-source/provider.d.ts +97 -0
  124. package/dist/types/data-source/provider.d.ts.map +1 -0
  125. package/dist/types/entities/feature/feature.d.ts +16 -0
  126. package/dist/types/entities/feature/feature.d.ts.map +1 -1
  127. package/dist/types/exports.d.ts +0 -2
  128. package/dist/types/exports.d.ts.map +1 -1
  129. package/dist/types/index.d.ts +0 -1
  130. package/dist/types/index.d.ts.map +1 -1
  131. package/dist/types/picked.d.ts +15 -0
  132. package/dist/types/picked.d.ts.map +1 -1
  133. package/dist/types/plugins/dynamic-experiences/index.d.ts +2 -0
  134. package/dist/types/plugins/dynamic-experiences/index.d.ts.map +1 -1
  135. package/dist/types/plugins/dynamic-experiences/plugin.d.ts +2 -34
  136. package/dist/types/plugins/dynamic-experiences/plugin.d.ts.map +1 -1
  137. package/dist/types/plugins/dynamic-experiences/types.d.ts +34 -16
  138. package/dist/types/plugins/dynamic-experiences/types.d.ts.map +1 -1
  139. package/dist/types/server/serialize.d.ts +7 -6
  140. package/dist/types/server/serialize.d.ts.map +1 -1
  141. package/package.json +1 -1
  142. package/dist/docs/actions.mdx +0 -98
  143. package/dist/docs/api/authentication.md +0 -403
  144. package/dist/docs/chrome-extension.md +0 -68
  145. package/dist/docs/conditions.mdx +0 -72
  146. package/dist/docs/content/asset-library.mdx +0 -124
  147. package/dist/docs/content/pages.mdx +0 -82
  148. package/dist/docs/content/sections.mdx +0 -44
  149. package/dist/docs/delivery-api/index.md +0 -53
  150. package/dist/docs/guides/build-a-personalized-page.mdx +0 -161
  151. package/dist/docs/pickedql/index.md +0 -54
  152. package/dist/docs/projects.mdx +0 -44
  153. package/dist/docs/reports.mdx +0 -20
  154. package/dist/docs/sdk/actions.md +0 -82
  155. package/dist/docs/sdk/content-security-policy.md +0 -33
  156. package/dist/docs/sdk/experiences.md +0 -64
  157. package/dist/docs/sdk/feature-allocation.md +0 -161
  158. package/dist/docs/sdk/index.md +0 -98
  159. package/dist/docs/sdk/plugins/dynamic-experiences.md +0 -84
  160. package/dist/docs/sdk/plugins/index.md +0 -9
  161. package/dist/docs/sdk/predicates.md +0 -128
  162. package/dist/docs/sdk/ssr/index.md +0 -79
  163. package/dist/docs/sdk/steps.md +0 -479
  164. package/dist/docs/steps.mdx +0 -53
  165. package/dist/docs/workspaces.mdx +0 -133
  166. package/dist/plugin-BVAFWjpT.js +0 -252
  167. package/dist/plugin-BcCn2llk.cjs +0 -1
  168. package/dist/types/entities/content/reference.d.ts +0 -101
  169. package/dist/types/entities/content/reference.d.ts.map +0 -1
@@ -0,0 +1,71 @@
1
+ ---
2
+ type: explanation
3
+ layout: docs
4
+ ---
5
+
6
+ # About workspaces and versions
7
+
8
+ Why can you not edit what your visitors see? Because Picked keeps two things separate on
9
+ purpose: the work in progress, and the thing that it serves.
10
+
11
+ ## The two states
12
+
13
+ A **workspace** holds your changes. Edit a flow, a feature flag, a step, a field, an
14
+ action, or a condition, and the change stays in the workspace. No visitor sees it.
15
+
16
+ A **version** is what your visitors get. When you publish, Picked takes the current
17
+ workspace and makes an immutable snapshot of it. A project serves exactly one version at a
18
+ time, the live one.
19
+
20
+ Everything else follows from that split.
21
+
22
+ ## Why the snapshot is immutable
23
+
24
+ A published version cannot change. That is what makes a roll-back safe. When you restore
25
+ an earlier version, Picked moves the live pointer of the project and changes no data. The
26
+ version that you restore is the exact version that was live before, and not a copy that
27
+ Picked builds again.
28
+
29
+ It is also what lets your draft continue. When you publish, your workspace stays
30
+ editable, and a roll-back discards no draft. The two move at their own speed.
31
+
32
+ ## The three workspace states
33
+
34
+ - **Live** — the workspace whose snapshot the SDK serves. Each project has exactly one.
35
+ - **Draft** — a workspace that no visitor sees. Edit it, see a preview of it, publish it.
36
+ - **Archived** — a draft that you put to one side. It is still editable, but it is out of
37
+ the default list.
38
+
39
+ Picked keeps these two operations separate on purpose. Archive a draft when you are not
40
+ certain about it. You cannot reverse a delete, but you can always unarchive.
41
+
42
+ ## Why the publish modal shows a diff
43
+
44
+ It is the one step in the dashboard that you cannot take back. It is therefore the one
45
+ place that shows you exactly what changes. The modal compares the current workspace
46
+ against the last published snapshot. It puts the changes into groups, and marks each row
47
+ added, removed, or modified.
48
+
49
+ The diff also carries a warning that a plain list of changes cannot give you. Some changes
50
+ break other records. Remove a field while steps still point at it, and those steps
51
+ now have an error. The preview shows that above the diff, before you publish and not after.
52
+
53
+ The first publish of a workspace has no earlier snapshot to compare against, so the modal
54
+ shows the contents instead of a diff.
55
+
56
+ ## A preview does not reach production
57
+
58
+ A preview sends the workspace state to the SDK in the query parameters. Your unpublished
59
+ workspace therefore applies to your browser and to nothing else. The visitors on your live
60
+ site see no change.
61
+
62
+ One result of this matters. In a preview the SDK stores a feature flag decision in session
63
+ storage and not in local storage. A preview allocation is therefore disposable, and it can
64
+ differ from a production one. See
65
+ [About feature flag allocation](/explanation/feature-flag-allocation).
66
+
67
+ ## Related
68
+
69
+ - [About how Picked works](/explanation/how-picked-works) — what a publish feeds.
70
+ - [Workspaces](/reference/dashboard/workspaces) — the states and the settings.
71
+ - [Publish history](/reference/dashboard/workspace-versioning) — the version list.
@@ -0,0 +1,43 @@
1
+ ---
2
+ type: how-to
3
+ layout: docs
4
+ ---
5
+
6
+ # How to add a step, a field, an action, or a condition
7
+
8
+ This guide shows you how to create the parts that a flow is built from. All four follow
9
+ the same shape, and all four belong to the project: you can use one in more than one flow.
10
+
11
+ ## Steps
12
+
13
+ 1. Open a flow. The library is on the left of the flow builder.
14
+ 2. Find the **Steps**, **Fields**, **Actions**, or **Conditions** section in it.
15
+ 3. Click the **+** next to that section.
16
+ 4. Enter a name. The dashboard makes the key from it.
17
+ 5. Click the **Create** button for that kind: **Create step**, **Create field**,
18
+ **Create action**, **Create condition**.
19
+
20
+ The flow builder opens again, and the new one is in the library.
21
+
22
+ **Fields** also has its own sidebar entry, so you can make a field without a flow. A step,
23
+ an action, and a condition belong to a flow, and the library is the only way to reach
24
+ them.
25
+
26
+ The key is the identifier that your application uses. You set it one time, and you cannot
27
+ change it later. Your visitors never see a name or a key.
28
+
29
+ ## What each one needs after that
30
+
31
+ | Kind | Set this next |
32
+ | --- | --- |
33
+ | Step | A **Layout**, such as `card`, `modal`, or `fullscreen`. |
34
+ | Field | A **Label**, a type, and any validation rule. |
35
+ | Action | Nothing in the dashboard. Register the handler in your code. |
36
+ | Condition | The rule, in the **Logic** section of the inspector. |
37
+
38
+ ## Related
39
+
40
+ - [How to build a flow](/how-to/build-a-flow) — put it on the canvas.
41
+ - [How to write a condition](/how-to/write-a-condition)
42
+ - [How to register an action handler](/how-to/register-an-action-handler)
43
+ - [How to reuse a step, a field, or an action](/how-to/reuse-a-step-field-or-action)
@@ -1,8 +1,16 @@
1
1
  ---
2
+ type: how-to
2
3
  layout: docs
3
4
  ---
4
5
 
5
- # Example queries
6
+ # How to run an analytics query
7
+
8
+ This guide gives you a query for each common analytics question. Copy one, put your own
9
+ project ID in the `WHERE` clause, and run it.
10
+
11
+ Every query must carry a tenant filter. See
12
+ [About PickedQL](/explanation/how-pickedql-works) for why, and
13
+ [Data sources](/reference/pickedql/data-sources) for every table.
6
14
 
7
15
  ## Daily A/B test trend
8
16
 
@@ -231,8 +239,7 @@ ORDER BY variant DESC
231
239
  ## Sankey — overall user journey
232
240
 
233
241
  A forward window from the starting step. A user who never reaches `targeting_step`
234
- still gives edges, up to `num_nodes_after_start`. This does what card 4129 on
235
- dashboard 1156 does.
242
+ still gives edges, up to `num_nodes_after_start`.
236
243
 
237
244
  ```sql
238
245
  SELECT source, target, users FROM experience_journey
@@ -253,8 +260,7 @@ WHERE project_id = '{{ your project ID }}'
253
260
  ## Sankey — the top paths to a target step
254
261
 
255
262
  A backward window anchored at the target. It also ranks the paths and keeps the ones
256
- with the most users. This does what card 3961 on dashboard 1156 and card 2740 on
257
- dashboard 991 do.
263
+ with the most users.
258
264
 
259
265
  ```sql
260
266
  SELECT source, target, users FROM experience_journey
@@ -268,7 +274,7 @@ WHERE project_id = '{{ your project ID }}'
268
274
 
269
275
  ## Sankey — drop-off view
270
276
 
271
- Starts at `starting_step` and emits every consecutive transition until `num_nodes_after_start` steps later (no target). Mirrors card 2744.
277
+ Starts at `starting_step` and emits every consecutive transition until `num_nodes_after_start` steps later (no target).
272
278
 
273
279
  ```sql
274
280
  SELECT source, target, users FROM experience_journey
@@ -299,3 +305,10 @@ WHERE project_id = '{{ your project ID }}'
299
305
  | Mobile | `019cc336-5a6a-7c32-b638-cdcc983b3e70` |
300
306
  | Mobile | `019cc336-5a6a-7d8f-994c-69bc28e5f550` |
301
307
  | Mobile | `019cc80f-503c-7181-b2c6-986b1f76d496` |
308
+
309
+ ## Related
310
+
311
+ - [About PickedQL](/explanation/how-pickedql-works) — what the layer expands for you.
312
+ - [Virtual functions](/reference/pickedql/virtual-functions) — every function.
313
+ - [Dimensions](/reference/pickedql/dimensions) — every dimension column.
314
+ - [Reports](/reference/dashboard/reports) — the same data as an embedded dashboard.
@@ -0,0 +1,46 @@
1
+ ---
2
+ type: how-to
3
+ layout: docs
4
+ ---
5
+
6
+ # How to archive or delete a workspace
7
+
8
+ This guide shows you how to take a draft workspace out of use. Archive it when you want
9
+ to keep it. Delete it only when you are certain, because you cannot reverse a delete.
10
+
11
+ You cannot archive or delete a live workspace. Make a different workspace live first.
12
+
13
+ ## Archive a workspace
14
+
15
+ 1. Open the workspace settings page.
16
+ 2. Click **Archive workspace** in the page header.
17
+ 3. Confirm in the modal.
18
+
19
+ The workspace leaves the default list. It stays editable.
20
+
21
+ ## Unarchive a workspace
22
+
23
+ 1. Open the workspace settings page.
24
+ 2. Click **Unarchive workspace** in the page header.
25
+
26
+ ## Delete a workspace
27
+
28
+ 1. Open the workspace settings page.
29
+ 2. Click **Delete workspace**.
30
+ 3. Confirm in the modal.
31
+
32
+ Picked removes the workspace, and everything in it, permanently.
33
+
34
+ ## Rename a workspace
35
+
36
+ 1. Open the workspace settings page.
37
+ 2. Change the **Workspace name** field.
38
+ 3. Click **Save changes**.
39
+
40
+ A name is unique inside a project. The dashboard rejects a duplicate name.
41
+
42
+ ## Related
43
+
44
+ - [About workspaces and versions](/explanation/workspaces-and-versions) — why Picked keeps
45
+ these two operations separate.
46
+ - [Workspaces](/reference/dashboard/workspaces) — the settings reference.
@@ -0,0 +1,40 @@
1
+ ---
2
+ type: how-to
3
+ layout: docs
4
+ ---
5
+
6
+ # How to authenticate with a magic link
7
+
8
+ This guide shows you how to sign a user in through an email address, with no password.
9
+
10
+ ## 1. Send the link
11
+
12
+ ```graphql
13
+ mutation {
14
+ magicLinkSend(input: {
15
+ email: "user@example.com"
16
+ redirectUrl: "https://app.example.com/auth/verify"
17
+ }) {
18
+ success
19
+ }
20
+ }
21
+ ```
22
+
23
+ The user receives an email, and the link in it holds a token.
24
+
25
+ ## 2. Verify the token
26
+
27
+ ```graphql
28
+ mutation {
29
+ magicLinkVerify(input: {
30
+ email: "user@example.com"
31
+ token: "token-from-magic-link"
32
+ }) {
33
+ session { accessToken refreshToken }
34
+ }
35
+ }
36
+ ```
37
+
38
+ ## Related
39
+
40
+ - [Authentication](/reference/management-api/authentication) — every mutation.
@@ -0,0 +1,51 @@
1
+ ---
2
+ type: how-to
3
+ layout: docs
4
+ ---
5
+
6
+ # How to authenticate with a password
7
+
8
+ This guide shows you how to get an access token from an email address and a password.
9
+
10
+ ## 1. Create a session
11
+
12
+ ```graphql
13
+ mutation {
14
+ sessionCreate(input: {
15
+ email: "user@example.com"
16
+ password: "secure-password"
17
+ }) {
18
+ session { accessToken refreshToken expiresAt }
19
+ requiresMfa
20
+ }
21
+ }
22
+ ```
23
+
24
+ When `requiresMfa` is `true`, complete the challenge first. See
25
+ [How to set up MFA](/how-to/set-up-mfa).
26
+
27
+ ## 2. Send the token
28
+
29
+ ```
30
+ Authorization: Bearer <accessToken>
31
+ ```
32
+
33
+ ## 3. Refresh before it expires
34
+
35
+ The `expiresAt` field gives the time at which the access token expires.
36
+
37
+ ```graphql
38
+ mutation {
39
+ sessionRefresh(input: { refreshToken: "v1.refresh-token..." }) {
40
+ session { accessToken refreshToken expiresAt }
41
+ }
42
+ }
43
+ ```
44
+
45
+ The API invalidates the earlier refresh token. This mutation needs no `Authorization`
46
+ header.
47
+
48
+ ## Related
49
+
50
+ - [Authentication](/reference/management-api/authentication) — every mutation.
51
+ - [Your first API call](/tutorials/first-api-call).
@@ -0,0 +1,51 @@
1
+ ---
2
+ type: how-to
3
+ layout: docs
4
+ ---
5
+
6
+ # How to authenticate with an API key
7
+
8
+ This guide shows you how to authenticate a server-to-server integration. An API key gives
9
+ access for a long time, inside a set of scopes.
10
+
11
+ ## 1. Create the key
12
+
13
+ Only a user with a session can create a key. Another API key cannot.
14
+
15
+ ```graphql
16
+ mutation {
17
+ apiKeyCreate(input: {
18
+ organizationId: "org-id"
19
+ name: "CI/CD Pipeline Key"
20
+ projectId: "project-id"
21
+ scopes: [ORGANIZATION_READ, ORGANIZATION_PROJECTS_READ]
22
+ }) {
23
+ apiKey
24
+ }
25
+ }
26
+ ```
27
+
28
+ The response holds the full key one time only. Keep it in a secure place.
29
+
30
+ The scopes that you ask for must all be scopes of the user who creates the key.
31
+
32
+ ## 2. Send the key
33
+
34
+ ```
35
+ x-api-key: pk_live_abc123...
36
+ ```
37
+
38
+ ## 3. Revoke the key
39
+
40
+ ```graphql
41
+ mutation {
42
+ apiKeyRevoke(input: { keyId: "key-id", organizationId: "org-id" })
43
+ }
44
+ ```
45
+
46
+ ## Related
47
+
48
+ - [Authorization and scopes](/reference/management-api/authorization-and-scopes) — every
49
+ scope.
50
+ - [How to create and revoke an API key](/how-to/create-and-revoke-an-api-key) — the
51
+ dashboard path.
@@ -0,0 +1,40 @@
1
+ ---
2
+ type: how-to
3
+ layout: docs
4
+ ---
5
+
6
+ # How to authenticate with OAuth
7
+
8
+ This guide shows you how to sign a user in through Google.
9
+
10
+ ## 1. Get the authorization URL
11
+
12
+ ```graphql
13
+ mutation {
14
+ oauthAuthorize(input: {
15
+ provider: GOOGLE
16
+ redirectUrl: "https://app.example.com/auth/callback"
17
+ scopes: ["openid", "email", "profile"]
18
+ }) {
19
+ url
20
+ }
21
+ }
22
+ ```
23
+
24
+ ## 2. Send the user to that URL
25
+
26
+ Google authenticates the user and sends them back with a `code` parameter.
27
+
28
+ ## 3. Exchange the code
29
+
30
+ ```graphql
31
+ mutation {
32
+ oauthCallback(input: { provider: GOOGLE, code: "auth-code-from-google" }) {
33
+ session { accessToken refreshToken expiresAt }
34
+ }
35
+ }
36
+ ```
37
+
38
+ ## Related
39
+
40
+ - [Authentication](/reference/management-api/authentication) — every mutation.
@@ -1,15 +1,16 @@
1
1
  ---
2
+ type: how-to
2
3
  layout: docs
3
4
  ---
4
5
 
5
- # Build flows
6
+ # How to build a flow
6
7
 
7
- To build a flow, drag a block onto the canvas. Connect your nodes with arrows. Then
8
- set the options of each node in the inspector.
8
+ This guide shows you how to put a flow together on the canvas. You need an experience
9
+ first. See [How to create an experience](/how-to/create-an-experience).
9
10
 
10
11
  ## Add nodes
11
12
 
12
- Drag a step, an action, or a condition from the entity browser onto the canvas. A new
13
+ Drag a step, an action, or a condition from the library onto the canvas. A new
13
14
  node appears where you drop it.
14
15
 
15
16
  You can also drop a block directly onto an arrow that is there already. The flow
@@ -36,12 +37,12 @@ path can lead to more steps, more actions, and more conditions.
36
37
 
37
38
  ## Assign fields to steps
38
39
 
39
- Drag a field from the entity browser onto a step node and drop it. That step then
40
+ Drag a field from the library onto a step node and drop it. That step then
40
41
  holds the field.
41
42
 
42
43
  You can assign more than one field to one step. The step node gives the number of
43
- assigned fields. To see which fields it holds, choose the step. Then read the
44
- **Assigned Fields** section in the inspector.
44
+ assigned fields. To see which fields it holds, choose the step. Then read the **Fields**
45
+ section in the inspector.
45
46
 
46
47
  ## Choose nodes
47
48
 
@@ -74,6 +75,9 @@ first one.
74
75
  Press `Cmd/Ctrl+Z` to undo. Press `Cmd/Ctrl+Shift+Z` to redo. The undo stack records
75
76
  each node that you add, each node that you delete, each connection, and each move.
76
77
 
77
- ---
78
+ ## Related
78
79
 
79
- [Overview](/flow-builder/overview) · [Nodes](/flow-builder/nodes) · **Build Flows** · [Keyboard Shortcuts](/flow-builder/keyboard-shortcuts) · [Condition Builder](/flow-builder/condition-builder)
80
+ - [Canvas](/reference/dashboard/flow-builder/canvas) — the panels and the view controls.
81
+ - [Nodes](/reference/dashboard/flow-builder/nodes) — every node type.
82
+ - [Keyboard shortcuts](/reference/dashboard/flow-builder/keyboard-shortcuts)
83
+ - [About how Picked works](/explanation/how-picked-works) — why a flow is a graph.
@@ -0,0 +1,38 @@
1
+ ---
2
+ type: how-to
3
+ layout: docs
4
+ ---
5
+
6
+ # How to connect the MCP server
7
+
8
+ This guide shows you how to control your Picked workspace from an AI tool that writes
9
+ code. The server URL is `https://api.picked.app/mcp`.
10
+
11
+ ## Claude Desktop
12
+
13
+ 1. Open **Settings > Connectors > Add custom connector**.
14
+ 2. Set **Name** to `Picked`.
15
+ 3. Set **URL** to `https://api.picked.app/mcp`.
16
+ 4. Click **Connect**.
17
+ 5. Answer the authorization prompt.
18
+
19
+ ## Claude Code, Cursor, Windsurf, and others
20
+
21
+ Add `.mcp.json` to the root of your repository:
22
+
23
+ ```json
24
+ {
25
+ "mcpServers": {
26
+ "picked": {
27
+ "type": "http",
28
+ "url": "https://api.picked.app/mcp"
29
+ }
30
+ }
31
+ }
32
+ ```
33
+
34
+ Cursor reads the same content from `.cursor/mcp.json`.
35
+
36
+ ## Related
37
+
38
+ - [MCP server](/reference/tools/mcp) — every tool that the server gives you.
@@ -0,0 +1,29 @@
1
+ ---
2
+ type: how-to
3
+ layout: docs
4
+ ---
5
+
6
+ # How to create a project
7
+
8
+ This guide shows you how to add a project. A project is one site or one application, and
9
+ it holds its own experiences, content, and options.
10
+
11
+ ## Steps
12
+
13
+ 1. Open your organization.
14
+ 2. Click **New project**.
15
+ 3. Enter a name.
16
+ 4. Click **Create project**.
17
+
18
+ The project home page opens. It shows your SDK snippet and the setup tasks that are still
19
+ open.
20
+
21
+ ## Next
22
+
23
+ Copy the snippet and add it to your site. See
24
+ [How to install the SDK](/how-to/install-the-sdk).
25
+
26
+ ## Related
27
+
28
+ - [Projects](/reference/dashboard/projects) — the project surface.
29
+ - [Add Picked to your application](/tutorials/first-experience) — the whole path.
@@ -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.