@picked/client 0.0.70-next.6 → 0.0.70

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 (73) hide show
  1. package/dist/{api-ahdSBQ3Y.js → api-CPy9G49C.js} +1 -1
  2. package/dist/api-Ce6xYI--.cjs +1 -0
  3. package/dist/cjs/index.js +1 -1
  4. package/dist/cjs/plugins/dynamic-experiences/index.js +1 -1
  5. package/dist/cjs/server/index.js +1 -1
  6. package/dist/docs/actions.mdx +38 -18
  7. package/dist/docs/api/authentication.md +75 -48
  8. package/dist/docs/api/authorization-and-scopes.md +63 -47
  9. package/dist/docs/api/error-handling.md +70 -54
  10. package/dist/docs/api/index.md +41 -22
  11. package/dist/docs/api/pagination.md +30 -20
  12. package/dist/docs/api-keys.mdx +11 -6
  13. package/dist/docs/chrome-extension.md +22 -5
  14. package/dist/docs/conditions.mdx +32 -19
  15. package/dist/docs/content/asset-library.mdx +65 -34
  16. package/dist/docs/content/content-entries.mdx +8 -2
  17. package/dist/docs/content/layouts.mdx +45 -29
  18. package/dist/docs/content/pages.mdx +29 -14
  19. package/dist/docs/content/sections.mdx +19 -8
  20. package/dist/docs/delivery-api/experience-content.md +10 -5
  21. package/dist/docs/delivery-api/index.md +19 -12
  22. package/dist/docs/delivery-api/preview-caching-crawling.md +27 -14
  23. package/dist/docs/delivery-api/project-config.md +6 -4
  24. package/dist/docs/experiences.mdx +26 -10
  25. package/dist/docs/features.mdx +66 -25
  26. package/dist/docs/fields.mdx +42 -27
  27. package/dist/docs/flow-builder/building-flows.md +38 -20
  28. package/dist/docs/flow-builder/condition-builder.md +32 -21
  29. package/dist/docs/flow-builder/keyboard-shortcuts.md +18 -18
  30. package/dist/docs/flow-builder/nodes.md +26 -13
  31. package/dist/docs/flow-builder/overview.mdx +28 -15
  32. package/dist/docs/gtm-template.md +35 -26
  33. package/dist/docs/guides/build-a-personalized-page.mdx +36 -18
  34. package/dist/docs/image-optimisation-service.md +33 -17
  35. package/dist/docs/index.md +28 -17
  36. package/dist/docs/mcp.md +46 -38
  37. package/dist/docs/pickedql/data-sources.md +65 -43
  38. package/dist/docs/pickedql/dimensions.md +27 -12
  39. package/dist/docs/pickedql/examples.md +38 -26
  40. package/dist/docs/pickedql/filtering.md +10 -6
  41. package/dist/docs/pickedql/index.md +32 -14
  42. package/dist/docs/pickedql/schema.md +85 -76
  43. package/dist/docs/pickedql/virtual-functions.md +62 -36
  44. package/dist/docs/projects.mdx +14 -7
  45. package/dist/docs/reports.mdx +5 -3
  46. package/dist/docs/sdk/actions.md +33 -17
  47. package/dist/docs/sdk/conditions.md +8 -5
  48. package/dist/docs/sdk/content-security-policy.md +5 -4
  49. package/dist/docs/sdk/experiences.md +29 -11
  50. package/dist/docs/sdk/feature-allocation.md +79 -47
  51. package/dist/docs/sdk/features.md +130 -76
  52. package/dist/docs/sdk/fields.md +66 -42
  53. package/dist/docs/sdk/index.md +22 -13
  54. package/dist/docs/sdk/plugins/create-experience.md +18 -15
  55. package/dist/docs/sdk/plugins/dynamic-experiences.md +42 -16
  56. package/dist/docs/sdk/predicates.md +53 -37
  57. package/dist/docs/sdk/ssr/index.md +25 -8
  58. package/dist/docs/sdk/ssr/rendering-and-hydration.md +37 -16
  59. package/dist/docs/sdk/ssr/serialize.md +38 -20
  60. package/dist/docs/sdk/ssr/slots-and-placements.md +28 -10
  61. package/dist/docs/sdk/steps.md +100 -55
  62. package/dist/docs/steps.mdx +20 -11
  63. package/dist/docs/team-management.md +17 -11
  64. package/dist/docs/vite-plugin.md +26 -19
  65. package/dist/docs/workspace-versioning.mdx +14 -8
  66. package/dist/docs/workspaces.mdx +55 -24
  67. package/dist/esm/index.js +1 -1
  68. package/dist/esm/plugins/dynamic-experiences/index.js +2 -2
  69. package/dist/esm/server/index.js +1 -1
  70. package/dist/{plugin-BxMR7fOV.js → plugin-ChPkTj__.js} +1 -1
  71. package/dist/{plugin-CASdGtTX.cjs → plugin-DHn11gn6.cjs} +1 -1
  72. package/package.json +1 -1
  73. package/dist/api-CoUkIxIr.cjs +0 -1
