@zilfu/sdk 0.0.1

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 ADDED
@@ -0,0 +1,47 @@
1
+ # @zilfu/sdk
2
+
3
+ Official TypeScript SDK for the [Zilfu](https://zilfu.com) API. Type-safe client generated from the live OpenAPI spec — works in browser, Node 18+, and edge runtimes (Cloudflare Workers, Vercel Edge).
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ pnpm add @zilfu/sdk
9
+ # or
10
+ npm install @zilfu/sdk
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ Get a personal access token from your Zilfu account settings, then:
16
+
17
+ ```ts
18
+ import { createZilfuClient, getApiSpaces } from '@zilfu/sdk';
19
+
20
+ createZilfuClient({
21
+ baseUrl: 'https://zilfu.com',
22
+ token: process.env.ZILFU_TOKEN!,
23
+ });
24
+
25
+ const { data, error } = await getApiSpaces();
26
+ if (error) throw error;
27
+ console.log(data);
28
+ ```
29
+
30
+ ### Custom fetch (edge runtimes)
31
+
32
+ ```ts
33
+ createZilfuClient({
34
+ baseUrl: 'https://zilfu.com',
35
+ token,
36
+ fetch: globalThis.fetch.bind(globalThis),
37
+ });
38
+ ```
39
+
40
+ ## Development
41
+
42
+ ```bash
43
+ pnpm sync # export openapi.json from the Laravel app
44
+ pnpm generate # regenerate src/generated/ from openapi.json
45
+ pnpm build # bundle dist/
46
+ pnpm typecheck
47
+ ```