@zilfu/sdk 0.0.1 → 0.1.0

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/README.md CHANGED
@@ -15,18 +15,22 @@ npm install @zilfu/sdk
15
15
  Get a personal access token from your Zilfu account settings, then:
16
16
 
17
17
  ```ts
18
- import { createZilfuClient, getApiSpaces } from '@zilfu/sdk';
18
+ import { createZilfuClient } from '@zilfu/sdk';
19
19
 
20
- createZilfuClient({
21
- baseUrl: 'https://zilfu.com',
20
+ const api = createZilfuClient({
21
+ baseUrl: 'https://zilfu.com/api',
22
22
  token: process.env.ZILFU_TOKEN!,
23
23
  });
24
24
 
25
- const { data, error } = await getApiSpaces();
26
- if (error) throw error;
27
- console.log(data);
25
+ const { data: spaces } = await api.spaces.list();
26
+ const { data: post } = await api.posts.create({
27
+ path: { space: '1' },
28
+ body: { space_id: 1, items: [{ account_id: 1, social: 'threads', main: { content: 'hi' } }] },
29
+ });
28
30
  ```
29
31
 
32
+ Available namespaces: `accounts`, `bio`, `bioBlocks`, `clusters`, `media`, `posts`, `queue`, `slots`, `spaces`, `subscription`, `tokens`, `webhooks`. Each exposes typed `list / get / create / update / delete` plus resource-specific verbs (`activate`, `boards`, `reorder`, `uploadAvatar`, etc.).
33
+
30
34
  ### Custom fetch (edge runtimes)
31
35
 
32
36
  ```ts