@faiber/faiber-reservation
@faiber/faiber-reservation
Typed, framework-neutral TypeScript client for Faiber bookable services, providers, schedules, slots, and reservations.
Install
npm install @faiber/faiber-reservation
Create a client
import { FaiberClient, MemoryTokenProvider } from "@faiber/sdk-core";
import { ReservationApi } from "@faiber/faiber-reservation";
const tokens = new MemoryTokenProvider();
const client = new FaiberClient("reservation", {
domains: { reservation: process.env.FAIBER_RESERVATION_URL! },
tokenProvider: tokens,
axios: { timeout: 15_000, withCredentials: true },
});
const api = new ReservationApi(client);
const slots = await api.availableSlots({ provider_id: 42, from_date: "2026-07-18" });
All methods return a full Axios AxiosResponse. Entities, named request inputs, response envelopes, pagination models, and shared core types are exported from the package. Use client.request<TResponse, TBody>() for project-specific endpoints.
Authentication
Pass a TokenProvider for bearer authentication, or set withCredentials: true for secure cookie sessions. The SDK never reads browser storage or environment variables implicitly.
Errors and cancellation
Axios errors are preserved so callers can inspect response.status, structured API error bodies, headers, and request IDs. Pass normal Axios options as the final argument:
await api.availableSlots({ provider_id: 42 } , { signal: AbortSignal.timeout(5_000) });
Complete SDK
Install @faiber/faiber-ts-sdk when an application uses multiple Faiber services. The complete package provides shared configuration, authentication, uploads, and error handling across services.