@outseta/api-client 0.2.5 → 0.3.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
@@ -1,38 +1,23 @@
1
1
  # @outseta/api-client
2
2
 
3
- > **Most users should install a higher-level package instead:**
4
- >
5
- > - **[`@outseta/node-sdk`](https://www.npmjs.com/package/@outseta/node-sdk)** — for Node.js / server-side usage
6
- > - **[`@outseta/react`](https://www.npmjs.com/package/@outseta/react)** — for React apps (hooks, components, provider)
3
+ Low-level generated API client for the Outseta REST API.
7
4
 
8
- Low-level, generated API client for the [Outseta](https://www.outseta.com) REST API. Provides typed fetch functions, Zod validation schemas, and TypeScript types — all auto-generated from the Outseta OpenAPI spec. This package is the shared foundation that those packages build on. Use it directly only if you need fine-grained control or are targeting a runtime not covered by the SDKs above.
5
+ Most apps should use `@outseta/node-sdk` or `@outseta/react` instead.
9
6
 
10
- ## Install
7
+ ## Notes
11
8
 
12
- ```bash
13
- npm install @outseta/api-client
14
- ```
15
-
16
- ## Usage
9
+ - Generated functions are exported from the package root.
10
+ - Generated function options are typed as `RequestInit`; use `withClient(client)` to attach the Outseta client instance.
11
+ - Use API key credentials only server-side. Browser clients should use an Outseta bearer `accessToken`.
17
12
 
18
13
  ```ts
19
- import { createClient } from "@outseta/api-client";
14
+ import { accountGetAllAccounts, createClient, withClient } from "@outseta/api-client";
20
15
 
21
16
  const client = createClient({
22
17
  subdomain: "your-company",
23
18
  apiKey: "your-api-key",
24
19
  apiSecret: "your-api-secret",
25
20
  });
26
- ```
27
-
28
- Then pass the `client` instance to any generated API function:
29
21
 
30
- ```ts
31
- import { getAccounts } from "@outseta/api-client";
32
-
33
- const result = await getAccounts({ client });
22
+ const accounts = await accountGetAllAccounts(undefined, withClient(client));
34
23
  ```
35
-
36
- ## License
37
-
38
- [MIT](../../LICENSE)