@@ -15,19 +15,30 @@ Sections are reusable schema fragments you embed inside layouts, so common struc
15
15
 
16
16
  ## What a section is
17
17
 
18
- A Section is a reusable fragment of schema with its own **Key**. Where a [layout](/content/layouts) backs a whole Page or Step, a Section is a piece you compose into one or more layouts. Define the shape once, reuse it everywhere.
18
+ A Section is a reusable schema fragment with its own **Key**. A
19
+ [layout](/content/layouts) gives its shape to a whole Page or Step. A Section is a
20
+ part that you put into one or more layouts. Define the shape one time, then reuse it
21
+ everywhere.
19
22
 
20
23
  ## Create a section
21
24
 
22
- 1. Open your workspace and click **Sections** in the sidebar.
23
- 2. Click **New Section**.
24
- 3. Enter a name and a **Key**. The Key is a unique, stable identifier used in SDK code and API references.
25
- 4. Add fields and save.
25
+ 1. Open your workspace.
26
+ 2. Click **Sections** in the sidebar.
27
+ 3. Click **New Section**.
28
+ 4. Enter a name and a **Key**. The Key is a unique, stable identifier. Your SDK code
29
+ and your API calls both use it.
30
+ 5. Add your fields.
31
+ 6. Save.
26
32
 
27
33
  ## Use a section in a layout
28
34
 
29
- Add a **Section** field to a Page or Step Layout and point it at the Section you want to embed. The layout then carries the Section's fields wherever that field appears. A Content Entry built from the layout fills the Section's fields like any others.
35
+ Add a **Section** field to a Page Layout or a Step Layout. Point that field at the
36
+ Section that you want. The layout then carries the fields of the Section at every
37
+ place where that field appears. A Content Entry from the layout fills in the fields
38
+ of the Section in the same way as every other field.
30
39
 
31
- ## Changing a section
40
+ ## Change a section
32
41
 
33
- Editing a Section does not automatically migrate the entries that already use it. After changing a Section, revalidate the affected [Content Entries](/content/content-entries) and resolve any per-field errors before publishing.
42
+ An edit to a Section does not migrate the entries that use it. After you change a
43
+ Section, check each affected [Content Entry](/content/content-entries) again. Correct
44
+ every field error before you publish.
@@ -16,7 +16,7 @@ GET /api/v1/projects/:projectId/experiences/:id/content
16
16
  | --- | --- | --- |
17
17
  | `projectId` | path | The project the experience belongs to. |
18
18
  | `id` | path | The experience to fetch content for. |
19
- | `preview_token` | query | Optional. Returns preview (unpublished) content when present. |
19
+ | `preview_token` | query | Optional. With it, the endpoint returns preview content, which is unpublished. |
20
20
 
21
21
  ## Response
22
22
 
@@ -40,11 +40,14 @@ GET /api/v1/projects/:projectId/experiences/:id/content
40
40
  | `versionId` | `string \| null` | The published version id, or `null` on preview. |
41
41
  | `content[].id` | `string` | The Content Entry id. |
42
42
  | `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. |
43
+ | `content[].data` | `object` | The entry data. It matches the layout schema. |
44
44
 
45
- ## HTML asset inlining
45
+ ## An HTML asset comes back in the response
46
46
 
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):
47
+ A layout can have an [HTML asset](/content/asset-library) field. The value of that
48
+ field arrives inside the response. The endpoint changes the reference to
49
+ `{ id, content }`. There, `content` holds the HTML that you uploaded, as a string. It
50
+ is `null` when the endpoint cannot resolve it:
48
51
 
49
52
  ```json
50
53
  {
@@ -82,4 +85,6 @@ curl https://api.picked.app/api/v1/projects/proj_123/experiences/exp_123/content
82
85
  }
