@picked/client 0.0.1-dev.1789541668638 → 0.0.1-next.2

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 (443) hide show
  1. package/README.md +8 -0
  2. package/dist/cjs/index.js +1 -4
  3. package/dist/cjs/plugins/create-experience/index.js +1 -1
  4. package/dist/cjs/plugins/experience-browserstorage-plugin/index.js +1 -0
  5. package/dist/cjs/plugins/history-browserstorage-plugin/index.js +1 -0
  6. package/dist/cjs/plugins/responses-browserstorage-plugin/index.js +1 -0
  7. package/dist/cjs/plugins/responses-indexeddb-plugin/index.js +1 -0
  8. package/dist/cjs/plugins/shopify/index.js +1 -0
  9. package/dist/cjs/plugins/single-page-app/index.js +1 -1
  10. package/dist/cjs/plugins/window-object/index.js +1 -1
  11. package/dist/cjs/server/index.js +1 -1
  12. package/dist/esm/index.js +739 -1814
  13. package/dist/esm/plugins/create-experience/index.js +398 -490
  14. package/dist/esm/plugins/experience-browserstorage-plugin/index.js +38 -0
  15. package/dist/esm/plugins/history-browserstorage-plugin/index.js +26 -0
  16. package/dist/esm/plugins/responses-browserstorage-plugin/index.js +36 -0
  17. package/dist/esm/plugins/responses-indexeddb-plugin/index.js +101 -0
  18. package/dist/esm/plugins/shopify/index.js +59 -0
  19. package/dist/esm/plugins/single-page-app/index.js +35 -31
  20. package/dist/esm/plugins/window-object/index.js +9 -9
  21. package/dist/esm/server/index.js +89 -141
  22. package/dist/experience-instance-6ZKZS7dF.cjs +1 -0
  23. package/dist/experience-instance-BA0EXYg5.js +712 -0
  24. package/dist/id-BKIWbSTy.cjs +1 -0
  25. package/dist/id-BW-g3y32.js +6 -0
  26. package/dist/logger-BsmHUUw1.cjs +1 -0
  27. package/dist/logger-C9a75KZn.js +5 -0
  28. package/dist/object-BbFTsGh3.cjs +1 -0
  29. package/dist/object-JwZ58NOH.js +28 -0
  30. package/dist/storage-BPJwmlva.cjs +1 -0
  31. package/dist/storage-D87xFySf.js +85 -0
  32. package/dist/supports-BvrzQAVk.js +79 -0
  33. package/dist/supports-C0y3-V5V.cjs +1 -0
  34. package/dist/types/client.d.ts +23 -119
  35. package/dist/types/client.d.ts.map +1 -1
  36. package/dist/types/entities/component/component.d.ts +6 -45
  37. package/dist/types/entities/component/component.d.ts.map +1 -1
  38. package/dist/types/entities/experience/experience.d.ts +99 -160
  39. package/dist/types/entities/experience/experience.d.ts.map +1 -1
  40. package/dist/types/entities/experience-instance/experience-instance.d.ts +113 -83
  41. package/dist/types/entities/experience-instance/experience-instance.d.ts.map +1 -1
  42. package/dist/types/entities/feature/feature.d.ts +8 -118
  43. package/dist/types/entities/feature/feature.d.ts.map +1 -1
  44. package/dist/types/entities/field/field.d.ts +64 -96
  45. package/dist/types/entities/field/field.d.ts.map +1 -1
  46. package/dist/types/entities/framework/framework.d.ts +7 -32
  47. package/dist/types/entities/framework/framework.d.ts.map +1 -1
  48. package/dist/types/entities/history/history.d.ts +6 -6
  49. package/dist/types/entities/history/history.d.ts.map +1 -1
  50. package/dist/types/entities/plugin/plugin.d.ts +2 -41
  51. package/dist/types/entities/plugin/plugin.d.ts.map +1 -1
  52. package/dist/types/entities/predicate/predicate.d.ts +7 -30
  53. package/dist/types/entities/predicate/predicate.d.ts.map +1 -1
  54. package/dist/types/entities/project/project.d.ts +9 -0
  55. package/dist/types/entities/project/project.d.ts.map +1 -0
  56. package/dist/types/entities/response/response.d.ts +21 -57
  57. package/dist/types/entities/response/response.d.ts.map +1 -1
  58. package/dist/types/exports.d.ts +4 -22
  59. package/dist/types/exports.d.ts.map +1 -1
  60. package/dist/types/index.d.ts +3 -12
  61. package/dist/types/index.d.ts.map +1 -1
  62. package/dist/types/logic-engine.d.ts +11 -13
  63. package/dist/types/logic-engine.d.ts.map +1 -1
  64. package/dist/types/picked.d.ts +184 -381
  65. package/dist/types/picked.d.ts.map +1 -1
  66. package/dist/types/ping.d.ts +10 -0
  67. package/dist/types/ping.d.ts.map +1 -0
  68. package/dist/types/plugins/create-experience/create-experience.d.ts +44 -119
  69. package/dist/types/plugins/create-experience/create-experience.d.ts.map +1 -1
  70. package/dist/types/plugins/create-experience/index.d.ts +2 -2
  71. package/dist/types/plugins/create-experience/index.d.ts.map +1 -1
  72. package/dist/types/plugins/create-experience/plugin.d.ts +2 -3
  73. package/dist/types/plugins/create-experience/plugin.d.ts.map +1 -1
  74. package/dist/types/plugins/create-experience/serialization.d.ts.map +1 -1
  75. package/dist/types/plugins/experience-browserstorage-plugin/index.d.ts.map +1 -0
  76. package/dist/types/plugins/experience-browserstorage-plugin/plugin.d.ts +6 -0
  77. package/dist/types/plugins/experience-browserstorage-plugin/plugin.d.ts.map +1 -0
  78. package/dist/types/plugins/history-browserstorage-plugin/index.d.ts.map +1 -0
  79. package/dist/types/plugins/{history-browser-storage → history-browserstorage-plugin}/plugin.d.ts +1 -2
  80. package/dist/types/plugins/history-browserstorage-plugin/plugin.d.ts.map +1 -0
  81. package/dist/types/plugins/responses-browserstorage-plugin/index.d.ts.map +1 -0
  82. package/dist/types/plugins/responses-browserstorage-plugin/plugin.d.ts +6 -0
  83. package/dist/types/plugins/responses-browserstorage-plugin/plugin.d.ts.map +1 -0
  84. package/dist/types/plugins/responses-indexeddb-plugin/index.d.ts.map +1 -0
  85. package/dist/types/plugins/responses-indexeddb-plugin/plugin.d.ts +3 -0
  86. package/dist/types/plugins/responses-indexeddb-plugin/plugin.d.ts.map +1 -0
  87. package/dist/types/plugins/shopify/index.d.ts +2 -0
  88. package/dist/types/plugins/shopify/index.d.ts.map +1 -0
  89. package/dist/types/plugins/shopify/plugin.d.ts +3 -0
  90. package/dist/types/plugins/shopify/plugin.d.ts.map +1 -0
  91. package/dist/types/plugins/shopify/shopify.d.ts +28 -0
  92. package/dist/types/plugins/shopify/shopify.d.ts.map +1 -0
  93. package/dist/types/plugins/single-page-app/plugin.d.ts +2 -2
  94. package/dist/types/plugins/single-page-app/plugin.d.ts.map +1 -1
  95. package/dist/types/plugins/window-object/plugin.d.ts +2 -2
  96. package/dist/types/server/index.d.ts +3 -18
  97. package/dist/types/server/index.d.ts.map +1 -1
  98. package/dist/types/utils/dom.d.ts +6 -4
  99. package/dist/types/utils/dom.d.ts.map +1 -1
  100. package/dist/types/utils/events.d.ts +38 -83
  101. package/dist/types/utils/events.d.ts.map +1 -1
  102. package/dist/types/utils/global-obj.d.ts +2 -1
  103. package/dist/types/utils/global-obj.d.ts.map +1 -1
  104. package/dist/types/utils/id.d.ts.map +1 -1
  105. package/dist/types/utils/indexed-db.d.ts +1 -2
  106. package/dist/types/utils/indexed-db.d.ts.map +1 -1
  107. package/dist/types/utils/logger.d.ts +1 -2
  108. package/dist/types/utils/logger.d.ts.map +1 -1
  109. package/dist/types/utils/node-tree/get-next-node-from-conditional.d.ts +3 -0
  110. package/dist/types/utils/node-tree/get-next-node-from-conditional.d.ts.map +1 -0
  111. package/dist/types/utils/node-tree/get-next-node.d.ts +1 -1
  112. package/dist/types/utils/node-tree/get-next-node.d.ts.map +1 -1
  113. package/dist/types/utils/node-tree/get-origin-node.d.ts +1 -1
  114. package/dist/types/utils/node-tree/get-origin-node.d.ts.map +1 -1
  115. package/dist/types/utils/node-tree/min-max-steps-to-leaf.d.ts +7 -17
  116. package/dist/types/utils/node-tree/min-max-steps-to-leaf.d.ts.map +1 -1
  117. package/dist/types/utils/node-tree/min-max-steps-to-origin.d.ts +8 -19
  118. package/dist/types/utils/node-tree/min-max-steps-to-origin.d.ts.map +1 -1
  119. package/dist/types/utils/node-tree/next-reachable-step-nodes.d.ts +7 -31
  120. package/dist/types/utils/node-tree/next-reachable-step-nodes.d.ts.map +1 -1
  121. package/dist/types/utils/nodes.d.ts +2 -3
  122. package/dist/types/utils/nodes.d.ts.map +1 -1
  123. package/dist/types/utils/object.d.ts +8 -0
  124. package/dist/types/utils/object.d.ts.map +1 -1
  125. package/dist/types/utils/rules-logic.d.ts +3 -33
  126. package/dist/types/utils/rules-logic.d.ts.map +1 -1
  127. package/dist/types/utils/search-params.d.ts.map +1 -1
  128. package/dist/types/utils/state-snaphot.d.ts +16 -0
  129. package/dist/types/utils/state-snaphot.d.ts.map +1 -0
  130. package/dist/types/utils/storage.d.ts +11 -374
  131. package/dist/types/utils/storage.d.ts.map +1 -1
  132. package/dist/types/utils/supports.d.ts +0 -87
  133. package/dist/types/utils/supports.d.ts.map +1 -1
  134. package/package.json +49 -182
  135. package/dist/.tsbuildinfo +0 -1
  136. package/dist/api-C7q_7vxn.js +0 -22
  137. package/dist/api-Ctvh1qkk.cjs +0 -1
  138. package/dist/cjs/form/index.js +0 -1
  139. package/dist/cjs/plugins/dom-observer/index.js +0 -1
  140. package/dist/cjs/plugins/dynamic-experiences/index.js +0 -1
  141. package/dist/cjs/plugins/experience-browser-storage/index.js +0 -1
  142. package/dist/cjs/plugins/history-browser-storage/index.js +0 -1
  143. package/dist/cjs/plugins/responses-browser-storage/index.js +0 -1
  144. package/dist/cjs/plugins/responses-indexeddb/index.js +0 -1
  145. package/dist/cjs/plugins/telemetry/index.js +0 -1
  146. package/dist/cjs/plugins/web-components/index.js +0 -1
  147. package/dist/cjs/preview/index.js +0 -1
  148. package/dist/docs/_root.css +0 -101
  149. package/dist/docs/explanation/conditions-and-the-logic-engine.md +0 -94
  150. package/dist/docs/explanation/content-references.md +0 -99
  151. package/dist/docs/explanation/feature-flag-allocation.md +0 -218
  152. package/dist/docs/explanation/how-picked-works.md +0 -124
  153. package/dist/docs/explanation/how-pickedql-works.md +0 -76
  154. package/dist/docs/explanation/pages-and-flows.md +0 -64
  155. package/dist/docs/explanation/the-content-model.md +0 -87
  156. package/dist/docs/explanation/the-two-apis.md +0 -68
  157. package/dist/docs/explanation/why-server-side-rendering.md +0 -76
  158. package/dist/docs/explanation/workspaces-and-versions.md +0 -71
  159. package/dist/docs/how-to/add-a-step-field-or-action.md +0 -43
  160. package/dist/docs/how-to/analytics/index.md +0 -316
  161. package/dist/docs/how-to/archive-or-delete-a-workspace.md +0 -46
  162. package/dist/docs/how-to/authenticate-the-cli.md +0 -97
  163. package/dist/docs/how-to/authenticate-with-a-magic-link.md +0 -40
  164. package/dist/docs/how-to/authenticate-with-a-password.md +0 -51
  165. package/dist/docs/how-to/authenticate-with-an-api-key.md +0 -51
  166. package/dist/docs/how-to/authenticate-with-oauth.md +0 -40
  167. package/dist/docs/how-to/build-a-flow.md +0 -83
  168. package/dist/docs/how-to/connect-the-mcp-server.md +0 -38
  169. package/dist/docs/how-to/create-a-content-entry.md +0 -48
  170. package/dist/docs/how-to/create-a-project.md +0 -29
  171. package/dist/docs/how-to/create-an-experience.md +0 -42
  172. package/dist/docs/how-to/create-and-revoke-an-api-key.md +0 -42
  173. package/dist/docs/how-to/debug-with-the-chrome-extension.md +0 -57
  174. package/dist/docs/how-to/define-a-page-layout.md +0 -46
  175. package/dist/docs/how-to/fill-and-publish-a-page.md +0 -66
  176. package/dist/docs/how-to/install-the-gtm-template.md +0 -84
  177. package/dist/docs/how-to/install-the-sdk.md +0 -93
  178. package/dist/docs/how-to/install-the-vite-plugin.md +0 -69
  179. package/dist/docs/how-to/invite-and-remove-members.md +0 -35
  180. package/dist/docs/how-to/point-one-entry-at-another.md +0 -61
  181. package/dist/docs/how-to/preview-a-workspace.md +0 -28
  182. package/dist/docs/how-to/publish-a-workspace.md +0 -30
  183. package/dist/docs/how-to/read-a-feature-flag.md +0 -113
  184. package/dist/docs/how-to/read-a-referenced-entry.md +0 -109
  185. package/dist/docs/how-to/register-a-component.md +0 -55
  186. package/dist/docs/how-to/register-an-action-handler.md +0 -67
  187. package/dist/docs/how-to/render-a-step-form.md +0 -131
  188. package/dist/docs/how-to/render-an-unpublished-preview.md +0 -41
  189. package/dist/docs/how-to/reuse-a-section.md +0 -53
  190. package/dist/docs/how-to/reuse-a-step-field-or-action.md +0 -28
  191. package/dist/docs/how-to/roll-back-a-published-version.md +0 -26
  192. package/dist/docs/how-to/run-an-ab-test.md +0 -49
  193. package/dist/docs/how-to/run-code-on-a-form-submission.md +0 -125
  194. package/dist/docs/how-to/server-render-a-page.md +0 -81
  195. package/dist/docs/how-to/set-a-content-security-policy.md +0 -32
  196. package/dist/docs/how-to/set-up-mfa.md +0 -69
  197. package/dist/docs/how-to/switch-workspaces.md +0 -122
  198. package/dist/docs/how-to/upload-and-use-an-asset.mdx +0 -73
  199. package/dist/docs/how-to/validate-a-field.md +0 -52
  200. package/dist/docs/how-to/write-a-condition.md +0 -45
  201. package/dist/docs/how-to/write-a-predicate.md +0 -60
  202. package/dist/docs/index.md +0 -59
  203. package/dist/docs/reference/dashboard/actions.mdx +0 -53
  204. package/dist/docs/reference/dashboard/api-keys.mdx +0 -38
  205. package/dist/docs/reference/dashboard/conditions.mdx +0 -42
  206. package/dist/docs/reference/dashboard/content/asset-library.mdx +0 -63
  207. package/dist/docs/reference/dashboard/content/blocks.mdx +0 -57
  208. package/dist/docs/reference/dashboard/content/content-entries.mdx +0 -95
  209. package/dist/docs/reference/dashboard/content/models.mdx +0 -108
  210. package/dist/docs/reference/dashboard/content/pages.mdx +0 -61
  211. package/dist/docs/reference/dashboard/experiences.mdx +0 -51
  212. package/dist/docs/reference/dashboard/features.mdx +0 -154
  213. package/dist/docs/reference/dashboard/fields.mdx +0 -106
  214. package/dist/docs/reference/dashboard/flow-builder/canvas.mdx +0 -58
  215. package/dist/docs/reference/dashboard/flow-builder/condition-builder.md +0 -57
  216. package/dist/docs/reference/dashboard/flow-builder/keyboard-shortcuts.md +0 -72
  217. package/dist/docs/reference/dashboard/flow-builder/nodes.md +0 -63
  218. package/dist/docs/reference/dashboard/projects.mdx +0 -44
  219. package/dist/docs/reference/dashboard/reports.mdx +0 -43
  220. package/dist/docs/reference/dashboard/steps.mdx +0 -37
  221. package/dist/docs/reference/dashboard/team-management.md +0 -29
  222. package/dist/docs/reference/dashboard/workspace-versioning.mdx +0 -30
  223. package/dist/docs/reference/dashboard/workspaces.mdx +0 -76
  224. package/dist/docs/reference/delivery-api/experience-content.md +0 -152
  225. package/dist/docs/reference/delivery-api/index.md +0 -45
  226. package/dist/docs/reference/delivery-api/preview-caching-crawling.md +0 -79
  227. package/dist/docs/reference/delivery-api/project-config.md +0 -65
  228. package/dist/docs/reference/delivery-api/workspace-schema.md +0 -85
  229. package/dist/docs/reference/glossary.md +0 -181
  230. package/dist/docs/reference/management-api/authentication.md +0 -74
  231. package/dist/docs/reference/management-api/authorization-and-scopes.md +0 -285
  232. package/dist/docs/reference/management-api/error-handling.md +0 -233
  233. package/dist/docs/reference/management-api/pagination.md +0 -192
  234. package/dist/docs/reference/pickedql/data-sources.md +0 -174
  235. package/dist/docs/reference/pickedql/dimensions.md +0 -103
  236. package/dist/docs/reference/pickedql/filtering.md +0 -64
  237. package/dist/docs/reference/pickedql/index.md +0 -18
  238. package/dist/docs/reference/pickedql/schema.md +0 -172
  239. package/dist/docs/reference/pickedql/virtual-functions.md +0 -248
  240. package/dist/docs/reference/sdk/actions.md +0 -30
  241. package/dist/docs/reference/sdk/analytics-events.md +0 -445
  242. package/dist/docs/reference/sdk/conditions.md +0 -147
  243. package/dist/docs/reference/sdk/content-security-policy.md +0 -21
  244. package/dist/docs/reference/sdk/content.md +0 -213
  245. package/dist/docs/reference/sdk/experiences.md +0 -51
  246. package/dist/docs/reference/sdk/features.md +0 -256
  247. package/dist/docs/reference/sdk/fields.md +0 -255
  248. package/dist/docs/reference/sdk/index.md +0 -68
  249. package/dist/docs/reference/sdk/plugins/create-experience.md +0 -123
  250. package/dist/docs/reference/sdk/plugins/dynamic-experiences.md +0 -74
  251. package/dist/docs/reference/sdk/plugins/index.md +0 -29
  252. package/dist/docs/reference/sdk/plugins/window-object.md +0 -25
  253. package/dist/docs/reference/sdk/predicates.md +0 -43
  254. package/dist/docs/reference/sdk/ssr/index.md +0 -33
  255. package/dist/docs/reference/sdk/ssr/rendering-and-hydration.md +0 -103
  256. package/dist/docs/reference/sdk/ssr/serialize.md +0 -80
  257. package/dist/docs/reference/sdk/ssr/slots-and-placements.md +0 -59
  258. package/dist/docs/reference/sdk/steps.md +0 -86
  259. package/dist/docs/reference/sdk/type-generation.md +0 -196
  260. package/dist/docs/reference/tools/chrome-extension.md +0 -16
  261. package/dist/docs/reference/tools/cli.md +0 -146
  262. package/dist/docs/reference/tools/image-optimisation-service.md +0 -104
  263. package/dist/docs/reference/tools/mcp.md +0 -90
  264. package/dist/docs/reference/tools/vite-plugin.md +0 -163
  265. package/dist/docs/tutorials/first-api-call.md +0 -228
  266. package/dist/docs/tutorials/first-experience-in-the-dashboard.mdx +0 -143
  267. package/dist/docs/tutorials/first-experience.mdx +0 -254
  268. package/dist/docs/tutorials/first-server-rendered-page.mdx +0 -186
  269. package/dist/dom-BqcToNL0.js +0 -82
  270. package/dist/dom-DlLH3FxV.cjs +0 -1
  271. package/dist/emit-D-tLiWL1.cjs +0 -1
  272. package/dist/emit-Ds2EG7CB.js +0 -14
  273. package/dist/esm/form/index.js +0 -565
  274. package/dist/esm/plugins/dom-observer/index.js +0 -87
  275. package/dist/esm/plugins/dynamic-experiences/index.js +0 -5
  276. package/dist/esm/plugins/experience-browser-storage/index.js +0 -38
  277. package/dist/esm/plugins/history-browser-storage/index.js +0 -26
  278. package/dist/esm/plugins/responses-browser-storage/index.js +0 -71
  279. package/dist/esm/plugins/responses-indexeddb/index.js +0 -89
  280. package/dist/esm/plugins/telemetry/index.js +0 -100
  281. package/dist/esm/plugins/web-components/index.js +0 -19
  282. package/dist/esm/preview/index.js +0 -2
  283. package/dist/experience-instance-B9S6Yf0N.js +0 -711
  284. package/dist/experience-instance-D8rOg6We.cjs +0 -1
  285. package/dist/id-Bo4RBeOs.js +0 -4
  286. package/dist/id-Js-62re-.cjs +0 -1
  287. package/dist/inert-script-report-B_bMPRzp.js +0 -18
  288. package/dist/inert-script-report-ijRHPtcY.cjs +0 -1
  289. package/dist/logger-CSTvAyyB.cjs +0 -1
  290. package/dist/logger-DMN6TxJJ.js +0 -4
  291. package/dist/object-BUDGxEqy.js +0 -25
  292. package/dist/object-CIkt7Fkr.cjs +0 -1
  293. package/dist/plugin-ChafFq6S.js +0 -194
  294. package/dist/plugin-Dn25Gffy.cjs +0 -1
  295. package/dist/preview-channel-CSr96XAo.js +0 -98
  296. package/dist/preview-channel-Cx0e6fye.cjs +0 -1
  297. package/dist/protocol-Bb_vpLKE.cjs +0 -1
  298. package/dist/protocol-C5KkkiZc.js +0 -84
  299. package/dist/provider-B8wvmeC8.js +0 -98
  300. package/dist/provider-BBLlQOjV.cjs +0 -1
  301. package/dist/registry-C1t8l3t9.cjs +0 -1
  302. package/dist/registry-CXZv0uLg.js +0 -18
  303. package/dist/rules-logic-CGZIYgAI.cjs +0 -1
  304. package/dist/rules-logic-HesIUCu6.js +0 -13
  305. package/dist/storage-1MW3-_As.js +0 -103
  306. package/dist/storage-DUw9UJ2h.cjs +0 -1
  307. package/dist/supports-CO9bJGNl.js +0 -92
  308. package/dist/supports-DBzjGaWD.cjs +0 -1
  309. package/dist/types/data-source/api.d.ts +0 -60
  310. package/dist/types/data-source/api.d.ts.map +0 -1
  311. package/dist/types/data-source/provider.d.ts +0 -103
  312. package/dist/types/data-source/provider.d.ts.map +0 -1
  313. package/dist/types/data-source/registry.d.ts +0 -26
  314. package/dist/types/data-source/registry.d.ts.map +0 -1
  315. package/dist/types/data-source/request-observer.d.ts +0 -62
  316. package/dist/types/data-source/request-observer.d.ts.map +0 -1
  317. package/dist/types/data-source/virtual-data.d.ts +0 -19
  318. package/dist/types/data-source/virtual-data.d.ts.map +0 -1
  319. package/dist/types/entities/action/action.d.ts +0 -85
  320. package/dist/types/entities/action/action.d.ts.map +0 -1
  321. package/dist/types/entities/component/lazyComponent.d.ts +0 -11
  322. package/dist/types/entities/component/lazyComponent.d.ts.map +0 -1
  323. package/dist/types/entities/condition/condition.d.ts +0 -29
  324. package/dist/types/entities/condition/condition.d.ts.map +0 -1
  325. package/dist/types/entities/content/content.d.ts +0 -53
  326. package/dist/types/entities/content/content.d.ts.map +0 -1
  327. package/dist/types/entities/content/reference.d.ts +0 -101
  328. package/dist/types/entities/content/reference.d.ts.map +0 -1
  329. package/dist/types/entities/field/policies.d.ts +0 -35
  330. package/dist/types/entities/field/policies.d.ts.map +0 -1
  331. package/dist/types/entities/response/response-validation.d.ts +0 -75
  332. package/dist/types/entities/response/response-validation.d.ts.map +0 -1
  333. package/dist/types/entities/session/session.d.ts +0 -46
  334. package/dist/types/entities/session/session.d.ts.map +0 -1
  335. package/dist/types/entities/step/step.d.ts +0 -56
  336. package/dist/types/entities/step/step.d.ts.map +0 -1
  337. package/dist/types/form/build-responses.d.ts +0 -18
  338. package/dist/types/form/build-responses.d.ts.map +0 -1
  339. package/dist/types/form/create-field-evaluator.d.ts +0 -28
  340. package/dist/types/form/create-field-evaluator.d.ts.map +0 -1
  341. package/dist/types/form/create-field-validation.d.ts +0 -60
  342. package/dist/types/form/create-field-validation.d.ts.map +0 -1
  343. package/dist/types/form/create-form.d.ts +0 -153
  344. package/dist/types/form/create-form.d.ts.map +0 -1
  345. package/dist/types/form/create-submit-pipeline.d.ts +0 -116
  346. package/dist/types/form/create-submit-pipeline.d.ts.map +0 -1
  347. package/dist/types/form/get-step-fields.d.ts +0 -19
  348. package/dist/types/form/get-step-fields.d.ts.map +0 -1
  349. package/dist/types/form/index.d.ts +0 -11
  350. package/dist/types/form/index.d.ts.map +0 -1
  351. package/dist/types/lifecycle/condition-selection.d.ts +0 -146
  352. package/dist/types/lifecycle/condition-selection.d.ts.map +0 -1
  353. package/dist/types/lifecycle/lifecycle.d.ts +0 -48
  354. package/dist/types/lifecycle/lifecycle.d.ts.map +0 -1
  355. package/dist/types/lifecycle/rules-logic.d.ts +0 -25
  356. package/dist/types/lifecycle/rules-logic.d.ts.map +0 -1
  357. package/dist/types/lifecycle/state-snapshot.d.ts +0 -38
  358. package/dist/types/lifecycle/state-snapshot.d.ts.map +0 -1
  359. package/dist/types/plugins/dom-observer/index.d.ts +0 -3
  360. package/dist/types/plugins/dom-observer/index.d.ts.map +0 -1
  361. package/dist/types/plugins/dom-observer/plugin.d.ts +0 -50
  362. package/dist/types/plugins/dom-observer/plugin.d.ts.map +0 -1
  363. package/dist/types/plugins/dynamic-experiences/hash.d.ts +0 -105
  364. package/dist/types/plugins/dynamic-experiences/hash.d.ts.map +0 -1
  365. package/dist/types/plugins/dynamic-experiences/index.d.ts +0 -7
  366. package/dist/types/plugins/dynamic-experiences/index.d.ts.map +0 -1
  367. package/dist/types/plugins/dynamic-experiences/plugin.d.ts +0 -49
  368. package/dist/types/plugins/dynamic-experiences/plugin.d.ts.map +0 -1
  369. package/dist/types/plugins/dynamic-experiences/types.d.ts +0 -45
  370. package/dist/types/plugins/dynamic-experiences/types.d.ts.map +0 -1
  371. package/dist/types/plugins/experience-browser-storage/index.d.ts.map +0 -1
  372. package/dist/types/plugins/experience-browser-storage/plugin.d.ts +0 -7
  373. package/dist/types/plugins/experience-browser-storage/plugin.d.ts.map +0 -1
  374. package/dist/types/plugins/history-browser-storage/index.d.ts.map +0 -1
  375. package/dist/types/plugins/history-browser-storage/plugin.d.ts.map +0 -1
  376. package/dist/types/plugins/responses-browser-storage/index.d.ts.map +0 -1
  377. package/dist/types/plugins/responses-browser-storage/plugin.d.ts +0 -18
  378. package/dist/types/plugins/responses-browser-storage/plugin.d.ts.map +0 -1
  379. package/dist/types/plugins/responses-indexeddb/index.d.ts.map +0 -1
  380. package/dist/types/plugins/responses-indexeddb/plugin.d.ts +0 -3
  381. package/dist/types/plugins/responses-indexeddb/plugin.d.ts.map +0 -1
  382. package/dist/types/plugins/telemetry/emit.d.ts +0 -18
  383. package/dist/types/plugins/telemetry/emit.d.ts.map +0 -1
  384. package/dist/types/plugins/telemetry/index.d.ts +0 -4
  385. package/dist/types/plugins/telemetry/index.d.ts.map +0 -1
  386. package/dist/types/plugins/telemetry/plugin-summary.d.ts +0 -10
  387. package/dist/types/plugins/telemetry/plugin-summary.d.ts.map +0 -1
  388. package/dist/types/plugins/telemetry/plugin.d.ts +0 -45
  389. package/dist/types/plugins/telemetry/plugin.d.ts.map +0 -1
  390. package/dist/types/plugins/web-components/index.d.ts +0 -2
  391. package/dist/types/plugins/web-components/index.d.ts.map +0 -1
  392. package/dist/types/plugins/web-components/plugin.d.ts +0 -4
  393. package/dist/types/plugins/web-components/plugin.d.ts.map +0 -1
  394. package/dist/types/preview/index.d.ts +0 -18
  395. package/dist/types/preview/index.d.ts.map +0 -1
  396. package/dist/types/preview-bridge/index.d.ts +0 -14
  397. package/dist/types/preview-bridge/index.d.ts.map +0 -1
  398. package/dist/types/preview-channel.d.ts +0 -16
  399. package/dist/types/preview-channel.d.ts.map +0 -1
  400. package/dist/types/preview-receiver/apply-ops.d.ts +0 -32
  401. package/dist/types/preview-receiver/apply-ops.d.ts.map +0 -1
  402. package/dist/types/preview-receiver/index.d.ts +0 -32
  403. package/dist/types/preview-receiver/index.d.ts.map +0 -1
  404. package/dist/types/preview-receiver/protocol.d.ts +0 -69
  405. package/dist/types/preview-receiver/protocol.d.ts.map +0 -1
  406. package/dist/types/schema-registry.d.ts +0 -206
  407. package/dist/types/schema-registry.d.ts.map +0 -1
  408. package/dist/types/server/serialize.d.ts +0 -87
  409. package/dist/types/server/serialize.d.ts.map +0 -1
  410. package/dist/types/typed-content.d.ts +0 -17
  411. package/dist/types/typed-content.d.ts.map +0 -1
  412. package/dist/types/utils/client-telemetry.d.ts +0 -25
  413. package/dist/types/utils/client-telemetry.d.ts.map +0 -1
  414. package/dist/types/utils/content-path.d.ts +0 -37
  415. package/dist/types/utils/content-path.d.ts.map +0 -1
  416. package/dist/types/utils/html-asset-value.d.ts +0 -20
  417. package/dist/types/utils/html-asset-value.d.ts.map +0 -1
  418. package/dist/types/utils/inert-script-report.d.ts +0 -40
  419. package/dist/types/utils/inert-script-report.d.ts.map +0 -1
  420. package/dist/types/utils/node-tree/get-next-node-from-action.d.ts +0 -25
  421. package/dist/types/utils/node-tree/get-next-node-from-action.d.ts.map +0 -1
  422. package/dist/types/utils/node-tree/get-next-node-from-condition.d.ts +0 -17
  423. package/dist/types/utils/node-tree/get-next-node-from-condition.d.ts.map +0 -1
  424. package/dist/types/utils/node-tree/node-adjacency.d.ts +0 -50
  425. package/dist/types/utils/node-tree/node-adjacency.d.ts.map +0 -1
  426. package/dist/types/utils/node-tree/node-tree-index.d.ts +0 -57
  427. package/dist/types/utils/node-tree/node-tree-index.d.ts.map +0 -1
  428. package/dist/types/utils/picked-config.d.ts +0 -39
  429. package/dist/types/utils/picked-config.d.ts.map +0 -1
  430. package/dist/types/utils/preview-session.d.ts +0 -12
  431. package/dist/types/utils/preview-session.d.ts.map +0 -1
  432. package/dist/types/utils/rehydrate-scripts.d.ts +0 -50
  433. package/dist/types/utils/rehydrate-scripts.d.ts.map +0 -1
  434. package/dist/types/utils/render-string.d.ts +0 -24
  435. package/dist/types/utils/render-string.d.ts.map +0 -1
  436. package/dist/types/utils/user-timing.d.ts +0 -21
  437. package/dist/types/utils/user-timing.d.ts.map +0 -1
  438. package/dist/version-CLjPfmxk.cjs +0 -1
  439. package/dist/version-CPKulHMH.js +0 -256
  440. /package/dist/types/plugins/{experience-browser-storage → experience-browserstorage-plugin}/index.d.ts +0 -0
  441. /package/dist/types/plugins/{history-browser-storage → history-browserstorage-plugin}/index.d.ts +0 -0
  442. /package/dist/types/plugins/{responses-browser-storage → responses-browserstorage-plugin}/index.d.ts +0 -0
  443. /package/dist/types/plugins/{responses-indexeddb → responses-indexeddb-plugin}/index.d.ts +0 -0
