@gtcx/api-client
v0.3.0
Published
HTTP API client for GTCX services with retry and timeout handling.
Downloads
122
Readme
@gtcx/api-client
HTTP API client for GTCX services with retry and timeout handling.
Installation
pnpm add @gtcx/api-clientQuick Start
import { createApiClient } from '@gtcx/api-client';
const client = createApiClient({ baseUrl: 'https://api.gtcx.io' });Signing
const client = createApiClient({
baseUrl: 'https://api.gtcx.io',
signer: async ({ method, url }) => ({
'x-signature': signRequest(method, url),
}),
});mTLS (Node.js)
const client = createApiClient({
baseUrl: 'https://api.gtcx.io',
mtls: {
cert: process.env.MTLS_CERT!,
key: process.env.MTLS_KEY!,
ca: process.env.MTLS_CA,
},
});Errors
import { AuthError, NetworkError, TimeoutError } from '@gtcx/api-client';API
| Export | Description |
| ----------------------- | ------------------------ |
| createApiClient(opts) | Create configured client |
| ApiClientOptions | Configuration type |
| ApiResponse | Response envelope type |
License
MIT
