Skip to content

Commit 0d9f68a

Browse files
committed
Write custom README sections for "SDK Example Usage" and "Region Selection"
1 parent 2b791e3 commit 0d9f68a

File tree

1 file changed

+8
-70
lines changed

1 file changed

+8
-70
lines changed

README.md

Lines changed: 8 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ Developer-friendly & type-safe TypeScript SDK for the [Kombo Unified API](https:
2525
* [@kombo-api/sdk](#kombo-apisdk)
2626
* [SDK Installation](#sdk-installation)
2727
* [SDK Example Usage](#sdk-example-usage)
28-
* [Global Parameters](#global-parameters)
29-
* [Server Selection](#server-selection)
28+
* [Region Selection](#region-selection)
3029
* [Available Resources and Operations](#available-resources-and-operations)
3130
* [Pagination](#pagination)
3231
* [Error Handling](#error-handling)
@@ -75,11 +74,8 @@ yarn add @kombo-api/sdk
7574
> CommonJS, use `await import("@kombo-api/sdk")` to import and use this package.
7675
<!-- End SDK Installation [installation] -->
7776
78-
<!-- Start SDK Example Usage [usage] -->
7977
## SDK Example Usage
8078

81-
### Example
82-
8379
```typescript
8480
import { Kombo } from "@kombo-api/sdk";
8581

@@ -94,61 +90,34 @@ async function run() {
9490
}
9591

9692
run();
97-
9893
```
99-
<!-- End SDK Example Usage [usage] -->
100-
101-
<!-- Start Global Parameters [global-parameters] -->
102-
## Global Parameters
103-
104-
A parameter is configured globally. This parameter may be set on the SDK client instance itself during initialization. When configured as an option during SDK initialization, This global value will be used as the default on the operations that use it. When such operations are called, there is a place in each to override the global value, if needed.
105-
106-
For example, you can set `integration_id` to `"workday:HWUTwvyx2wLoSUHphiWVrp28"` at SDK initialization and then you do not have to pass the same value on calls to operations like `deleteIntegration`. But if you want to do so you may, which will locally override the global setting. See the example code below for a demonstration.
10794

95+
### Specifying an integration ID
10896

109-
### Available Globals
110-
111-
The following global parameter is available.
112-
113-
| Name | Type | Description |
114-
| -------------- | ------ | ------------------------------------------------ |
115-
| integration_id | string | ID of the integration you want to interact with. |
116-
117-
### Example
97+
The majority of Kombo API endpoints are for interacting with a single "integration" (i.e., a single connection to one your customers' systems). For using these, make sure to specify the `integration_id` parameter when initializing the SDK:
11898

11999
```typescript
120100
import { Kombo } from "@kombo-api/sdk";
121101

122102
const kombo = new Kombo({
123-
integration_id: "workday:HWUTwvyx2wLoSUHphiWVrp28",
124103
api_key: "<YOUR_BEARER_TOKEN_HERE>",
104+
integration_id: "workday:HWUTwvyx2wLoSUHphiWVrp28",
125105
});
126106

127107
async function run() {
128-
const result = await kombo.general.deleteIntegration({
129-
integration_id: "<id>",
130-
delete_integrations_integration_id_request_body: {},
131-
});
108+
const result = await kombo.hris.getEmployees();
132109

133110
console.log(result);
134111
}
135112

136113
run();
137-
138114
```
139-
<!-- End Global Parameters [global-parameters] -->
140-
141-
<!-- Start Server Selection [server] -->
142-
## Server Selection
143115

144-
### Select Server by Name
116+
## Region Selection
145117

146-
You can override the default server globally by passing a server name to the `server: keyof typeof ServerList` optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the names associated with the available servers:
118+
The Kombo platform is available in two regions: Europe and United States.
147119

148-
| Name | Server | Description |
149-
| ---- | ----------------------------- | ---------------- |
150-
| `eu` | `https://api.kombo.dev/v1` | Kombo API Server |
151-
| `us` | `https://api.us.kombo.dev/v1` | Kombo API Server |
120+
By default, the SDK will use the EU region. If you're using the US region (hosted under `api.us.kombo.dev`), make sure to specify the `server` parameter when initializing the SDK.
152121

153122
#### Example
154123

@@ -159,38 +128,7 @@ const kombo = new Kombo({
159128
server: "us",
160129
api_key: "<YOUR_BEARER_TOKEN_HERE>",
161130
});
162-
163-
async function run() {
164-
const result = await kombo.general.checkApiKey();
165-
166-
console.log(result);
167-
}
168-
169-
run();
170-
171-
```
172-
173-
### Override Server URL Per-Client
174-
175-
The default server can also be overridden globally by passing a URL to the `server_url: string` optional parameter when initializing the SDK client instance. For example:
176-
```typescript
177-
import { Kombo } from "@kombo-api/sdk";
178-
179-
const kombo = new Kombo({
180-
server_url: "https://api.kombo.dev/v1",
181-
api_key: "<YOUR_BEARER_TOKEN_HERE>",
182-
});
183-
184-
async function run() {
185-
const result = await kombo.general.checkApiKey();
186-
187-
console.log(result);
188-
}
189-
190-
run();
191-
192131
```
193-
<!-- End Server Selection [server] -->
194132

195133
<!-- Start Available Resources and Operations [operations] -->
196134
## Available Resources and Operations

0 commit comments

Comments
 (0)