@@ -1,104 +0,0 @@
1
- ---
2
- type: reference
3
- layout: docs
4
- ---
5
-
6
- # Image optimisation service
7
-
8
- The Picked service for image optimisation is a hosted endpoint at
9
- `https://img.picked-content.com`. It reads an image from an allowed source domain and
10
- resizes it. It then encodes the image again to a modern format, WebP or AVIF, and
11
- caches the result.
12
-
13
- ## Endpoint
14
-
15
- ```
16
- GET https://img.picked-content.com/_next/image?url={source}&w={width}&q={quality}
17
- ```
18
-
19
- | Parameter | Description |
20
- |-----------|-------------|
21
- | `url` | The URL of the source image, URL-encoded. It must point at an allowed source domain. See below. |
22
- | `w` | The width in pixels. It must be one of the supported widths. |
23
- | `q` | The quality: `25`, `50`, `75`, or `100`. |
24
-
25
- The service chooses the response format. When the browser advertises `image/avif` or
26
- `image/webp` in its `Accept` header, the response uses that format. If it does not,
27
- the response uses the source format.
28
-
29
- ## Allowed source domains
30
-
31
- The service reads only from these hostnames:
32
-
33
- - `**.picked.app`
34
-
35
- A request with a `url` parameter for any other hostname returns `400 Bad Request`.
36
-
37
- ## Supported widths
38
-
39
- Device sizes, for a responsive image that spans the width of the viewport:
40
-
41
- ```
42
- 640, 750, 828, 1080, 1200, 1920, 2048, 3840
43
- ```
44
-
45
- Image sizes, for a UI element of fixed size such as an icon, an avatar, or a
46
- thumbnail:
47
-
48
- ```
49
- 16, 32, 48, 64, 96, 128, 256, 384
50
- ```
51
-
52
- A request with any other width returns `400 Bad Request`. Choose the smallest width
53
- that covers the size you render at the device pixel ratio of the visitor.
54
-
55
- ## Supported qualities
56
-
57
- ```
58
- 25, 50, 75, 100
59
- ```
60
-
61
- A lower value reduces the bandwidth by a large amount. `75` is a good default for
62
- most images. Use `25` or `50` for a thumbnail on a slow network.
63
-
64
- ## Responsive images
65
-
66
- Use the endpoint together with the standard `srcset` attribute. The browser then
67
- picks the correct width for each viewport:
68
-
69
- ```html
70
- <img
71
- src="https://img.picked-content.com/_next/image?url=https%3A%2F%2Fcdn.picked.app%2Fhero.png&w=1080&q=75"
72
- srcset="
73
- https://img.picked-content.com/_next/image?url=https%3A%2F%2Fcdn.picked.app%2Fhero.png&w=640&q=75 640w,
74
- https://img.picked-content.com/_next/image?url=https%3A%2F%2Fcdn.picked.app%2Fhero.png&w=1080&q=75 1080w,
75
- https://img.picked-content.com/_next/image?url=https%3A%2F%2Fcdn.picked.app%2Fhero.png&w=1920&q=75 1920w
76
- "
77
- sizes="(max-width: 768px) 100vw, 720px"
78
- alt="..."
79
- />
80
- ```
81
-
82
- ## Cache
83
-
84
- The upstream CDN caches each optimised response. The smallest cache TTL is 60
85
- seconds. The real lifetime depends on the eviction policy of the CDN. When you change
86
- the source image at the same URL, the optimised copy stays in the cache for at least
87
- that time.
88
-
89
- ## Security
90
-
91
- - The service does not optimise an SVG source. A request for an SVG returns the
92
- original bytes when the source is allowed. The service never runs an embedded
93
- script.
94
- - Each optimised response carries a strict `Content-Security-Policy`
95
- (`default-src *; script-src 'none'; sandbox;`). A compromised source therefore
96
- cannot run a script in the browser that shows the image.
97
- - The response uses `Content-Disposition: inline`, and never `attachment`.
98
-
99
- ## Related
100
-
101
- - [Asset library](/reference/dashboard/content/asset-library) — where the images come
102
- from.
103
- - [Content Security Policy](/reference/sdk/content-security-policy) — the `img-src`
104
- entry this service needs.
@@ -1,90 +0,0 @@
1
- ---
2
- type: reference
3
- layout: docs
4
- ---
5
-
6
- # MCP server
7
-
8
- Control your Picked workspace from an AI tool that writes code, with the Model
9
- Context Protocol (MCP).
10
-
11
- ## Tools
12
-
13
- ### Discovery
14
-
15
- | Tool | Description |
16
- | ------------------------ | ------------------------------------------------------------ |
17
- | `list_projects` | Lists your organizations and projects |
18
- | `list_workspaces` | Lists the workspaces in a project |
19
- | `get_workspace_overview` | Reads the full workspace state |
20
- | `get_schema_info` | Reads the documentation for Picked concepts and the data model |
21
- | `list_picked_docs` | Lists every Picked documentation page with its URL |
22
- | `read_picked_doc` | Reads one documentation page, or one section of it |
23
-
24
- ### Experiences
25
-
26
- | Tool | Description |
27
- | ------------------------ | ----------------------------------------------------------------------------------------- |
28
- | `create_experience` | Creates an experience |
29
- | `get_experience` | Reads an experience, with its flow graph |
30
- | `list_experiences` | Lists your experiences |
31
- | `update_experience_flow` | Creates, updates, or deletes steps, conditions, actions, fields, nodes, and edges as one operation |
32
-
33
- ### Steps, fields, conditions, and actions
34
-
35
- | Tool | Description |
36
- | ----------------------------------- | --------------- |
37
- | `get_step` / `list_steps` | Read steps |
38
- | `get_field` / `list_fields` | Read fields |
39
- | `get_condition` / `list_conditions` | Read conditions |
40
- | `get_action` / `list_actions` | Read actions |
41
-
42
- ### Feature flags
43
-
44
- | Tool | Description |
45
- | ---------------- | ---------------------------------------------------- |
46
- | `create_feature` | Creates a feature flag |
47
- | `get_feature` | Reads a feature flag |
48
- | `list_features` | Lists your feature flags |
49
- | `update_feature` | Updates the name, description, state, or weight |
50
-
51
- ### Analytics
52
-
53
- | Tool | Description |
54
- | ---------------- | ---------------------------------------------------------------- |
55
- | `query_pickedql` | Runs a PickedQL analytics query and returns the rows as a table |
56
-
57
- Call `get_schema_info` with the topic `pickedql` to see the tables, the virtual
58
- functions, and the dimension columns before you write a query.
59
-
60
- ### Publish
61
-
62
- | Tool | Description |
63
- | ------------------- | ---------------------------------------------- |
64
- | `get_preview_url` | Makes a preview URL for your unpublished work |
65
- | `publish_workspace` | Publishes the workspace |
66
-
67
- ## Example prompts
68
-
69
- - "List my Picked projects and show me the options on each one"
70
- - "Create a feature flag called 'new-checkout' at 50% traffic"
71
- - "Create an experience with a step that collects an email address"
72
- - "Show me control and variant users by the device type for the last 30 days"
73
- - "Make a preview URL for my workspace on `https://example.com`"
74
-
75
- ## Tips
76
-
77
- - Ask your agent for a list of your projects first. Then ask it to read your
78
- workspace and report the options on each record.
79
- - For a large experience, ask your agent about flow graphs and JSON Logic. The agent
80
- can read the documentation for you.
81
- - An update to an experience flow is atomic. Your agent can create steps, fields,
82
- nodes, and edges in one operation.
83
- - See a preview of your work on your site before you publish, to check that each page
84
- is correct.
85
- - Ask your agent to run a PickedQL query on your analytics data. The agent can read
86
- the schema, write the SQL, and explain the rows.
87
-
88
- ## Related
89
-
90
- - [How to connect the MCP server](/how-to/connect-the-mcp-server)
@@ -1,163 +0,0 @@
1
- ---
2
- type: reference
3
- layout: docs
4
- ---
5
-
6
- # Vite Plugin
7
-
8
- `@picked/vite-plugin-picked` adds Picked to your Vite project. It reads the options
9
- of your project at build time. It then puts them in a module that gives them to the
10
- SDK, so the SDK makes no API request at runtime. In development it also serves a
11
- launcher page. On that page you can see a preview of an experience with your own
12
- feature flag values.
13
-
14
- ## How it works
15
-
16
- ### Build-time config injection
17
-
18
- When Vite starts, in both `dev` and `build`, the plugin does this:
19
-
20
- 1. It reads the configuration of your project from the Picked API.
21
- 2. It embeds those options in your bundle.
22
- 3. The module gives the options to the SDK as the browser loads it.
23
- 4. The SDK reads the embedded configuration at runtime and makes no network request.
24
-
25
- Step 3 is a function call. The module gives the options to the SDK as it loads, and does
26
- not wait for the SDK to ask.
27
-
28
- When a preview token is there at runtime, the SDK ignores the embedded configuration and
29
- reads fresh data from the API.
30
-
31
- ### Preload of the data file
32
-
33
- Vite puts the options of your project in their own JavaScript file. For each HTML page
34
- in your build, the plugin adds a `<link rel="modulepreload">` for that file. The
35
- browser then gets it while it reads the page, and not later when the SDK starts.
36
-
37
- The CMS content of an experience stays in its own file and gets no preload. The
38
- browser gets it only when an experience needs it.
39
-
40
- Some applications make their HTML from the code, and not from an HTML file in your
41
- project. React Router in server mode is one of these. Such a build has no page for the
42
- plugin to add the link to. Add this line to the code that runs in the browser instead:
43
-
44
- :::code-group
45
-
46
- ```ts [entry.client.ts]
47
- import 'virtual:picked/data'
48
- ```
49
-
50
- :::
51
-
52
- Your framework then sees the file in its own list and adds the preload for you.
53
-
54
- The line reads no value from the module. It is there for the work the module does as it
55
- loads. A bundler removes a module that only declares values, and removes the line with
56
- it. This module gives your project options to the SDK, which is work, so the bundler
57
- keeps both.
58
-
59
- Your application is correct without this line. The SDK gets the same data later, as it
60
- starts. The line moves that work earlier.
61
-
62
- ### Types for the data file
63
-
64
- The plugin makes `virtual:picked/data` at build time. Because the module is not a file in
65
- your project, TypeScript cannot find its types. The plugin gives you a type file for the
66
- module. Point your project at that type file to import from the module:
67
-
68
- :::code-group
69
-
70
- ```json [tsconfig.json]
71
- {
72
- "compilerOptions": {
73
- "types": ["@picked/vite-plugin-picked/client"]
74
- }
75
- }
76
- ```
77
-
78
- ```ts [picked-data.ts]
79
- /// <reference types="@picked/vite-plugin-picked/client" />
80
- ```
81
-
82
- :::
83
-
84
- Use one of the two. The `types` option applies to all files in your project. The
85
- `reference` comment applies to one file.
86
-
87
- The module gives three values: `projectConfig`, `experienceContent` and
88
- `manifestMetadata`. You do not give these values to the SDK. The module gives them to
89
- the SDK itself as the browser loads it.
90
-
91
- ### Dev launcher
92
-
93
- In development, the plugin serves an HTML page at `/`. On that page you can:
94
-
95
- - see every feature flag in your project with its current state;
96
- - turn a feature flag on or off for a local test;
97
- - see a preview of an experience with your own feature flag values.
98
-
99
- After the dev server starts, the launcher URL appears next to the Vite output:
100
-
101
- ```
102
- ➜ Picked: http://localhost:5173/
103
- ➜ Local: http://localhost:5173/
104
- ➜ Network: use --host to expose
105
- ```
106
-
107
- ## Options
108
-
109
- Project identity belongs in [`picked.config.ts`](/reference/sdk/type-generation). The two
110
- options that carry it are deprecated, and the table marks them.
111
-
112
- | Option | Type | Default | Description |
113
- | ---------------- | --------------------- | ------------------------ | ---------------------------------------------------------- |
114
- | `disableLauncher`| `boolean` | `false` | Turns the launcher page off in both dev and build output. |
115
- | `generateTypes` | `boolean` | `true` | Whether the plugin writes types from the workspace schema. |
116
- | `mode` | `'bundle' \| 'api'` | `'bundle'` | Whether the build carries your project data. |
117
- | `projectId` | `string` | — | **Deprecated.** Use `picked.config.ts`. |
118
- | `apiUrl` | `string` | — | **Deprecated.** Use `picked.config.ts`. |
119
-
120
- ### projectId and apiUrl
121
-
122
- These two options moved to [`picked.config.ts`](/reference/sdk/type-generation), which the
123
- `picked` command and type generation also read. A later release removes them.
124
-
125
- The plugin still reads an option for a field that `picked.config.ts` leaves out, so a
126
- project that has yet to move needs no change. It stops when the two values are different,
127
- rather than choose one for you.
128
-
129
- ### generateTypes
130
-
131
- The plugin reads the workspace schema and writes `picked-env.d.ts`, on `vite dev` and on
132
- `vite build`. [Type generation](/reference/sdk/type-generation) describes the output and
133
- the `picked.config.ts` options that control it.
134
-
135
- A failure stops the run. Set `generateTypes: false` for a build that must not write types,
136
- such as a build for one more entry point.
137
-
138
- ### mode
139
-
140
- `'bundle'` reads your project options at build time and puts them in your bundle.
141
-
142
- `'api'` does not read them. Your build then makes no request to the Picked API, and
143
- writes no `.picked` directory. The SDK reads your project options from the API at
144
- runtime instead. Use this when your build must not depend on the Picked API.
145
-
146
- The SDK has no equivalent option. It uses the data your build gives it, and the API when
147
- your build gives none.
148
-
149
- ## Build output
150
-
151
- For a production build, `vite build`, the plugin writes an `index.html` file that
152
- holds the launcher page. Set `disableLauncher` to stop this. The file lets you deploy
153
- the launcher next to your application, so that a stakeholder can see a preview.
154
-
155
- The plugin writes that file only when your build made no `index.html` of its own. An
156
- application that has an HTML entry keeps its own page at the root of the output.
157
-
158
- The plugin also writes a `.picked` directory next to your Vite `root`. It holds the
159
- options of your project and the CMS content of each experience.
160
-
161
- ## Related
162
-
163
- - [How to install the Vite plugin](/how-to/install-the-vite-plugin)
@@ -1,228 +0,0 @@
1
- ---
2
- type: tutorial
3
- layout: docs
4
- ---
5
-
6
- # Your first API call
7
-
8
- In this tutorial we make your first calls to the Picked management API. We start with a
9
- ping, then authenticate, then read your user and make an organization.
10
-
11
- At the end you have an access token and two answers from the API.
12
-
13
- ## Before you start
14
-
15
- - A Picked account, with an email address and a password.
16
- - `curl`, or any HTTP client.
17
-
18
- :::note
19
- This tutorial covers the GraphQL management API, which needs authentication. To serve
20
- published configuration and page content to your application, use the read-only
21
- [Delivery API](/reference/delivery-api) instead.
22
- :::
23
-
24
- ## Playground
25
-
26
- Read the API and run a query in the
27
- [GraphQL Playground](https://api.picked.app/api/graphql).
28
-
29
- ## API endpoint
30
-
31
- All requests go to a single endpoint:
32
-
33
- ```
34
- POST https://api.picked.app/api/graphql
35
- ```
36
-
37
- Every request must use the `POST` method. The JSON body must hold a `query` field,
38
- and it can also hold a `variables` field:
39
-
40
- ```json
41
- {
42
- "query": "query { ... }",
43
- "variables": { }
44
- }
45
- ```
46
-
47
- Set the `Content-Type` header to `application/json` on every request.
48
-
49
- ```bash
50
- curl -X POST https://api.picked.app/api/graphql \
51
- -H "Content-Type: application/json" \
52
- -d '{"query": "{ ping }"}'
53
- ```
54
-
55
- ## Ping the API
56
-
57
- Check that the API is reachable with the `ping` query. This query needs no
58
- authentication.
59
-
60
- ```graphql
61
- query {
62
- ping
63
- }
64
- ```
65
-
66
- Response:
67
-
68
- ```json
69
- {
70
- "data": {
71
- "ping": "pong"
72
- }
73
- }
74
- ```
75
-
76
- This response means that the API is ready.
77
-
78
- ## Authenticate
79
-
80
- Most operations need an access token. To get one, create a session with your email
81
- address and your password.
82
-
83
- ```graphql
84
- mutation {
85
- sessionCreate(input: {
86
- email: "you@example.com"
87
- password: "your-password"
88
- }) {
89
- session {
90
- accessToken
91
- refreshToken
92
- expiresAt
93
- }
94
- requiresMfa
95
- }
96
- }
97
- ```
98
-
99
- A successful response returns a `Session` with an `accessToken` and a
100
- `refreshToken`:
101
-
102
- ```json
103
- {
104
- "data": {
105
- "sessionCreate": {
106
- "session": {
107
- "accessToken": "eyJhbGciOiJIUzI1NiIs...",
108
- "refreshToken": "v1.refresh-token...",
109
- "expiresAt": "2025-01-15T12:00:00Z"
110
- },
111
- "requiresMfa": false
112
- }
113
- }
114
- }
115
- ```
116
-
117
- When `requiresMfa` is `true`, you must complete the MFA challenge before you receive
118
- a session. See the [Authentication](/reference/management-api/authentication) guide.
119
-
120
- For a server-to-server integration, use
121
- [API key authentication](/how-to/authenticate-with-an-api-key) and not a
122
- session token.
123
-
124
- ## Make an authenticated query
125
-
126
- Pass the access token in the `Authorization` header as a Bearer token:
127
-
128
- ```
129
- Authorization: Bearer eyJhbGciOiJIUzI1NiIs...
130
- ```
131
-
132
- You can now query a resource that needs authentication. This example reads your user
133
- profile:
134
-
135
- ```graphql
136
- query {
137
- user {
138
- id
139
- email
140
- createdAt
141
- organizations(first: 5) {
142
- edges {
143
- node {
144
- id
145
- name
146
- }
147
- }
148
- }
149
- }
150
- }
151
- ```
152
-
153
- ## Make a mutation
154
-
155
- A mutation follows the same pattern. Send a `POST` request with the `Authorization`
156
- header. This example creates an organization:
157
-
158
- ```graphql
159
- mutation {
160
- organizationCreate(input: {
161
- name: "My Company"
162
- slug: "my-company"
163
- }) {
164
- organization {
165
- id
166
- name
167
- slug
168
- }
169
- }
170
- }
171
- ```
172
-
173
- Response:
174
-
175
- ```json
176
- {
177
- "data": {
178
- "organizationCreate": {
179
- "organization": {
180
- "id": "org_abc123",
181
- "name": "My Company",
182
- "slug": "my-company"
183
- }
184
- }
185
- }
186
- }
187
- ```
188
-
189
- Every mutation takes an `input` argument and returns a payload object. On success the
190
- payload holds the resource that the mutation created or updated. On failure the
191
- `errors` array at the top level holds the errors.
192
-
193
- ## Errors
194
-
195
- When something goes wrong, the API returns the errors in the standard GraphQL
196
- `errors` array:
197
-
198
- ```json
199
- {
200
- "data": null,
201
- "errors": [
202
- {
203
- "message": "Invalid credentials",
204
- "extensions": {
205
- "code": "INVALID_CREDENTIALS"
206
- }
207
- }
208
- ]
209
- }
210
- ```
211
-
212
- Read the `extensions.code` field. It holds an error code that your code can act on.
213
- See the [Errors](/reference/management-api/error-handling) guide for the full list of codes.
214
-
215
- ## What you built
216
-
217
- You authenticated against the management API, read your own user, and created an
218
- organization. Every other operation follows the same shape: a `POST` to one endpoint,
219
- with your token in the `Authorization` header.
220
-
221
- ## Where to go next
222
-
223
- - [Authentication](/reference/management-api/authentication) — an email address and a password, OAuth,
224
- magic links, MFA, API keys, and how to control a session.
225
- - [Authorization and Scopes](/reference/management-api/authorization-and-scopes) — what each role can
226
- reach, and how a scope controls a permission.
227
- - [Pagination](/reference/management-api/pagination) — how to move through a large result with a cursor.
228
- - [Errors](/reference/management-api/error-handling) — every error code that the API can return.