Skip to content

Commit a514e8d

Browse files
committed
add clientOptions (#142)
1 parent 410d308 commit a514e8d

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@kilnfi/sdk",
3-
"version": "3.1.6",
3+
"version": "3.1.7",
44
"autor": "Kiln <[email protected]> (https://kiln.fi)",
55
"license": "BUSL-1.1",
66
"description": "JavaScript sdk for Kiln API",

src/kiln.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,24 @@ import type { paths } from './openapi/schema.js';
22
export * from './validators.js';
33
export * from './openapi/schema.js';
44
export * from './utils.js';
5-
import createClient, { type Client } from 'openapi-fetch';
5+
import createClient, { type Client, type ClientOptions } from 'openapi-fetch';
66
import { FireblocksService } from './fireblocks.js';
77

88
type Config = {
99
baseUrl: string;
10-
apiToken: string;
10+
apiToken?: string;
11+
clientOptions?: ClientOptions;
1112
};
1213

1314
export class Kiln {
1415
fireblocks: FireblocksService;
1516
client: Client<paths>;
1617

17-
constructor({ apiToken, baseUrl }: Config) {
18+
constructor({ apiToken, baseUrl, clientOptions }: Config) {
1819
const client = createClient<paths>({
20+
...clientOptions,
1921
baseUrl,
20-
headers: { Authorization: `Bearer ${apiToken}` },
22+
headers: apiToken ? { Authorization: `Bearer ${apiToken}` } : {},
2123
querySerializer: { array: { explode: false, style: 'form' } },
2224
});
2325
this.fireblocks = new FireblocksService(client);

0 commit comments

Comments
 (0)