Picked SDK
The Picked SDK lets you add a dynamic, personalized experience to your web application with very little code.
Precondition and condition
| Category | Question | Description |
|---|---|---|
| Precondition | Must Picked start? | Use it to check the environment, to filter by page, or for a feature flag that turns the SDK off completely. |
| Condition | Is this visitor eligible? | Use it to divide your visitors into two groups for an A/B test, or to reach one group of visitors. The SDK starts an experience only for a visitor who passes it. The SDK records the last result as is_user in the session context of each event that it sends. The SDK keeps that result in browser storage. Until the condition runs on a page, the session context holds the result from an earlier page, or it has no is_user. |
const picked = createClient({
precondition: {
and: [
{
or: [
{
invoke: {
var: 'features.aa-test',
},
},
true,
],
},
{ invoke: { var: 'predicates.shopify-is-product-page' } },
],
},
condition: {
invoke: {
var: 'features.convincely-enabled',
},
},
// The rest of the Picked options go here.
})See conditions for more detail.
Related
- How to install the SDK
- How to register a component
- About conditions and the logic engine — what the difference is between a precondition and a condition.