83
86
  ```
84
87
 
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.
88
+ See [Project Config](/delivery-api/project-config) for the endpoint that links a step
89
+ to an entry. See [Asset Library](/content/asset-library) for an HTML asset. See
90
+ [Server Snapshot](/sdk/ssr/serialize) for how the SDK reads this content.
@@ -4,20 +4,23 @@ layout: docs
4
4
 
5
5
  # Delivery API
6
6
 
7
- The Delivery API is a public, read-only REST API that serves your published project config and page content. It is separate from the GraphQL management API.
7
+ The Delivery API is a public REST API. It is read-only, and it serves the published
8
+ options of your project together with your page content. It is separate from the
9
+ GraphQL management API.
8
10
 
9
- ## Delivery API vs the management API
11
+ ## The Delivery API and the management API
10
12
 
11
- Picked has two HTTP APIs. Use the one that fits the job:
13
+ Picked has two HTTP APIs. Use the one that fits your work:
12
14
 
13
15
  | | Delivery API | Management API |
14
16
  | --- | --- | --- |
15
17
  | Style | REST | GraphQL |
16
18
  | Access | Public, anonymous | Authenticated |
17
19
  | Operations | Read-only | Read and write |
18
- | Use for | Serving published config and content to your app | Managing projects, experiences, and content |
20
+ | Use it to | Serve published options and content to your application | Control your projects, experiences, and content |
19
21
 
20
- The management API is documented under [API Reference](/api). This section covers the Delivery API.
22
+ The [API Reference](/api) covers the management API. This section covers the Delivery
23
+ API.
21
24
 
22
25
  ## Base URL and versioning
23
26
 
@@ -27,20 +30,24 @@ All Delivery API routes are versioned under `/api/v1`:
27
30
  https://api.picked.app/api/v1
28
31
  ```
29
32
 
30
- ## Published vs preview
33
+ ## Published content and preview content
31
34
 
32
35
  Each endpoint serves two surfaces:
33
36
 
34
- - **Published** content is anonymous. Anyone can read your published config and content.
35
- - **Preview** content is gated by a `preview_token` query parameter, so you can render unpublished drafts before going live.
37
+ - **Published** content is anonymous. Anybody can read your published options and
38
+ your published content.
39
+ - **Preview** content needs a `preview_token` query parameter. With it you can render
40
+ an unpublished draft before you make it live.
36
41
 
37
- A workspace's preview token is available as the `previewToken` field on the workspace in the management API, and the dashboard preview action issues one for you.
42
+ The management API holds the preview token of a workspace in the `previewToken`
43
+ field. The preview action in the dashboard also makes one for you.
38
44
 
39
45
  ## Endpoints
40
46
 
41
47
  | Endpoint | Description |
42
48
  | --- | --- |
43
- | [Project Config](/delivery-api/project-config) | `GET /api/v1/projects/:projectId` returns the published project config, including each step's content link. |
44
- | [Experience Content](/delivery-api/experience-content) | `GET /api/v1/projects/:projectId/experiences/:id/content` returns the Content Entries that back an experience. |
49
+ | [Project Config](/delivery-api/project-config) | `GET /api/v1/projects/:projectId` returns the published options of the project, with the content link of each step. |
50
+ | [Experience Content](/delivery-api/experience-content) | `GET /api/v1/projects/:projectId/experiences/:id/content` returns the Content Entries of an experience. |
45
51
 
46
- For the operational details shared by both endpoints, see [Preview, Caching & Crawling](/delivery-api/preview-caching-crawling).
52
+ Both endpoints share some behaviour. See
53
+ [Preview, cache, and crawlers](/delivery-api/preview-caching-crawling).
@@ -2,23 +2,30 @@
2
2
  layout: docs
3
3
  ---
4
4
 
5
- # Preview, Caching & Crawling
5
+ # Preview, cache, and crawlers
6
6
 
7
- The operational surface shared by both Delivery API endpoints: preview tokens, caching, CORS, and crawling.
7
+ Both Delivery API endpoints share this behaviour: the preview token, the cache, CORS,
8
+ and what a crawler can read.
8
9
 
9
10
  ## Preview tokens
10
11
 
11
- Pass `?preview_token=<token>` to read unpublished content. Both endpoints accept it, and both return `versionId: null` on the preview surface. An invalid token returns `401`.
12
+ Pass `?preview_token=<token>` to read unpublished content. Both endpoints take it,
13
+ and both return `versionId: null` for a preview. An invalid token returns `401`.
12
14
 
13
15
  ```bash
14
16
  curl "https://api.picked.app/api/v1/projects/proj_123?preview_token=<token>"
15
17
  ```
16
18
 
17
- A workspace's preview token is available as the `previewToken` field on the workspace in the [management API](/api), and the dashboard preview action issues one for you. Use the same token for the project config and the experience content requests so both come from the same preview surface.
19
+ The [management API](/api) holds the preview token of a workspace in the
20
+ `previewToken` field. The preview action in the dashboard also makes one for you.
18
21
 
19
- ## Caching
22
+ Use the same token for the project options request and for the experience content
23
+ request. Both then come from the same preview.
20
24
 
21
- Caching depends on the surface and the requesting client. The SDK sends a `Picked-Client: sdk` request header:
25
+ ## Cache
26
+
27
+ The cache rules depend on the surface and on the client that makes the request. The
28
+ SDK sends a `Picked-Client: sdk` request header:
22
29
 
