Registry↗Dashboard↗

HTTP Client

Core HTTP client with automatic authentication, retry logic, rate limit handling, and response envelope unwrapping.

14 methods

client.get()

Send a GET request. Automatically retried on transient errors (502, 503, 504, 429).

Requires authentication
endpointrequiredstring

API endpoint path (e.g., '/projects').

paramsoptionalobject

Query parameters object. Undefined values are filtered out.

schemaoptionalZodType<T>

Zod schema for runtime response validation.

get<T>(endpoint: string, params?: object, options?: { schema?: ZodType<T> }): Promise<T>
typescript
import { HttpClient } from '@uluops/sdk-core';

const client = new HttpClient({
  apiKey: 'ulr_your-api-key',
});

const result = await client.get('/projects');
Response Type
Promise<T>

client.post()

Send a POST request. Not retried by default — set retryMutations for idempotent endpoints.

Requires authentication
endpointrequiredstring

API endpoint path.

dataoptionalobject

Request body.

schemaoptionalZodType<T>

Zod schema for response validation.

skipAuthoptionalboolean

Skip authentication header (for public endpoints like login).

retryMutationsoptionalboolean

Enable retry for this mutation (only for idempotent operations).

post<T>(endpoint: string, data?: object, options?: { schema?: ZodType<T>; skipAuth?: boolean; retryMutations?: boolean }): Promise<T>
typescript
import { HttpClient } from '@uluops/sdk-core';

const client = new HttpClient({
  apiKey: 'ulr_your-api-key',
});

const result = await client.post('/projects');
Response Type
Promise<T>

client.patch()

Send a PATCH request for partial updates.

Requires authentication
endpointrequiredstring

API endpoint path.

dataoptionalobject

Request body with fields to update.

paramsoptionalobject

Query parameters.

skipAuthoptionalboolean

Skip authentication header.

schemaoptionalZodType<T>

Zod schema for runtime response validation.

patch<T>(endpoint: string, data?: object, options?: { params?: object; skipAuth?: boolean; schema?: ZodType<T> }): Promise<T>
typescript
import { HttpClient } from '@uluops/sdk-core';

const client = new HttpClient({
  apiKey: 'ulr_your-api-key',
});

const result = await client.patch('/projects');
Response Type
Promise<T>

client.put()

Send a PUT request for full resource replacement.

Requires authentication
endpointrequiredstring

API endpoint path.

dataoptionalobject

Request body.

schemaoptionalZodType<T>

Zod schema for response validation.

skipAuthoptionalboolean

Skip authentication header.

put<T>(endpoint: string, data?: object, options?: { schema?: ZodType<T>; skipAuth?: boolean }): Promise<T>
typescript
import { HttpClient } from '@uluops/sdk-core';

const client = new HttpClient({
  apiKey: 'ulr_your-api-key',
});

const result = await client.put('/projects');
Response Type
Promise<T>

client.delete()

Send a DELETE request.

Requires authentication
endpointrequiredstring

API endpoint path.

dataoptionalobject

Optional request body.

schemaoptionalZodType<T>

Zod schema for response validation.

skipAuthoptionalboolean

Skip authentication header.

delete<T>(endpoint: string, data?: object, options?: { schema?: ZodType<T>; skipAuth?: boolean }): Promise<T>
typescript
import { HttpClient } from '@uluops/sdk-core';

const client = new HttpClient({
  apiKey: 'ulr_your-api-key',
});

const result = await client.delete('/projects');
Response Type
Promise<T>

client.request()

Low-level request method with full control over options. Includes automatic retry for GET, token refresh on 401, and rate limit handling.

Requires authentication
methodrequiredstring

HTTP method.

GETPOSTPATCHPUTDELETE
endpointrequiredstring

API endpoint path.

dataoptionalobject

Request body.

paramsoptionalobject

Query parameters.

retriesoptionalnumber

Override retry count for this request.

retryMutationsoptionalboolean

Enable retry for mutations.

headersoptionalRecord<string, string>

Additional headers for this request.

schemaoptionalZodType<T>

Zod schema for response validation.

skipAuthoptionalboolean

Skip authentication header.

request<T>(method: HttpMethod, endpoint: string, data?: object, options?: RequestOptions<T>): Promise<T>
typescript
import { HttpClient } from '@uluops/sdk-core';

const client = new HttpClient({
  apiKey: 'ulr_your-api-key',
});

const result = await client.request({ method: 'GET', endpoint: '/projects' });
Response Type
Promise<T>

client.requestRaw()

Make a raw request that returns the full response without envelope unwrapping. Does not include retry or token refresh.

Requires authentication
methodrequiredstring

HTTP method.

