@picked/delivery-api-client 0.0.1-dev.1789541668638 → 0.0.1-dev.1793753513002

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/LICENSE ADDED
@@ -0,0 +1 @@
1
+ Copyright (c) Picked. All rights reserved. Contact Picked for a usage licence.
package/README.md CHANGED
@@ -1,32 +1,42 @@
1
1
  # @picked/delivery-api-client
2
2
 
3
- Typed fetch helpers for the Picked [Delivery API](https://docs.picked.app/delivery-api).
3
+ Typed fetch functions for the Picked Delivery API, which serves a project's published
4
+ configuration and content.
4
5
 
5
- ## API
6
+ ## Install
7
+
8
+ ```bash
9
+ npm install @picked/delivery-api-client
10
+ ```
11
+
12
+ ## Usage
6
13
 
7
14
  ```typescript
8
- import {
9
- createClientHeaders,
10
- fetchExperienceContent,
11
- fetchProject,
12
- fetchSchema,
13
- } from '@picked/delivery-api-client'
15
+ import { fetchExperienceContent, fetchProject, fetchSchema } from '@picked/delivery-api-client'
14
16
 
15
17
  const config = await fetchProject('https://api.picked.app', 'your-project-id')
16
18
  const content = await fetchExperienceContent(
17
19
  'https://api.picked.app',
18
20
  'your-project-id',
19
- 'experience-id',
21
+ 'your-experience-id',
20
22
  )
21
23
  const schema = await fetchSchema('https://api.picked.app', 'your-project-id')
22
24
  ```
23
25
 
24
- Preview surfaces pass `previewToken` in the options object. See [Delivery API](https://docs.picked.app/delivery-api) for endpoint details.
26
+ | Function | Returns |
27
+ | ------------------------------------------------------------------- | ----------------------------------- |
28
+ | `fetchProject(apiUrl, projectId, options?)` | The published project configuration |
29
+ | `fetchExperienceContent(apiUrl, projectId, experienceId, options?)` | The content of one experience |
30
+ | `fetchSchema(apiUrl, projectId, options?)` | The workspace schema |
31
+ | `runAction(apiUrl, payload, options?)` | Starts a server-side action run |
25
32
 
26
- ## Development
33
+ Options take `previewToken` (read a workspace draft), `headers` and `signal`; the fetch
34
+ functions also take `onWarn`. A fetch function returns `null` on failure and reports the
35
+ reason to `onWarn`; `runAction` throws. Each request times out after 10 seconds.
27
36
 
28
- This package is part of the Picked monorepo. Run tests from the repo root:
37
+ ## Docs
29
38
 
30
- ```bash
31
- pnpm run test
32
- ```
39
+ - **Web:** [Delivery API client](https://docs.picked.app/reference/tools/delivery-api-client)
40
+ - **Local:** `node_modules/picked/docs/reference/tools/delivery-api-client.md`. The `picked` package carries every page under `node_modules/picked/docs/`.
41
+ - **CLI:** `npx picked docs read /reference/tools/delivery-api-client`. `npx picked docs list [words]` lists the pages.
42
+ - **MCP:** call `read_picked_doc` with `{ "path": "/reference/tools/delivery-api-client" }`; `list_picked_docs` lists the pages. Add the server with `claude mcp add --transport http picked https://api.picked.app/mcp`, or see [How to connect the MCP server](https://docs.picked.app/how-to/connect-the-mcp-server) for other tools.