@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 +8 -23
- package/dist/index.js +1403 -1
- package/package.json +1 -1
- package/src/client.ts +7 -0
- package/src/index.ts +8 -3
package/README.md
CHANGED
|
@@ -1,38 +1,23 @@
|
|
|
1
1
|
# @outseta/api-client
|
|
2
2
|
|
|
3
|
-
|
|
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
|
-
|
|
5
|
+
Most apps should use `@outseta/node-sdk` or `@outseta/react` instead.
|
|
9
6
|
|
|
10
|
-
##
|
|
7
|
+
## Notes
|
|
11
8
|
|
|
12
|
-
|
|
13
|
-
|
|
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
|
-
|
|
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)
|