23
30
  | Request | `Cache-Control` |
24
31
  | --- | --- |
@@ -26,11 +33,14 @@ Caching depends on the surface and the requesting client. The SDK sends a `Picke
26
33
  | Published, other clients | `private, no-store` |
27
34
  | Preview | `no-store` |
28
35
 
29
- Cacheable published responses also send `Vary: Picked-Client`, so a shared cache keys on the client header and never serves an SDK-cached body to a non-SDK request.
36
+ A published response that a cache can hold also sends `Vary: Picked-Client`. A shared
37
+ cache therefore keys on the client header. It never gives a body that it cached for
38
+ the SDK to a request from another client.
30
39
 
31
40
  ## CORS
32
41
 
33
- Both endpoints are cross-origin readable. An `OPTIONS` preflight returns `204` with the CORS headers:
42
+ Both endpoints can be read from another origin. An `OPTIONS` preflight returns `204`
43
+ with the CORS headers:
34
44
 
35
45
  | Header | Value |
36
46
  | --- | --- |
@@ -38,22 +48,25 @@ Both endpoints are cross-origin readable. An `OPTIONS` preflight returns `204` w
38
48
  | `Access-Control-Allow-Methods` | `GET, OPTIONS` |
39
49
  | `Access-Control-Allow-Headers` | `Content-Type, Picked-Client, Picked-Version, traceparent, tracestate` |
40
50
 
41
- ## Crawling and SEO
51
+ ## Crawlers and search rank
42
52
 
43
- Both endpoints are crawlable so search engines can read your published content. Preview URLs are disallowed, so drafts never reach the index. The `robots.txt` rules:
53
+ A crawler can read both endpoints, so a search engine can read your published
54
+ content. A preview URL is disallowed, so a draft never reaches the index. These are
55
+ the `robots.txt` rules:
44
56
 
45
57
  ```
46
58
  User-agent: *
47
59
 
48
- # Allow crawling of the public project config and experience content endpoints
60
+ # Let a crawler read the public project options and experience content.
49
61
  Allow: /api/v1/projects
50
62
  Allow: /api/v1/projects/*/experiences/*/content
51
63
 
