@swirls/sdk 0.0.4 → 0.0.6
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 +20 -1
- package/dist/client/client.d.ts +14763 -0
- package/dist/client/client.js +20 -0
- package/dist/form/form.d.ts +1 -2
- package/dist/form/form.js +2 -6
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -6,6 +6,18 @@ TypeScript SDK for building applications powered by Swirls.
|
|
|
6
6
|
|
|
7
7
|
The Swirls SDK provides utilities for integrating Swirls into your applications. It is designed to be type-safe, headless, and framework-agnostic.
|
|
8
8
|
|
|
9
|
+
### Client
|
|
10
|
+
|
|
11
|
+
The [`@swirls/sdk/client`](src/client/README.md) subpackage provides a type-safe API client and optional TanStack Query helpers for calling the Swirls API (graphs, forms, triggers, streams, and more).
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { Swirls } from '@swirls/sdk/client'
|
|
15
|
+
|
|
16
|
+
const swirls = new Swirls({ apiKey: process.env.SWIRLS_API_KEY! })
|
|
17
|
+
const graphs = await swirls.client.graphs.listGraphs({ input: { projectId } })
|
|
18
|
+
// With React: useQuery(swirls.query.graphs.listGraphs.queryOptions({ input: { projectId } }))
|
|
19
|
+
```
|
|
20
|
+
|
|
9
21
|
### Configuration
|
|
10
22
|
|
|
11
23
|
The [`@swirls/sdk/config`](src/config/README.md) subpackage provides configuration "glue" that connects your application to a Swirls project and powers code generation.
|
|
@@ -28,8 +40,15 @@ import { useSwirlsFormAdapter } from '@swirls/sdk/form'
|
|
|
28
40
|
bun add @swirls/sdk react zod
|
|
29
41
|
```
|
|
30
42
|
|
|
43
|
+
For TanStack Query integration with the client (optional):
|
|
44
|
+
|
|
45
|
+
```sh
|
|
46
|
+
bun add @tanstack/react-query
|
|
47
|
+
```
|
|
48
|
+
|
|
31
49
|
## Learn More
|
|
32
50
|
|
|
33
|
-
- [Swirls Documentation](https://
|
|
51
|
+
- [Swirls Documentation](https://swirls.ai/docs): Full platform documentation
|
|
52
|
+
- [Client Documentation](src/client/README.md): API client and TanStack Query utils
|
|
34
53
|
- [Config Documentation](src/config/README.md): Configuration reference
|
|
35
54
|
- [Form Documentation](src/form/README.md): Complete guide to forms
|