@short.io/client-node
Advanced tools
Comparing version 2.1.1 to 2.2.0
@@ -1,2 +0,3 @@ | ||
export * from './types.gen.js'; | ||
export * from './sdk.gen.js'; | ||
export * from './generated/types.gen.js'; | ||
export * from './generated/sdk.gen.js'; | ||
export declare const setApiKey: (apiKey: string) => void; |
@@ -1,3 +0,14 @@ | ||
export * from './types.gen.js'; | ||
export * from './sdk.gen.js'; | ||
import { client } from "./generated/index.js"; | ||
export * from './generated/types.gen.js'; | ||
export * from './generated/sdk.gen.js'; | ||
client.setConfig({ | ||
baseUrl: "https://api.short.io" | ||
}); | ||
export const setApiKey = (apiKey) => { | ||
client.setConfig({ | ||
headers: { | ||
authorization: apiKey | ||
} | ||
}); | ||
}; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@short.io/client-node", | ||
"version": "2.1.1", | ||
"version": "2.2.0", | ||
"description": "", | ||
@@ -11,3 +11,3 @@ "main": "dist/index.js", | ||
"scripts": { | ||
"generate": "openapi-ts -f openapi/config.ts && sed -i 's/createConfig()/createConfig({\"baseUrl\": \"https:\\/\\/api.short.io\"})/' src/sdk.gen.ts", | ||
"generate": "openapi-ts -f openapi/config.ts", | ||
"compile": "tsc --build . && tsc-alias", | ||
@@ -37,3 +37,3 @@ "prepare": "npm run compile", | ||
"@eslint/js": "^9.16.0", | ||
"@hey-api/openapi-ts": "^0.58.0", | ||
"@hey-api/openapi-ts": "^0.59.0", | ||
"@types/node": "^22.10.1", | ||
@@ -47,5 +47,5 @@ "eslint": "^9.16.0", | ||
"dependencies": { | ||
"@hey-api/client-fetch": "^0.5.0" | ||
"@hey-api/client-fetch": "^0.5.1" | ||
}, | ||
"packageManager": "yarn@1.22.22+sha256.c17d3797fb9a9115bf375e31bfd30058cac6bc9c3b8807a3d8cb2094794b51ca" | ||
} |
@@ -24,10 +24,5 @@ # Short.io Node.js SDK | ||
```js | ||
import { client } from "@short.io/client-node"; | ||
import { setApiKey } from "@short.io/client-node"; | ||
client.setConfig({ | ||
baseUrl: "https://api.short.io", | ||
headers: { | ||
Authorization: "YOUR_API_KEY", | ||
}, | ||
}); | ||
setApiKey("YOUR_API_KEY"); | ||
``` | ||
@@ -41,3 +36,2 @@ | ||
import { | ||
client, | ||
getApiDomains, | ||
@@ -47,8 +41,4 @@ getLinksExpand, | ||
} from "@short.io/client-node"; | ||
``` | ||
Pass created client to the methods: | ||
```js | ||
const domainsResp = await getApiDomains({ client }); | ||
const domainsResp = await getApiDomains(); | ||
``` | ||
@@ -55,0 +45,0 @@ |
Sorry, the diff of this file is not supported yet
504064
41
5356
56
Updated@hey-api/client-fetch@^0.5.1