GETPOSTPATCHPUTDELETE
endpointrequiredstring

API endpoint path.

dataoptionalobject

Request body.

paramsoptionalobject

Query parameters.

headersoptionalRecord<string, string>

Additional headers.

schemaoptionalZodType<T>

Zod schema for response validation.

requestRaw<T>(method: HttpMethod, endpoint: string, data?: object, options?: RawRequestOptions<T>): Promise<T>
typescript
import { HttpClient } from '@uluops/sdk-core';

const client = new HttpClient({
  apiKey: 'ulr_your-api-key',
});

const result = await client.requestRaw('GET', '/projects');
Response Type
Promise<T>

client.requestBinary()

Make a request that returns binary data (ArrayBuffer). Used for file downloads, avatar images, etc.

Requires authentication
methodrequiredstring

HTTP method.

GETPOSTPATCHPUTDELETE
endpointrequiredstring

API endpoint path.

paramsoptionalobject

Query parameters.

headersoptionalRecord<string, string>

Additional headers.

datarequiredArrayBuffer

Binary response data.

contentTyperequiredstring

Response content type.

headersrequiredHeaders

Response headers.

requestBinary(method: HttpMethod, endpoint: string, options?: BinaryRequestOptions): Promise<{ data: ArrayBuffer; contentType: string; headers: Headers }>
typescript
import { HttpClient } from '@uluops/sdk-core';

const client = new HttpClient({
  apiKey: 'ulr_your-api-key',
});

const result = await client.requestBinary('GET', '/projects');

console.log(result.data);
Response Type
// Promise<{ data: ArrayBuffer; contentType: string; headers: Headers }>
{
  data: ArrayBuffer;
  contentType: string;
  headers: Headers;
}

client.getRateLimitInfo()

Get the rate limit information from the most recent response. Returns null if no rate limit headers were present.

limitrequirednumber

Total request limit per window.

remainingrequirednumber

Requests remaining in current window.

resetrequiredDate

When the rate limit window resets.

retryAfteroptionalnumber

Seconds to wait before retrying (from Retry-After header).

getRateLimitInfo(): RateLimitInfo | null
typescript
import { HttpClient } from '@uluops/sdk-core';

const client = new HttpClient({
  apiKey: 'ulr_your-api-key',
});

const result = await client.getRateLimitInfo();

console.log(result.limit);
Response Type
// RateLimitInfo | null
{
  limit: number;
  remaining: number;
  reset: Date;
  retryAfter?: number;
}

client.getAuthBaseUrl()

Get the auth base URL configured for this client.

getAuthBaseUrl(): string
typescript
import { HttpClient } from '@uluops/sdk-core';

const client = new HttpClient({
  apiKey: 'ulr_your-api-key',
});

const result = await client.getAuthBaseUrl();
Response Type
string

client.setAuthStrategy()

Replace the authentication strategy. Used after login to swap from no-auth to session-based auth.

strategyrequiredAuthStrategy | null

New auth strategy, or null to clear.

setAuthStrategy(strategy: AuthStrategy | null): void
typescript
import { HttpClient } from '@uluops/sdk-core';

const client = new HttpClient({
  apiKey: 'ulr_your-api-key',
});

const result = await client.setAuthStrategy('keep_target');
Response Type
void

client.getAuthStrategy()

Get the current authentication strategy. Returns null if no credentials are configured.

getAuthStrategy(): AuthStrategy | null
typescript
import { HttpClient } from '@uluops/sdk-core';

const client = new HttpClient({
  apiKey: 'ulr_your-api-key',
});

const result = await client.getAuthStrategy();
Response Type
AuthStrategy | null

client.requestStream()

Issue a request and return the raw Response for streaming consumption. Resilience (retry/refresh) applies up to body handoff only. Added in 0.15.0.

Requires authentication
methodrequiredHttpMethod

HTTP method.

endpointrequiredstring

API endpoint path.

optionsoptionalRequestOptions

Request options.

requestStream(method, endpoint, options?)
typescript
import { HttpClient } from '@uluops/sdk-core';

const client = new HttpClient({
  apiKey: 'ulr_your-api-key',
});

const result = await client.requestStream('example-value', '/projects');
Response Type
Promise<Response>

client.getStream()

GET wrapper over requestStream for streaming downloads. Added in 0.15.0.

Requires authentication
endpointrequiredstring

API endpoint path.

paramsoptionalobject

Query parameters.

optionsoptionalRequestOptions

Request options.

getStream(endpoint, params?, options?)
typescript
import { HttpClient } from '@uluops/sdk-core';

const client = new HttpClient({
  apiKey: 'ulr_your-api-key',
});

const result = await client.getStream('/projects');
Response Type
Promise<Response>