52
- # Keep preview (draft) responses out of crawlers
64
+ # Keep a preview response, which is a draft, away from a crawler.
53
65
  Disallow: /api/v1/projects/*preview_token=
54
66
 
55
- # Everything else (GraphQL, MCP, internal, ping) stays disallowed
67
+ # Everything else stays disallowed: GraphQL, MCP, internal routes, and the ping.
56
68
  Disallow: /
57
69
  ```
58
70
 
59
- See [Project Config](/delivery-api/project-config) and [Experience Content](/delivery-api/experience-content) for the endpoints themselves.
71
+ See [Project Config](/delivery-api/project-config) and
72
+ [Experience Content](/delivery-api/experience-content) for the endpoints.
@@ -15,7 +15,7 @@ GET /api/v1/projects/:projectId
15
15
  | Parameter | In | Description |
16
16
  | --- | --- | --- |
17
17
  | `projectId` | path | The project to fetch config for. |
18
- | `preview_token` | query | Optional. Returns the preview (unpublished) config when present. |
18
+ | `preview_token` | query | Optional. With it, the endpoint returns the preview options, which are unpublished. |
19
19
 
20
20
  ## Response
21
21
 
@@ -25,11 +25,13 @@ The response carries the project's experiences and steps. Each step includes `la
25
25
  | --- | --- | --- |
26
26
  | `id` | `string` | The project id. |
27
27
  | `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. |
28
+ | `steps[].layoutContentId` | `string \| null` | The Content Entry of this step, or `null` when the step has no content. |
29
29
 
30
- ## Published vs preview
30
+ ## Published content and preview content
31
31
 
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).
32
+ For published content, `versionId` holds the ID of the published version. For preview
33
+ content, which you read with `?preview_token=...`, `versionId` is `null`, because
34
+ there is no published version. See [Preview, cache, and crawlers](/delivery-api/preview-caching-crawling).
33
35
 
34
36
  ## Example
35
37
 
@@ -6,9 +6,14 @@ import { Screenshot } from '../../components/Screenshot'
6
6
 
7
7
  # Experiences
8
8
 
9
- An experience is a personalized experience delivered to visitors on your site. Each experience maps to a component registered in your application.
9
+ An experience is personalized content that Picked serves to the visitors on your
10
+ site. Each experience points at a component that you register in your application.
10
11
 
11
- Picked has two kinds of experience. A **Flow** is a multi-step, interactive experience rendered in the browser, covered on this page. A **Page** is a standalone, server-rendered experience backed by CMS content, built for SEO-critical landing pages. See [Pages](/content/pages) for that kind.
12
+ An experience is either a **Flow** or a **Page**. A **Flow** is an interactive
13
+ experience of more than one step, and the browser renders it. This page covers the
14
+ flow. A **Page** is a standalone experience that the server renders from CMS content,
15
+ for a landing page where the search rank matters. See [Pages](/content/pages) for
16
+ that kind.
12
17
 
13
18
  <Screenshot
14
19
  route="/{orgSlug}/{projectId}/workspaces/{workspaceId}/experiences"
@@ -20,23 +25,34 @@ Picked has two kinds of experience. A **Flow** is a multi-step, interactive expe
20
25
  1. Open your project.
21
26
  2. Click **Experiences** in the sidebar.
22
27
  3. Click **New Experience**.
23
- 4. Enter a name and a component name. The component name must match a component registered in your application. See [SDK Experiences](/sdk/experiences) for details on registering components.
28
+ 4. Enter a name and a component name. The component name must match a component that
29
+ you register in your application. See [SDK Experiences](/sdk/experiences) for how
30
+ to register a component.
24
31
  5. Click **Create**.
25
32
 
26
- The flow editor opens with an empty canvas. See [Building Flows](/flow-builder/building-flows) to start adding nodes.
33
+ The flow editor opens with an empty canvas. See
34
+ [Build Flows](/flow-builder/building-flows) to add your first node.
27
35
 
28
36
  ## Experience settings
29
37
 
30
- Select no nodes on the canvas (or click the canvas background) to open the experience inspector in the right panel.
38
+ Choose no node on the canvas, or click the canvas background, to open the experience
39
+ inspector in the right panel.
31
40
 
32
- **Name**: The display name shown in the dashboard. Visitors don't see this.
41
+ **Name**: The name that the dashboard shows. Your visitors do not see it.
33
42
 
34
- **Component Name**: The identifier that maps this experience to a registered component in your application.
43
+ **Component Name**: The identifier that points this experience at a component in your
44
+ application.
35
45
 
36
- **Condition**: An optional activation condition. When set, the experience only activates for visitors who match the condition logic. See [Condition Builder](/flow-builder/condition-builder) for details on configuring conditions. Leave blank to activate for all visitors.
46
+ **Condition**: An optional condition. When you set it, the experience starts only for
47
+ a visitor who matches the condition. See
48
+ [Condition Builder](/flow-builder/condition-builder) for how to write one. Keep it
49
+ blank to start the experience for every visitor.
37
50
 
38
- **Initialize Open**: An optional condition that controls whether the experience opens automatically on page load. When blank, the experience loads but stays closed until opened.
51
+ **Initialize Open**: An optional condition that controls whether the experience opens
52
+ by itself when the page loads. When it is blank, the experience loads but stays
53
+ closed until something opens it.
39
54
 
40
55
  ## Experience list
41
56
 
42
- The experiences list shows all experiences in the current project. Click any experience to open it in the flow builder.
57
+ The experiences list shows every experience in the current project. Click an
58
+ experience to open it in the flow builder.
@@ -6,7 +6,8 @@ import { Screenshot } from '../../components/Screenshot'
6
6
 
7
7
  # Feature flags
8
8
 
9
- Feature flags let you run A/B tests and roll changes out gradually. Control which visitors see a change to your site, without deploying code.
9
+ A feature flag lets you run an A/B test and roll a change out in stages. It controls
10
+ which visitors see a change to your site, and you deploy no code.
10
11
 
11
12
  <Screenshot
12
13
  route="/{orgSlug}/{projectId}/workspaces/{workspaceId}/features"
@@ -23,66 +24,106 @@ Feature flags let you run A/B tests and roll changes out gradually. Control whic
23
24
 
24
25
  ## Keys
25
26
 
26
- Each feature flag has a unique key. Use this key in your application to check whether a visitor is allocated to the feature flag. The key is set when you create the feature flag and cannot be changed later.
27
+ Each feature flag has a unique key. Your application uses this key to check whether
28
+ Picked allocates a visitor to the feature flag. You set the key when you create the
29
+ feature flag, and you cannot change it later.
27
30
 
28
31
  ## Configure allocation
29
32
 
30
- Set allocation from the feature flag detail page:
33
+ Set the allocation from the detail page of the feature flag:
31
34
 
32
35
  | Control | What it does |
33
36
  | --- | --- |
34
- | **Enabled** | Whether visitors are allocated to the feature flag. A disabled feature flag allocates nobody, and records nothing — see [Disabling a feature flag](#disabling-a-feature-flag). |
35
- | **Weight** | The percentage of visitors allocated to the feature flag, from 0 to 100. |
36
- | **Description** | An internal note describing what the feature flag tests. |
37
+ | **Enabled** | Whether Picked allocates a visitor to the feature flag. A feature flag that is off allocates nobody, and it records nothing. See [Turn a feature flag off](#turn-a-feature-flag-off). |
38
+ | **Weight** | The percentage of visitors that Picked allocates to the feature flag, from 0 to 100. |
39
+ | **Description** | An internal note about what the feature flag tests. |
37
40
 
38
- A feature flag has one weight, and resolves to one of two outcomes per visitor: allocated, or not. A weight of 30 allocates 30% of visitors and leaves the other 70% unallocated. A weight of 0 allocates nobody; a weight of 100 allocates everybody.
41
+ A feature flag has one weight. For each visitor it gives one of two outcomes:
42
+ allocated, or not allocated. A weight of 30 allocates 30% of your visitors. The other
43
+ 70% stay unallocated. A weight of 0 allocates nobody. A weight of 100 allocates
44
+ everybody.
39
45
 
40
46
  ## How visitors are allocated
41
47
 
42
- Allocation is deterministic. Each visitor is assigned a stable value derived from their visitor ID and the feature flag, which is compared against the feature flag's weight — if the value falls below the weight, the visitor is allocated.
48
+ The allocation is deterministic. Picked gives each visitor a stable value for each
49
+ feature flag. It derives that value from the visitor ID and from the ID of the feature
50
+ flag. It then compares the value against the weight. When the value is below the
51
+ weight, Picked allocates the visitor.
43
52
 
44
- The same visitor always gets the same result for a given feature flag, on every visit, as long as the weight stays the same. The version is not part of that value — it controls caching only, covered under [Feature flag versions](#feature-flag-versions).
53
+ The same visitor always gets the same result for one feature flag, on every visit,
54
+ while the weight stays the same. The version is not part of that value. It controls
55
+ the cache only. See [Feature flag versions](#feature-flag-versions).
45
56
 
46
- Each feature flag draws its own value, so concurrent tests are independent of one another. Two feature flags both at weight 50 split visitors into four equal quarters — allocated to both, to one, to the other, to neither. Three feature flags at weight 50 give eight groups of 12.5%, and so on for each feature flag you add.
57
+ Each feature flag gets its own value, so tests that run at the same time are
58
+ independent. Two feature flags, both at weight 50, split your visitors into four equal
59
+ parts: allocated to both, to one, to the other, or to neither. Three feature flags at
60
+ weight 50 give eight groups of 12.5%.
47
61
 
48
62
  :::note
49
- Within a single feature flag, raising the weight only ever adds visitors. Everyone allocated at weight 30 is still allocated at weight 50, so you can ramp a rollout up without moving anyone already in it. Lowering the weight removes visitors from the top of the range.
63
+ Inside one feature flag, a larger weight only adds visitors. Everybody at weight 30 is
64
+ still allocated at weight 50, so you can make a release wider and move nobody who is
65
+ in it already. A smaller weight removes visitors from the top of the range.
50
66
  :::
51
67
 
52
- ## Disabling a feature flag
68
+ ## Turn a feature flag off
53
69
 
54
- A disabled feature flag allocates nobody, and the distinction from a weight of 0 matters for your reporting: a visitor is **not in the test at all**, rather than assigned to control.
70
+ A feature flag that is off allocates nobody, and it records nothing. The difference
71
+ from a weight of 0 matters for your reports. The visitor is **not in the test at
72
+ all**, and the visitor is not in the control group.
55
73
 
56
- Nothing is recorded. The SDK does not evaluate the feature flag, stores no decision in the visitor's browser, and reports no decision to analytics. Disabled feature flags are absent from the feature list on every analytics event.
74
+ The SDK does not evaluate a feature flag that is off. It stores no decision in the
75
+ browser of the visitor, and it reports no decision to your analytics. Such a feature
76
+ flag is absent from the feature list on every analytics event.
57
77
 
58
- Experiences whose conditions reference a disabled feature flag behave as though the visitor is not in the test — the condition reads as not allocated, without an assignment being recorded.
78
+ An experience whose condition points at a feature flag that is off behaves as though
79
+ the visitor is not in the test. The condition reads as not allocated, and Picked
80
+ records no assignment.
59
81
 
60
- Disabling is temporary and does not discard decisions already made. A visitor who was allocated before you disabled the feature flag keeps that decision in their browser, and re-enabling picks up where it left off rather than re-drawing them.
82
+ This state is temporary, and it discards no decision that Picked made already. A
83
+ visitor who was allocated before keeps that decision in the browser. When you turn the
84
+ feature flag on again, Picked continues from that decision and does not allocate the
85
+ visitor again.
61
86
 
62
87
  :::note
63
- Expect a step change in reporting when a feature flag is disabled: fewer feature flags per visitor, and fewer decision events overall. That is the disabled feature flag dropping out, not data loss.
88
+ Expect a step change in your reports when you turn a feature flag off: fewer feature
89
+ flags for each visitor, and fewer decision events. That is the feature flag that drops
90
+ out, and you lose no data.
64
91
  :::
65
92
 
66
- Disabled feature flags remain visible in developer tooling, and a [URL override](/sdk/features#url-based-overrides) still forces one on for QA.
93
+ A feature flag that is off stays visible in the developer tools, and a
94
+ [URL override](/sdk/features#overrides-in-the-url) still turns one on for QA.
67
95
 
68
96
  ## Feature flag versions
69
97
 
70
- Each feature flag has a version number, starting at 1. The version forms part of the key the SDK uses to cache allocation decisions in the visitor's browser, and nothing else — it is not an input to the allocation value itself. Incrementing it discards those cached decisions, so every visitor is evaluated again on their next page load.
98
+ Each feature flag has a version number, and it starts at 1. The SDK caches an
99
+ allocation decision in the browser of the visitor under a key, and the version is part
100
+ of that key. The version does nothing else, and it is not an input to the allocation
101
+ value. When you increment the version, the SDK discards those cached decisions. It
102
+ then evaluates every visitor again on the next page load.
71
103
 
72
104
  ### What happens when you increment the version
73
105
 
74
- - **Cached decisions are invalidated.** The SDK caches decisions under a key that includes the version, so the old entry no longer matches and the feature flag is treated as undecided.
75
- - **Visitors are re-evaluated against the current weight.** Allocation is deterministic and the version is not one of its inputs, so re-evaluating the same visitor against an unchanged weight produces the same result.
76
- - **This is irreversible.** You cannot decrement a version.
106
+ - **The SDK invalidates the cached decisions.** The cache key holds the version, so the
107
+ old entry no longer matches and the feature flag counts as undecided.
108
+ - **Picked evaluates each visitor against the current weight.** The allocation is
109
+ deterministic and the version is not one of its inputs, so the same visitor against
110
+ an unchanged weight gives the same result.
111
+ - **You cannot reverse this.** There is no way to decrement a version.
77
112
 
78
113
  :::note
79
- Incrementing the version does not reshuffle visitors. It clears cached decisions and runs allocation again — with an unchanged weight, everyone lands where they were. Change the weight if you want visitors to move.
114
+ The new version does not move your visitors between groups. It clears the cached
115
+ decisions and runs the allocation again. With an unchanged weight, everybody lands
116
+ where they were before. Change the weight to move your visitors.
80
117
  :::
81
118
 
82
119
  ### When to increment
83
120
 
84
- Increment the version after changing the weight, when you want visitors who are already allocated to be re-evaluated against the new weight rather than keeping their cached decision.
121
+ Increment the version after you change the weight. Do this when you want Picked to
122
+ evaluate an allocated visitor again against the new weight, and not to use the cached
123
+ decision.
85
124
 
86
125
  ### When not to increment
87
126
 
88
- If you want a weight change to affect only visitors who have not been allocated yet, change the weight without incrementing the version. Existing visitors keep their current allocation.
127
+ To apply a weight change only to a visitor that Picked does not allocate yet, change
128
+ the weight and leave the version as it is. An allocated visitor keeps the current
129
+ allocation.
@@ -6,9 +6,12 @@ import { Screenshot } from '../../components/Screenshot'
6
6
 
7
7
  # Fields
8
8
 
9
- A field is a data input shown to visitors inside a step. Fields collect information like names, email addresses, preferences, or selections.
9
+ A field is a data input that a visitor sees inside a step. A field collects
10
+ information such as a name, an email address, a preference, or a choice.
10
11
 
11
- These are experience Fields, which collect visitor input. They are distinct from the Content Fields that make up a CMS layout's schema, covered in [Page & Step Layouts](/content/layouts).
12
+ This page covers the experience field, which collects visitor input. An experience
13
+ field is not the same as a content field. A content field is part of the schema of a
14
+ CMS layout. See [Page and Step Layouts](/content/layouts) for those.
12
15
 
13
16
  <Screenshot
14
17
  route="/{orgSlug}/{projectId}/workspaces/{workspaceId}/fields"
@@ -20,60 +23,72 @@ These are experience Fields, which collect visitor input. They are distinct from
20
23
  1. Open your project.
21
24
  2. Click **Fields** in the sidebar.
22
25
  3. Click **New Field**.
23
- 4. Enter a name, key, and label.
24
- 5. Select a type.
26
+ 4. Enter a name, a key, and a label.
27
+ 5. Choose a type.
25
28
  6. Click **Create**.
26
29
 
27
30
  ## Field types
28
31
 
29
- Fields support many types. Here are some common examples:
32
+ A field has one of many types. These are the common ones:
30
33
 
31
- `TEXT`: A string input. Use for names, emails, free-form text.
34
+ `TEXT`: A string input. Use it for a name, an email address, or free text.
32
35
 
33
- `NUMBER`: A numeric input. Use for quantities, ratings, ages.
36
+ `NUMBER`: A numeric input. Use it for a quantity, a rating, or an age.
34
37
 
35
- `BOOLEAN`: A true/false toggle. Use for checkboxes, opt-ins, consent.
38
+ `BOOLEAN`: A true or false toggle. Use it for a checkbox or for consent.
36
39
 
37
- `OBJECT`: A structured data input. Use for complex or nested data.
40
+ `OBJECT`: A structured data input. Use it for data that holds other data.
38
41
 
39
- ## Configuration
42
+ ## Options
40
43
 
41
- **Name**: Display name in the dashboard. Not visible to visitors.
44
+ **Name**: The name that the dashboard shows. Your visitors do not see it.
42
45
 
43
- **Key**: Programmatic identifier. Set once, can't change. Not visible to visitors.
46
+ **Key**: The identifier for your application. You set it once and you cannot change
47
+ it. Your visitors do not see it.
44
48
 
45
- **Label**: The label visitors see next to the field.
49
+ **Label**: The label that a visitor sees next to the field.
46
50
 
47
- **Placeholder**: Hint text shown inside the input when empty.
51
+ **Placeholder**: The hint text that the input shows while it is empty.
48
52
 
49
- **Description**: A longer description of the field's purpose. Shown in the dashboard, not to visitors.
53
+ **Description**: A longer description of what the field is for. The dashboard shows
54
+ it. Your visitors do not see it.
50
55
 
51
- **Help Text**: Assistive text shown to visitors below the field.
56
+ **Help Text**: Text below the field that helps your visitors.
52
57
 
53
- **Default Value**: The initial value when the field loads.
58
+ **Default Value**: The value that the field holds when it loads.
54
59
 
55
60
  ## Validation
56
61
 
57
- **Required**: When enabled, visitors must fill in this field before proceeding.
62
+ **Required**: When this is on, a visitor must fill in the field before the flow can
63
+ continue.
58
64
 
59
- **Validation rules**: Define conditions for advanced constraints like minimum/maximum values, patterns, or custom logic. See [Condition Builder](/flow-builder/condition-builder) for details on building validation rules.
65
+ **Validation rules**: Conditions for a constraint such as a smallest value, a largest
66
+ value, or a pattern. See [Condition Builder](/flow-builder/condition-builder) for how
67
+ to build a validation rule.
60
68
 
61
- ## Multiple values
69
+ ## More than one value
62
70
 
63
- Enable **Multiple** to allow visitors to submit more than one value for this field. Useful for multi-select inputs or tag-style fields.
71
+ Turn on **Multiple** to let a visitor send more than one value for the field. This is
72
+ useful for an input that takes several choices, or for a field of tags.
64
73
 
65
- ## Options
74
+ ## Choices
66
75
 
67
- For fields that present a fixed set of choices (like dropdowns or radio buttons), add options. Each option has a value that gets submitted with the response.
76
+ For a field with a fixed set of choices, such as a dropdown or a set of radio
77
+ buttons, add options. Each option has a value, and the response carries that value.
68
78
 
69
- Each option can also have a condition applied. When a condition is set, the option only appears to visitors who match the condition logic. See [Condition Builder](/flow-builder/condition-builder) for details.
79
+ Each option can also carry a condition. When you set one, the option appears only to
80
+ a visitor who matches the condition. See
81
+ [Condition Builder](/flow-builder/condition-builder) for more detail.
70
82
 
71
83
  ## Privacy
72
84
 
73
- **Do Not Track**: When enabled, this field's data is excluded from analytics tracking.
85
+ **Do Not Track**: When this is on, Picked keeps the data of this field out of your
86
+ analytics.
74
87
 
75
- **Do Not Store**: When enabled, this field's data is processed but not persisted. Use for sensitive information like passwords or payment details.
88
+ **Do Not Store**: When this is on, Picked reads the data of this field but does not
89
+ keep it. Use it for sensitive information such as a password or payment detail.
76
90
 
77
91
  ## Reuse fields
78
92
 
79
- Fields are project-level entities. Assign the same field to multiple steps across different experiences. Changes to a field's configuration apply everywhere it's used.
93
+ A field is a project-level entity. Assign the same field to steps in more than one
94
+ experience. A change to the options of a field applies at every place that uses it.