@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.
- package/dist/.tsbuildinfo +1 -1
- package/dist/{api-d0qKmzPH.js → api-03c5jvVk.js} +1 -1
- package/dist/{api-Djuh2gfe.cjs → api-CQxCVIrm.cjs} +1 -1
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/plugins/dynamic-experiences/index.js +1 -1
- package/dist/cjs/server/index.js +1 -1
- package/dist/docs/explanation/conditions-and-the-logic-engine.md +94 -0
- package/dist/docs/explanation/feature-flag-allocation.md +176 -0
- package/dist/docs/explanation/how-picked-works.md +124 -0
- package/dist/docs/explanation/how-pickedql-works.md +76 -0
- package/dist/docs/explanation/pages-and-flows.md +64 -0
- package/dist/docs/explanation/the-content-model.md +77 -0
- package/dist/docs/explanation/the-two-apis.md +68 -0
- package/dist/docs/explanation/why-server-side-rendering.md +76 -0
- package/dist/docs/explanation/workspaces-and-versions.md +71 -0
- package/dist/docs/how-to/add-a-step-field-or-action.md +43 -0
- package/dist/docs/{pickedql/examples.md → how-to/analytics/index.md} +19 -6
- package/dist/docs/how-to/archive-or-delete-a-workspace.md +46 -0
- package/dist/docs/how-to/authenticate-with-a-magic-link.md +40 -0
- package/dist/docs/how-to/authenticate-with-a-password.md +51 -0
- package/dist/docs/how-to/authenticate-with-an-api-key.md +51 -0
- package/dist/docs/how-to/authenticate-with-oauth.md +40 -0
- package/dist/docs/{flow-builder/building-flows.md → how-to/build-a-flow.md} +13 -9
- package/dist/docs/how-to/connect-the-mcp-server.md +38 -0
- package/dist/docs/how-to/create-a-project.md +29 -0
- package/dist/docs/how-to/create-an-experience.md +42 -0
- package/dist/docs/how-to/create-and-revoke-an-api-key.md +37 -0
- package/dist/docs/how-to/debug-with-the-chrome-extension.md +57 -0
- package/dist/docs/how-to/define-a-page-layout.md +39 -0
- package/dist/docs/how-to/fill-and-publish-a-page.md +50 -0
- package/dist/docs/{gtm-template.md → how-to/install-the-gtm-template.md} +9 -3
- package/dist/docs/how-to/install-the-sdk.md +68 -0
- package/dist/docs/how-to/install-the-vite-plugin.md +56 -0
- package/dist/docs/how-to/invite-and-remove-members.md +34 -0
- package/dist/docs/how-to/preview-a-workspace.md +28 -0
- package/dist/docs/how-to/publish-a-workspace.md +30 -0
- package/dist/docs/how-to/read-a-feature-flag.md +101 -0
- package/dist/docs/how-to/register-a-component.md +55 -0
- package/dist/docs/how-to/register-an-action-handler.md +67 -0
- package/dist/docs/how-to/render-a-step-form.md +132 -0
- package/dist/docs/how-to/render-an-unpublished-preview.md +41 -0
- package/dist/docs/how-to/reuse-a-section.md +37 -0
- package/dist/docs/how-to/reuse-a-step-field-or-action.md +28 -0
- package/dist/docs/how-to/roll-back-a-published-version.md +26 -0
- package/dist/docs/how-to/run-an-ab-test.md +49 -0
- package/dist/docs/how-to/run-code-on-a-form-submission.md +125 -0
- package/dist/docs/how-to/server-render-a-page.md +81 -0
- package/dist/docs/how-to/set-a-content-security-policy.md +32 -0
- package/dist/docs/how-to/set-up-mfa.md +69 -0
- package/dist/docs/how-to/upload-and-use-an-asset.mdx +73 -0
- package/dist/docs/how-to/validate-a-field.md +52 -0
- package/dist/docs/how-to/write-a-condition.md +45 -0
- package/dist/docs/how-to/write-a-predicate.md +60 -0
- package/dist/docs/index.md +41 -70
- package/dist/docs/reference/dashboard/actions.mdx +53 -0
- package/dist/docs/{api-keys.mdx → reference/dashboard/api-keys.mdx} +7 -15
- package/dist/docs/reference/dashboard/conditions.mdx +42 -0
- package/dist/docs/reference/dashboard/content/asset-library.mdx +63 -0
- package/dist/docs/{content → reference/dashboard/content}/content-entries.mdx +11 -3
- package/dist/docs/{content → reference/dashboard/content}/layouts.mdx +11 -35
- package/dist/docs/reference/dashboard/content/pages.mdx +35 -0
- package/dist/docs/reference/dashboard/content/sections.mdx +28 -0
- package/dist/docs/{experiences.mdx → reference/dashboard/experiences.mdx} +9 -16
- package/dist/docs/{features.mdx → reference/dashboard/features.mdx} +26 -41
- package/dist/docs/{fields.mdx → reference/dashboard/fields.mdx} +26 -20
- package/dist/docs/{flow-builder/overview.mdx → reference/dashboard/flow-builder/canvas.mdx} +8 -13
- package/dist/docs/{flow-builder → reference/dashboard/flow-builder}/condition-builder.md +5 -13
- package/dist/docs/{flow-builder → reference/dashboard/flow-builder}/keyboard-shortcuts.md +7 -1
- package/dist/docs/{flow-builder → reference/dashboard/flow-builder}/nodes.md +10 -3
- package/dist/docs/reference/dashboard/projects.mdx +44 -0
- package/dist/docs/reference/dashboard/reports.mdx +43 -0
- package/dist/docs/reference/dashboard/steps.mdx +37 -0
- package/dist/docs/{team-management.md → reference/dashboard/team-management.md} +5 -22
- package/dist/docs/{workspace-versioning.mdx → reference/dashboard/workspace-versioning.mdx} +6 -10
- package/dist/docs/reference/dashboard/workspaces.mdx +76 -0
- package/dist/docs/{delivery-api → reference/delivery-api}/experience-content.md +11 -4
- package/dist/docs/reference/delivery-api/index.md +45 -0
- package/dist/docs/{delivery-api → reference/delivery-api}/preview-caching-crawling.md +12 -5
- package/dist/docs/{delivery-api → reference/delivery-api}/project-config.md +11 -4
- package/dist/docs/reference/glossary.md +173 -0
- package/dist/docs/reference/management-api/authentication.md +74 -0
- package/dist/docs/{api → reference/management-api}/authorization-and-scopes.md +10 -3
- package/dist/docs/{api → reference/management-api}/error-handling.md +9 -3
- package/dist/docs/{api → reference/management-api}/pagination.md +6 -0
- package/dist/docs/{pickedql → reference/pickedql}/data-sources.md +16 -9
- package/dist/docs/{pickedql → reference/pickedql}/dimensions.md +7 -0
- package/dist/docs/{pickedql → reference/pickedql}/filtering.md +7 -0
- package/dist/docs/reference/pickedql/index.md +18 -0
- package/dist/docs/{pickedql → reference/pickedql}/schema.md +13 -6
- package/dist/docs/{pickedql → reference/pickedql}/virtual-functions.md +7 -0
- package/dist/docs/reference/sdk/actions.md +30 -0
- package/dist/docs/{sdk → reference/sdk}/conditions.md +8 -1
- package/dist/docs/reference/sdk/content-security-policy.md +21 -0
- package/dist/docs/reference/sdk/experiences.md +51 -0
- package/dist/docs/{sdk → reference/sdk}/features.md +30 -117
- package/dist/docs/{sdk → reference/sdk}/fields.md +10 -88
- package/dist/docs/reference/sdk/index.md +68 -0
- package/dist/docs/{sdk → reference/sdk}/plugins/create-experience.md +10 -22
- package/dist/docs/reference/sdk/plugins/dynamic-experiences.md +74 -0
- package/dist/docs/reference/sdk/plugins/index.md +29 -0
- package/dist/docs/{sdk → reference/sdk}/plugins/window-object.md +6 -0
- package/dist/docs/reference/sdk/predicates.md +43 -0
- package/dist/docs/reference/sdk/ssr/index.md +33 -0
- package/dist/docs/{sdk → reference/sdk}/ssr/rendering-and-hydration.md +4 -63
- package/dist/docs/{sdk → reference/sdk}/ssr/serialize.md +6 -33
- package/dist/docs/{sdk → reference/sdk}/ssr/slots-and-placements.md +7 -1
- package/dist/docs/reference/sdk/steps.md +87 -0
- package/dist/docs/reference/tools/chrome-extension.md +16 -0
- package/dist/docs/{image-optimisation-service.md → reference/tools/image-optimisation-service.md} +8 -0
- package/dist/docs/{mcp.md → reference/tools/mcp.md} +5 -45
- package/dist/docs/{vite-plugin.md → reference/tools/vite-plugin.md} +34 -35
- package/dist/docs/{api/index.md → tutorials/first-api-call.md} +27 -15
- package/dist/docs/tutorials/first-experience-in-the-dashboard.mdx +143 -0
- package/dist/docs/tutorials/first-experience.mdx +255 -0
- package/dist/docs/tutorials/first-server-rendered-page.mdx +186 -0
- package/dist/esm/index.js +290 -319
- package/dist/esm/plugins/dynamic-experiences/index.js +3 -3
- package/dist/esm/server/index.js +22 -22
- package/dist/plugin-CHOVsx7Z.js +287 -0
- package/dist/plugin-DsaGXQHx.cjs +1 -0
- package/dist/types/data-source/api.d.ts +60 -0
- package/dist/types/data-source/api.d.ts.map +1 -0
- package/dist/types/data-source/provider.d.ts +97 -0
- package/dist/types/data-source/provider.d.ts.map +1 -0
- package/dist/types/entities/feature/feature.d.ts +16 -0
- package/dist/types/entities/feature/feature.d.ts.map +1 -1
- package/dist/types/exports.d.ts +0 -2
- package/dist/types/exports.d.ts.map +1 -1
- package/dist/types/index.d.ts +0 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/picked.d.ts +15 -0
- package/dist/types/picked.d.ts.map +1 -1
- package/dist/types/plugins/dynamic-experiences/index.d.ts +2 -0
- package/dist/types/plugins/dynamic-experiences/index.d.ts.map +1 -1
- package/dist/types/plugins/dynamic-experiences/plugin.d.ts +2 -34
- package/dist/types/plugins/dynamic-experiences/plugin.d.ts.map +1 -1
- package/dist/types/plugins/dynamic-experiences/types.d.ts +34 -16
- package/dist/types/plugins/dynamic-experiences/types.d.ts.map +1 -1
- package/dist/types/server/serialize.d.ts +7 -6
- package/dist/types/server/serialize.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/docs/actions.mdx +0 -98
- package/dist/docs/api/authentication.md +0 -403
- package/dist/docs/chrome-extension.md +0 -68
- package/dist/docs/conditions.mdx +0 -72
- package/dist/docs/content/asset-library.mdx +0 -124
- package/dist/docs/content/pages.mdx +0 -82
- package/dist/docs/content/sections.mdx +0 -44
- package/dist/docs/delivery-api/index.md +0 -53
- package/dist/docs/guides/build-a-personalized-page.mdx +0 -161
- package/dist/docs/pickedql/index.md +0 -54
- package/dist/docs/projects.mdx +0 -44
- package/dist/docs/reports.mdx +0 -20
- package/dist/docs/sdk/actions.md +0 -82
- package/dist/docs/sdk/content-security-policy.md +0 -33
- package/dist/docs/sdk/experiences.md +0 -64
- package/dist/docs/sdk/feature-allocation.md +0 -161
- package/dist/docs/sdk/index.md +0 -98
- package/dist/docs/sdk/plugins/dynamic-experiences.md +0 -84
- package/dist/docs/sdk/plugins/index.md +0 -9
- package/dist/docs/sdk/predicates.md +0 -128
- package/dist/docs/sdk/ssr/index.md +0 -79
- package/dist/docs/sdk/steps.md +0 -479
- package/dist/docs/steps.mdx +0 -53
- package/dist/docs/workspaces.mdx +0 -133
- package/dist/plugin-BVAFWjpT.js +0 -252
- package/dist/plugin-BcCn2llk.cjs +0 -1
- package/dist/types/entities/content/reference.d.ts +0 -101
- package/dist/types/entities/content/reference.d.ts.map +0 -1
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: how-to
|
|
3
|
+
layout: docs
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# How to write a predicate
|
|
7
|
+
|
|
8
|
+
This guide shows you how to let a condition read data that only your application holds,
|
|
9
|
+
such as a cart total or an account level.
|
|
10
|
+
|
|
11
|
+
## 1. Define the predicate
|
|
12
|
+
|
|
13
|
+
Pass a `predicates` object to `createClient()`:
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import { createClient } from '@picked/client'
|
|
17
|
+
|
|
18
|
+
const client = createClient({
|
|
19
|
+
projectId: 'your-project-id',
|
|
20
|
+
predicates: {
|
|
21
|
+
'is-example-page': ({ location }) => location?.pathname === '/example',
|
|
22
|
+
'get-account-tier': async () => {
|
|
23
|
+
const data = await fetch('/api/get-account-tier').then((r) => r.json())
|
|
24
|
+
return data.result
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
})
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
A predicate returns a boolean, a string, an array of strings, or `undefined`. It can also
|
|
31
|
+
return a promise that resolves to one of those.
|
|
32
|
+
|
|
33
|
+
## 2. Invoke it from a condition
|
|
34
|
+
|
|
35
|
+
```ts
|
|
36
|
+
condition: {
|
|
37
|
+
'==': [
|
|
38
|
+
{ invoke: { var: 'predicates.is-example-page' } },
|
|
39
|
+
true,
|
|
40
|
+
],
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
:::tip
|
|
45
|
+
A predicate also works inside `validation` logic.
|
|
46
|
+
:::
|
|
47
|
+
|
|
48
|
+
## Keep it pure and fast
|
|
49
|
+
|
|
50
|
+
- The same snapshot must always give the same result.
|
|
51
|
+
- Check that a response or a field is there before you read its value. Return `undefined`
|
|
52
|
+
when the data is not available, and do not throw.
|
|
53
|
+
- The SDK can invoke a predicate many times, so keep the logic small.
|
|
54
|
+
- Do not change the snapshot. It is frozen, and a change to it throws in strict mode.
|
|
55
|
+
|
|
56
|
+
## Related
|
|
57
|
+
|
|
58
|
+
- [Predicates](/reference/sdk/predicates) — the state snapshot shape.
|
|
59
|
+
- [About conditions and the logic engine](/explanation/conditions-and-the-logic-engine) —
|
|
60
|
+
why predicates exist.
|
package/dist/docs/index.md
CHANGED
|
@@ -1,88 +1,59 @@
|
|
|
1
1
|
---
|
|
2
|
+
type: map
|
|
2
3
|
layout: docs
|
|
3
4
|
---
|
|
4
5
|
|
|
5
|
-
#
|
|
6
|
+
# Picked documentation
|
|
6
7
|
|
|
7
|
-
Picked lets you build personalized UI flows in a visual editor. The SDK then serves
|
|
8
|
-
|
|
8
|
+
Picked lets you build personalized UI flows in a visual editor. The SDK then serves them
|
|
9
|
+
to the visitors on your site.
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
There are two paths to follow. Choose the one that matches your work.
|
|
11
12
|
|
|
12
|
-
|
|
13
|
-
reads your published experiences and renders them on your site.
|
|
13
|
+
## Work in the dashboard
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
Build experiences, write content, and publish.
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
Start with [build your first experience](/tutorials/first-experience-in-the-dashboard).
|
|
18
|
+
It takes you from an empty project to a survey on your own site, and it needs no
|
|
19
|
+
development tools.
|
|
18
20
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
One thing must happen first: a developer adds the Picked SDK to your site one time. After
|
|
22
|
+
that, the dashboard is all you need.
|
|
21
23
|
|
|
22
|
-
|
|
24
|
+
Then:
|
|
23
25
|
|
|
24
|
-
|
|
26
|
+
- **[Build](/how-to/create-an-experience)** — experiences, flows, conditions, and A/B
|
|
27
|
+
tests.
|
|
28
|
+
- **[Content](/how-to/define-a-page-layout)** — layouts, sections, pages, and assets.
|
|
29
|
+
- **[Publish](/how-to/publish-a-workspace)** — preview, publish, and roll back.
|
|
30
|
+
- **[Administer and measure](/how-to/invite-and-remove-members)** — members, API keys,
|
|
31
|
+
analytics, and the tools that connect Picked to Google Tag Manager and to an AI tool.
|
|
32
|
+
- **[Dashboard reference](/reference/dashboard/projects)** — every dashboard screen and
|
|
33
|
+
every option, plus the [glossary](/reference/glossary).
|
|
34
|
+
- **[How Picked works](/explanation/how-picked-works)** — what happens when you publish.
|
|
25
35
|
|
|
26
|
-
|
|
27
|
-
home page.
|
|
36
|
+
## Integrate with code
|
|
28
37
|
|
|
29
|
-
|
|
30
|
-
|
|
38
|
+
Add Picked to a site or an application. Your code then renders the experiences that the
|
|
39
|
+
dashboard describes.
|
|
31
40
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
plugins: [],
|
|
35
|
-
})
|
|
41
|
+
Start with [add Picked to your application](/tutorials/first-experience). It goes from an
|
|
42
|
+
empty project to a survey that runs in React or in Svelte.
|
|
36
43
|
|
|
37
|
-
|
|
38
|
-
|
|
44
|
+
Read the dashboard documents above also. Everything your code renders is described
|
|
45
|
+
there, so the two paths link to each other rather than repeat.
|
|
39
46
|
|
|
40
|
-
|
|
47
|
+
Then:
|
|
41
48
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
'welcome-survey': YourComponent,
|
|
54
|
-
},
|
|
55
|
-
})
|
|
56
|
-
|
|
57
|
-
picked.start()
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
See [SDK Experiences](/sdk/experiences) for conditions, adapters, and the rules that
|
|
61
|
-
put an experience in a slot.
|
|
62
|
-
|
|
63
|
-
### 4. Create an experience
|
|
64
|
-
|
|
65
|
-
In the dashboard, open your project. Click **Experiences**, then **New Experience**.
|
|
66
|
-
Enter a name. Set the component name to match your registered component, for example
|
|
67
|
-
`welcome-survey`.
|
|
68
|
-
|
|
69
|
-
See [Experiences](/experiences) for the options.
|
|
70
|
-
|
|
71
|
-
### 5. Build the flow
|
|
72
|
-
|
|
73
|
-
Open the flow builder. Drag steps, actions, and conditions onto the canvas. Connect
|
|
74
|
-
the nodes to define the path that a visitor takes through the experience.
|
|
75
|
-
|
|
76
|
-
See [Flow Builder](/flow-builder/overview) for a full guide.
|
|
77
|
-
|
|
78
|
-
### 6. Save and publish
|
|
79
|
-
|
|
80
|
-
Click **Save** in the flow builder toolbar. The SDK reads the published experience
|
|
81
|
-
and renders it to each visitor who matches.
|
|
82
|
-
|
|
83
|
-
## Next steps
|
|
84
|
-
|
|
85
|
-
- [Flow Builder](/flow-builder/overview) — Build experience flows in a visual editor
|
|
86
|
-
- [Steps](/steps), [Fields](/fields), [Actions](/actions), [Conditions](/conditions)
|
|
87
|
-
— Set up the parts of an experience
|
|
88
|
-
- [SDK Installation](/sdk) — Full SDK setup and options
|
|
49
|
+
- **[Integrate the SDK](/how-to/install-the-sdk)** — install, register a component, read
|
|
50
|
+
a feature flag.
|
|
51
|
+
- **[Build a step form](/how-to/render-a-step-form)** — render fields, act on a
|
|
52
|
+
submission, validate input.
|
|
53
|
+
- **[Server-side rendering](/how-to/server-render-a-page)** — a page that a search engine
|
|
54
|
+
can read.
|
|
55
|
+
- **[Authenticate](/how-to/authenticate-with-a-password)** — the management API.
|
|
56
|
+
- **[SDK reference](/reference/sdk)**, **[Delivery API](/reference/delivery-api)**,
|
|
57
|
+
**[PickedQL](/reference/pickedql)**.
|
|
58
|
+
- **[Why it works this way](/explanation/why-server-side-rendering)** — the design
|
|
59
|
+
behind the SDK.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: reference
|
|
3
|
+
layout: docs
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
import { Screenshot } from '../../../../components/Screenshot'
|
|
7
|
+
|
|
8
|
+
# Actions
|
|
9
|
+
|
|
10
|
+
An action is a side effect that starts when the flow reaches it. Use an action to
|
|
11
|
+
track an event, to send data to an external service, or to call a webhook.
|
|
12
|
+
|
|
13
|
+
<Screenshot
|
|
14
|
+
route="/{orgSlug}/{projectId}/workspaces/{workspaceId}/actions"
|
|
15
|
+
alt="The actions list for a workspace on the Picked dashboard"
|
|
16
|
+
/>
|
|
17
|
+
|
|
18
|
+
## Set up an action
|
|
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 action. Your visitors do
|
|
23
|
+
not see it.
|
|
24
|
+
|
|
25
|
+
## Register in your application
|
|
26
|
+
|
|
27
|
+
Each action key must match a key in the `actions` object that you pass to
|
|
28
|
+
`createClient()`. See
|
|
29
|
+
[How to register an action handler](/how-to/register-an-action-handler) for the code, and
|
|
30
|
+
[SDK actions](/reference/sdk/actions) for what the handler receives and returns.
|
|
31
|
+
|
|
32
|
+
## Use actions in flows
|
|
33
|
+
|
|
34
|
+
In the flow builder, drag an action from the library onto the canvas. Connect it to
|
|
35
|
+
the point in the flow where you want it to start.
|
|
36
|
+
|
|
37
|
+
An action runs when the flow reaches its node. It does not interrupt your visitor. By
|
|
38
|
+
default the flow continues to the next connected node.
|
|
39
|
+
|
|
40
|
+
An action node can carry a **success** branch and a **failure** branch. Which one the flow
|
|
41
|
+
takes depends on whether your handler throws, and a returned `false` is a success. See
|
|
42
|
+
[How an action decides which way to go](/explanation/how-picked-works#how-an-action-decides-which-way-to-go).
|
|
43
|
+
|
|
44
|
+
## Reuse actions
|
|
45
|
+
|
|
46
|
+
An action belongs to the project. Use the same action in more than one experience flow.
|
|
47
|
+
A change to the options of an action applies at every place that uses it.
|
|
48
|
+
|
|
49
|
+
## Related
|
|
50
|
+
|
|
51
|
+
- [How to add a step, a field, an action, or a condition](/how-to/add-a-step-field-or-action)
|
|
52
|
+
- [How to register an action handler](/how-to/register-an-action-handler)
|
|
53
|
+
- [SDK actions](/reference/sdk/actions) — what the handler receives and returns.
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
---
|
|
2
|
+
type: reference
|
|
2
3
|
layout: docs
|
|
3
4
|
---
|
|
4
5
|
|
|
5
|
-
import { Screenshot } from '
|
|
6
|
+
import { Screenshot } from '../../../../components/Screenshot'
|
|
6
7
|
|
|
7
8
|
# API keys
|
|
8
9
|
|
|
@@ -14,20 +15,10 @@ or for a CI/CD workflow.
|
|
|
14
15
|
alt="The API keys list for an organization on the Picked dashboard"
|
|
15
16
|
/>
|
|
16
17
|
|
|
17
|
-
## Create an API key
|
|
18
|
-
|
|
19
|
-
1. Open your organization.
|
|
20
|
-
2. Click **API Keys**.
|
|
21
|
-
3. Click **Create Key**.
|
|
22
|
-
4. Enter a description.
|
|
23
|
-
5. Click **Create**.
|
|
24
|
-
|
|
25
|
-
Copy the key immediately. The dashboard does not show it again.
|
|
26
|
-
|
|
27
18
|
## Use an API key
|
|
28
19
|
|
|
29
20
|
Put your API key in the `Authorization` header of each request to the
|
|
30
|
-
[Picked API](/api).
|
|
21
|
+
[Picked API](/tutorials/first-api-call).
|
|
31
22
|
|
|
32
23
|
```
|
|
33
24
|
Authorization: Bearer your-api-key
|
|
@@ -39,7 +30,8 @@ An API key carries scopes, and the scopes limit what the key can reach. Choose t
|
|
|
39
30
|
scopes that your integration needs when you create the key. A key can do only the
|
|
40
31
|
operations that its scopes permit.
|
|
41
32
|
|
|
42
|
-
##
|
|
33
|
+
## Related
|
|
43
34
|
|
|
44
|
-
|
|
45
|
-
to
|
|
35
|
+
- [How to create and revoke an API key](/how-to/create-and-revoke-an-api-key)
|
|
36
|
+
- [How to authenticate with an API key](/how-to/authenticate-with-an-api-key) — the API
|
|
37
|
+
side.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: reference
|
|
3
|
+
layout: docs
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
import { Screenshot } from '../../../../components/Screenshot'
|
|
7
|
+
|
|
8
|
+
# Conditions
|
|
9
|
+
|
|
10
|
+
A condition evaluates a rule and splits the flow into two paths. One path is for a
|
|
11
|
+
true result, the other for a false result.
|
|
12
|
+
|
|
13
|
+
<Screenshot
|
|
14
|
+
route="/{orgSlug}/{projectId}/workspaces/{workspaceId}/conditions"
|
|
15
|
+
alt="The conditions list for a workspace on the Picked dashboard"
|
|
16
|
+
/>
|
|
17
|
+
|
|
18
|
+
## Set up a condition
|
|
19
|
+
|
|
20
|
+
**Name**: The name that the dashboard shows. Your visitors do not see it.
|
|
21
|
+
|
|
22
|
+
**Key**: The identifier for your application. You set it once and you cannot change
|
|
23
|
+
it. Your visitors do not see it.
|
|
24
|
+
|
|
25
|
+
## Branches
|
|
26
|
+
|
|
27
|
+
In the flow builder, a condition node has two output handles. The green handle, for a
|
|
28
|
+
true result, leads to the path for a match. The red handle, for a false result, leads
|
|
29
|
+
to the other path.
|
|
30
|
+
|
|
31
|
+
You can chain conditions. Connect the output of one condition to the input of another
|
|
32
|
+
to build a decision tree.
|
|
33
|
+
|
|
34
|
+
## Related
|
|
35
|
+
|
|
36
|
+
- [How to add a step, a field, an action, or a condition](/how-to/add-a-step-field-or-action)
|
|
37
|
+
|
|
38
|
+
- [About conditions and the logic engine](/explanation/conditions-and-the-logic-engine) —
|
|
39
|
+
what a rule can read.
|
|
40
|
+
- [How to write a condition](/how-to/write-a-condition)
|
|
41
|
+
- [Condition builder](/reference/dashboard/flow-builder/condition-builder) — the data
|
|
42
|
+
sources and the rule structure.
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: reference
|
|
3
|
+
layout: docs
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
import { Screenshot } from '../../../../../components/Screenshot'
|
|
7
|
+
|
|
8
|
+
# Asset Library
|
|
9
|
+
|
|
10
|
+
The Asset Library holds the files that your content points at. These are images,
|
|
11
|
+
video, documents, and HTML.
|
|
12
|
+
|
|
13
|
+
<Screenshot
|
|
14
|
+
route="/{orgSlug}/{projectId}/assets"
|
|
15
|
+
alt="The asset library on the Picked dashboard"
|
|
16
|
+
/>
|
|
17
|
+
|
|
18
|
+
## Upload and control your assets
|
|
19
|
+
|
|
20
|
+
The Asset Library is a project-level store. Upload a file, then point at it from any
|
|
21
|
+
Content Entry in the project.
|
|
22
|
+
|
|
23
|
+
- **Size limit:** 50 MB for each file.
|
|
24
|
+
- **Allowed types:** an image in PNG, JPEG, WebP, AVIF, GIF, or SVG. A video in MP4
|
|
25
|
+
or WebM. A common document format. HTML, as `text/html`.
|
|
26
|
+
|
|
27
|
+
Picked rejects a file of another type. It also rejects a file above the size limit.
|
|
28
|
+
|
|
29
|
+
## HTML assets
|
|
30
|
+
|
|
31
|
+
Upload a `.html` file and point at it from an **HTML asset** field. Picked then scans
|
|
32
|
+
the file. The scan is advisory: it helps you, and it never stops you. It
|
|
33
|
+
reports findings about speed, about search rank, and about accessibility, so that you
|
|
34
|
+
can improve the file before you publish it:
|
|
35
|
+
|
|
36
|
+
- **File size:** a warning at 100 KB, and a stronger one at 250 KB.
|
|
37
|
+
- **Inline images:** a note when inline `base64` image data adds about 50 KB or more.
|
|
38
|
+
- **Image dimensions:** an image with no width and no height. Such an image can move
|
|
39
|
+
the content around it while the page loads.
|
|
40
|
+
- **Lazy load:** an image with no `loading="lazy"` attribute.
|
|
41
|
+
- **Link safety:** an external link with `target="_blank"` and no `rel="noopener"`.
|
|
42
|
+
- **Link search rank:** an external link with no `rel="nofollow"`.
|
|
43
|
+
- **Accessibility:** a pass by `axe-core`. It covers alt text, heading order,
|
|
44
|
+
contrast, and more.
|
|
45
|
+
|
|
46
|
+
Every finding is advisory. You can always upload the file as it is.
|
|
47
|
+
|
|
48
|
+
## How assets are served
|
|
49
|
+
|
|
50
|
+
Picked serves each asset from a sandboxed storage origin. That origin is separate
|
|
51
|
+
from the trusted origin of your application. HTML therefore comes from its own
|
|
52
|
+
origin, so a document that you upload runs in isolation and cannot reach the page
|
|
53
|
+
that holds it. A script in that document cannot read a session, a token, or the DOM
|
|
54
|
+
around it, because each of those needs same-origin access.
|
|
55
|
+
|
|
56
|
+
An [Experience Content](/reference/delivery-api/experience-content) response can hold an HTML
|
|
57
|
+
asset. The response then carries the content of that asset, and the SDK renders it
|
|
58
|
+
with no second request to storage.
|
|
59
|
+
|
|
60
|
+
## Related
|
|
61
|
+
|
|
62
|
+
- [How to upload and use an asset](/how-to/upload-and-use-an-asset)
|
|
63
|
+
- [Fields](/reference/dashboard/fields) — the field type for an HTML asset.
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
---
|
|
2
|
+
type: reference
|
|
2
3
|
layout: docs
|
|
3
4
|
---
|
|
4
5
|
|
|
5
|
-
import { Screenshot } from '
|
|
6
|
+
import { Screenshot } from '../../../../../components/Screenshot'
|
|
6
7
|
|
|
7
8
|
# Content Entries
|
|
8
9
|
|
|
@@ -15,11 +16,11 @@ A Content Entry is an instance of a layout filled with real data. A Page renders
|
|
|
15
16
|
|
|
16
17
|
## What a content entry is
|
|
17
18
|
|
|
18
|
-
A Content Entry is an instance of a layout's schema. The [layout](/content/layouts) defines the fields; the entry holds the actual values. One layout can back many entries, each with its own data.
|
|
19
|
+
A Content Entry is an instance of a layout's schema. The [layout](/reference/dashboard/content/layouts) defines the fields; the entry holds the actual values. One layout can back many entries, each with its own data.
|
|
19
20
|
|
|
20
21
|
## How entries bind to pages and steps
|
|
21
22
|
|
|
22
|
-
A [Page](/content/pages) has a single Step, and that Step links to its entry through the layout content link. A Flow [Step](/steps) backed by a Step Layout binds an entry the same way. When the SDK renders the Page or Step, it resolves the linked entry and hands its data to your component.
|
|
23
|
+
A [Page](/reference/dashboard/content/pages) has a single Step, and that Step links to its entry through the layout content link. A Flow [Step](/reference/dashboard/steps) backed by a Step Layout binds an entry the same way. When the SDK renders the Page or Step, it resolves the linked entry and hands its data to your component.
|
|
23
24
|
|
|
24
25
|
## Edit entry data
|
|
25
26
|
|
|
@@ -34,3 +35,10 @@ Invalid data appears as an error on each field. The error carries a path in the
|
|
|
34
35
|
style, and it points at the exact place in the entry, for example
|
|
35
36
|
`sections[0].data.title`. Fix every error before you publish, because Picked serves
|
|
36
37
|
valid content only.
|
|
38
|
+
|
|
39
|
+
## Related
|
|
40
|
+
|
|
41
|
+
- [About the content model](/explanation/the-content-model) — why the schema and the data
|
|
42
|
+
are separate.
|
|
43
|
+
- [How to fill and publish a page](/how-to/fill-and-publish-a-page)
|
|
44
|
+
- [Page and step layouts](/reference/dashboard/content/layouts)
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
---
|
|
2
|
+
type: reference
|
|
2
3
|
layout: docs
|
|
3
4
|
---
|
|
4
5
|
|
|
5
|
-
import { Screenshot } from '
|
|
6
|
+
import { Screenshot } from '../../../../../components/Screenshot'
|
|
6
7
|
|
|
7
8
|
# Page & Step Layouts
|
|
8
9
|
|
|
@@ -13,13 +14,6 @@ Layouts are reusable JSON schemas. Page Layouts back standalone Pages; Step Layo
|
|
|
13
14
|
alt="The layouts list in the schema builder on the Picked dashboard"
|
|
14
15
|
/>
|
|
15
16
|
|
|
16
|
-
## What a layout is
|
|
17
|
-
|
|
18
|
-
A layout is a reusable schema. It defines the fields that a piece of content can
|
|
19
|
-
hold. A layout holds no data itself. A [Content Entry](/content/content-entries)
|
|
20
|
-
creates one copy of a layout and fills it in. The dashboard shows both layout kinds
|
|
21
|
-
under **Models**.
|
|
22
|
-
|
|
23
17
|
## A page layout and a step layout
|
|
24
18
|
|
|
25
19
|
Each layout has a fixed category, and the category decides what the layout gives its
|
|
@@ -27,21 +21,8 @@ shape to:
|
|
|
27
21
|
|
|
28
22
|
| Layout | It gives its shape to | Who renders it |
|
|
29
23
|
| --- | --- | --- |
|
|
30
|
-
| **Page Layout** | A standalone [Page](/content/pages). | The SDK renders the entry on your server. |
|
|
31
|
-
| **Step Layout** | One [Step](/steps) inside a Flow. | The Step renders the entry in the browser. |
|
|
32
|
-
|
|
33
|
-
## Create a layout
|
|
34
|
-
|
|
35
|
-
1. Open your workspace.
|
|
36
|
-
2. Click **Models** in the sidebar.
|
|
37
|
-
3. Click **New Model**.
|
|
38
|
-
4. Choose the category, **Page Layout** or **Step Layout**.
|
|
39
|
-
5. Enter a name and a **Key**. The Key is a unique, stable identifier. Your SDK code
|
|
40
|
-
and your API calls both use it.
|
|
41
|
-
6. Add your fields. See below.
|
|
42
|
-
7. Save.
|
|
43
|
-
|
|
44
|
-
The category is fixed at creation and cannot be changed later.
|
|
24
|
+
| **Page Layout** | A standalone [Page](/reference/dashboard/content/pages). | The SDK renders the entry on your server. |
|
|
25
|
+
| **Step Layout** | One [Step](/reference/dashboard/steps) inside a Flow. | The Step renders the entry in the browser. |
|
|
45
26
|
|
|
46
27
|
## Field types
|
|
47
28
|
|
|
@@ -59,8 +40,8 @@ A layout is built from fields. Each field has a type that decides its editor and
|
|
|
59
40
|
| **Color** | A color value. | A theme accent or a swatch. |
|
|
60
41
|
| **JSON** | Any JSON value. | Structured data with no editor of its own. |
|
|
61
42
|
| **Group** | An object of fields inside the layout. | A set of related fields, held together. |
|
|
62
|
-
| **Section** | A [Section](/content/sections) schema inside the layout. | A shared schema fragment that you reuse. |
|
|
63
|
-
| **Asset** | A link to an [Asset Library](/content/asset-library) item. | An image, a video, or a document. |
|
|
43
|
+
| **Section** | A [Section](/reference/dashboard/content/sections) schema inside the layout. | A shared schema fragment that you reuse. |
|
|
44
|
+
| **Asset** | A link to an [Asset Library](/reference/dashboard/content/asset-library) item. | An image, a video, or a document. |
|
|
64
45
|
| **HTML asset** | A link to a `.html` file in your library. | HTML that you wrote before, held inside the content. |
|
|
65
46
|
|
|
66
47
|
## Repeatable and grouped fields
|
|
@@ -73,14 +54,9 @@ A **Group** field holds a set of fields under one key, and it gives a structured
|
|
|
73
54
|
object. Make a group repeatable to describe a list of objects, such as a list of
|
|
74
55
|
feature cards.
|
|
75
56
|
|
|
76
|
-
##
|
|
77
|
-
|
|
78
|
-
A **Section** field holds a reusable [Section](/content/sections) schema inside the
|
|
79
|
-
layout. Define a common structure one time as a Section, such as a hero or a list of
|
|
80
|
-
features. Then point at it from any Page Layout or Step Layout.
|
|
81
|
-
|
|
82
|
-
## Change a schema
|
|
57
|
+
## Related
|
|
83
58
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
59
|
+
- [About the content model](/explanation/the-content-model) — why a schema change does not
|
|
60
|
+
migrate your data.
|
|
61
|
+
- [How to define a page layout](/how-to/define-a-page-layout)
|
|
62
|
+
- [How to reuse a section](/how-to/reuse-a-section)
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: reference
|
|
3
|
+
layout: docs
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
import { Screenshot } from '../../../../../components/Screenshot'
|
|
7
|
+
|
|
8
|
+
# Pages
|
|
9
|
+
|
|
10
|
+
A Page is a standalone, server-rendered experience backed by CMS content, built for SEO-critical landing pages.
|
|
11
|
+
|
|
12
|
+
<Screenshot
|
|
13
|
+
route="/{orgSlug}/{projectId}/workspaces/{workspaceId}/experiences"
|
|
14
|
+
alt="The experiences list, where Pages and Flows are created on the Picked dashboard"
|
|
15
|
+
/>
|
|
16
|
+
|
|
17
|
+
## Edit page content
|
|
18
|
+
|
|
19
|
+
The Page editor has two tabs. The **Properties** tab holds the content of the page.
|
|
20
|
+
The **Settings** tab holds its name, its condition, and its layout. Fill in the
|
|
21
|
+
fields on the **Properties** tab. The inspector on the right edits the field that you
|
|
22
|
+
choose, and the preview panel shows the page while it fills in.
|
|
23
|
+
|
|
24
|
+
## Change or remove the layout
|
|
25
|
+
|
|
26
|
+
Use the change-layout control on the **Settings** tab to move the page to another
|
|
27
|
+
Page Layout. When you unlink a layout, Picked separates the Content Entry from the
|
|
28
|
+
page. It deletes no entry, but the page then has no content to render until you
|
|
29
|
+
attach a layout again.
|
|
30
|
+
|
|
31
|
+
## Related
|
|
32
|
+
|
|
33
|
+
- [About pages and flows](/explanation/pages-and-flows) — when to choose a Page.
|
|
34
|
+
- [How to fill and publish a page](/how-to/fill-and-publish-a-page)
|
|
35
|
+
- [How to server-render a page](/how-to/server-render-a-page)
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: reference
|
|
3
|
+
layout: docs
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
import { Screenshot } from '../../../../../components/Screenshot'
|
|
7
|
+
|
|
8
|
+
# Sections
|
|
9
|
+
|
|
10
|
+
Sections are reusable schema fragments you embed inside layouts, so common structures such as a hero or a feature list are defined once.
|
|
11
|
+
|
|
12
|
+
<Screenshot
|
|
13
|
+
route="/{orgSlug}/{projectId}/workspaces/{workspaceId}/blocks"
|
|
14
|
+
alt="The sections list in the schema builder on the Picked dashboard"
|
|
15
|
+
/>
|
|
16
|
+
|
|
17
|
+
## What a section is
|
|
18
|
+
|
|
19
|
+
A Section is a reusable schema fragment with its own **Key**. A
|
|
20
|
+
[layout](/reference/dashboard/content/layouts) gives its shape to a whole Page or Step. A Section is a
|
|
21
|
+
part that you put into one or more layouts. Define the shape one time, then reuse it
|
|
22
|
+
everywhere.
|
|
23
|
+
|
|
24
|
+
## Related
|
|
25
|
+
|
|
26
|
+
- [About the content model](/explanation/the-content-model) — why sections exist.
|
|
27
|
+
- [How to reuse a section](/how-to/reuse-a-section)
|
|
28
|
+
- [Page and step layouts](/reference/dashboard/content/layouts)
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
---
|
|
2
|
+
type: reference
|
|
2
3
|
layout: docs
|
|
3
4
|
---
|
|
4
5
|
|
|
5
|
-
import { Screenshot } from '
|
|
6
|
+
import { Screenshot } from '../../../../components/Screenshot'
|
|
6
7
|
|
|
7
8
|
# Experiences
|
|
8
9
|
|
|
@@ -12,7 +13,7 @@ site. Each experience points at a component that you register in your applicatio
|
|
|
12
13
|
An experience is either a **Flow** or a **Page**. A **Flow** is an interactive
|
|
13
14
|
experience of more than one step, and the browser renders it. This page covers the
|
|
14
15
|
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
|
+
for a landing page where the search rank matters. See [Pages](/reference/dashboard/content/pages) for
|
|
16
17
|
that kind.
|
|
17
18
|
|
|
18
19
|
<Screenshot
|
|
@@ -20,19 +21,6 @@ that kind.
|
|
|
20
21
|
alt="The experiences list for a workspace on the Picked dashboard"
|
|
21
22
|
/>
|
|
22
23
|
|
|
23
|
-
## Create an experience
|
|
24
|
-
|
|
25
|
-
1. Open your project.
|
|
26
|
-
2. Click **Experiences** in the sidebar.
|
|
27
|
-
3. Click **New Experience**.
|
|
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.
|
|
31
|
-
5. Click **Create**.
|
|
32
|
-
|
|
33
|
-
The flow editor opens with an empty canvas. See
|
|
34
|
-
[Build Flows](/flow-builder/building-flows) to add your first node.
|
|
35
|
-
|
|
36
24
|
## Experience settings
|
|
37
25
|
|
|
38
26
|
Choose no node on the canvas, or click the canvas background, to open the experience
|
|
@@ -45,7 +33,7 @@ application.
|
|
|
45
33
|
|
|
46
34
|
**Condition**: An optional condition. When you set it, the experience starts only for
|
|
47
35
|
a visitor who matches the condition. See
|
|
48
|
-
[Condition Builder](/flow-builder/condition-builder) for how to write one. Keep it
|
|
36
|
+
[Condition Builder](/reference/dashboard/flow-builder/condition-builder) for how to write one. Keep it
|
|
49
37
|
blank to start the experience for every visitor.
|
|
50
38
|
|
|
51
39
|
**Initialize Open**: An optional condition that controls whether the experience opens
|
|
@@ -56,3 +44,8 @@ closed until something opens it.
|
|
|
56
44
|
|
|
57
45
|
The experiences list shows every experience in the current project. Click an
|
|
58
46
|
experience to open it in the flow builder.
|
|
47
|
+
|
|
48
|
+
## Related
|
|
49
|
+
|
|
50
|
+
- [About pages and flows](/explanation/pages-and-flows) — Page or Flow.
|
|
51
|
+
- [How to create an experience](/how-to/create-an-experience)
|