API Reference

Complete API reference for @igniter-js/caller — all classes, methods, types, and configuration options.

IgniterCaller

The main entrypoint for creating API client instances.

import { IgniterCaller } from '@igniter-js/caller';

IgniterCaller.create()

Creates a new IgniterCallerBuilder instance with an empty configuration.

const api = IgniterCaller.create()
  .withBaseUrl('https://api.example.com')
  .build();

IgniterCallerBuilder

Immutable builder for configuring the API client. Every with* method returns a new builder instance.

Prop

Type


IgniterCallerManager

The runtime engine returned by .build(). Used to create and execute HTTP requests.

Instance Methods

All HTTP method helpers accept an optional URL. When schemas are configured, providing a URL enables full type inference.

Prop

Type

Static Methods

Prop

Type


IgniterCallerRequestBuilder

Fluent per-request API. Returned by api.get(), api.post(), etc. All methods return this for chaining.

Request Configuration

Prop

Type

Resilience

Prop

Type

Response Typing

Prop

Type

Execution

Prop

Type


IgniterCallerSchema

Path-first schema builder for defining type-safe API contracts with Zod (or any StandardSchemaV1 library).

Prop

Type

SchemaPathBuilder

Defines HTTP methods for a single path:

MethodSignatureDescription
get(config)(config: { request?, responses }) => thisDefines GET endpoint
post(config)(config: { request?, responses }) => thisDefines POST endpoint
put(config)(config: { request?, responses }) => thisDefines PUT endpoint
patch(config)(config: { request?, responses }) => thisDefines PATCH endpoint
delete(config)(config: { request?, responses }) => thisDefines DELETE endpoint
head(config)(config: { request?, responses }) => thisDefines HEAD endpoint
ref(key)(key: string) => { schema, array(), nullable(), optional(), record() }References a registered schema with Zod wrappers
build()() => TMethodsReturns the accumulated method map

IgniterCallerMock

Builder for creating typed mock registries for testing.

Prop

Type

Mock Handler Shapes

Static response:

{ response: data; status?: number; headers?: Record<string, string>; delayMs?: number }

Dynamic handler:

(request: { method; path; url; headers; query; params; body?; ... }) => MockResponse

MockCallerStoreAdapter

In-memory store adapter for testing. Implements the IgniterCallerStoreAdapter interface.

import { MockCallerStoreAdapter } from '@igniter-js/caller/adapters';

Prop

Type


Types

IgniterCallerApiResponse<T>

The standardized response envelope returned by all requests.

Prop

Type

IgniterCallerError

Custom error class extending IgniterError for all Caller failures.

Prop

Type

Error Codes

CodeDescription
IGNITER_CALLER_HTTP_ERRORHTTP response status ≥ 400
IGNITER_CALLER_MOCK_HTTP_ERRORMock handler returned an error response
IGNITER_CALLER_TIMEOUTRequest exceeded the configured timeout
IGNITER_CALLER_REQUEST_VALIDATION_FAILEDRequest body failed schema validation
IGNITER_CALLER_RESPONSE_VALIDATION_FAILEDResponse body failed schema validation
IGNITER_CALLER_SCHEMA_DUPLICATEDuplicate schema path or method
IGNITER_CALLER_SCHEMA_INVALIDInvalid schema configuration
IGNITER_CALLER_UNKNOWN_ERRORUnexpected catch-all error

IgniterCallerStoreAdapter

Interface for implementing persistent cache stores.

Prop

Type

IgniterCallerRetryOptions

Prop

Type

IgniterCallerStoreOptions

Prop

Type


Subpath Exports

Import PathPurpose
@igniter-js/callerCore client: IgniterCaller, IgniterCallerSchema, IgniterCallerMock, types
@igniter-js/caller/clientReact integration: IgniterCallerProvider, useIgniterCaller, hooks
@igniter-js/caller/telemetryTelemetry events: IgniterCallerTelemetryEvents
@igniter-js/caller/adaptersStore adapters: MockCallerStoreAdapter