Skip to content

@thebookingkit/core API

All exports from @thebookingkit/core.

import { getAvailableSlots, isSlotAvailable } from "@thebookingkit/core";
FunctionDescription
getAvailableSlots(rules, overrides, bookings, dateRange, timezone, options?)Compute available time slots
isSlotAvailable(rules, overrides, bookings, start, end)Check if a specific slot is open
import { parseRecurrence, InvalidRRuleError } from "@thebookingkit/core";
FunctionDescription
parseRecurrence(rrule, dateRange, startTime, endTime)Expand RRULE into date occurrences
import { normalizeToUTC, utcToLocal, isValidTimezone, getTimezoneOffset, InvalidTimezoneError } from "@thebookingkit/core";
import { computeBookingLimits, filterSlotsByLimits } from "@thebookingkit/core";
FunctionDescription
computeBookingLimits(config, existingBookings, dateRange)Calculate remaining capacity
filterSlotsByLimits(slots, config, existingBookings)Remove slots that exceed limits
import { validateEventType, generateSlug, validateQuestionResponses, EventTypeValidationError } from "@thebookingkit/core";
import { getInitialBookingStatus, getAutoRejectDeadline, isPendingBookingOverdue, CONFIRMATION_TIMEOUT_HOURS } from "@thebookingkit/core";
import { generateBookingToken, verifyBookingToken } from "@thebookingkit/core";
import { withAuth, assertProviderOwnership, assertCustomerAccess } from "@thebookingkit/core";
FunctionDescription
withAuth(handler, adapter, options?)Wrap a handler with authentication
assertProviderOwnership(session, providerId)Assert the user owns the provider
assertCustomerAccess(session, customerEmail)Assert the user has access to the customer’s data
import { withSerializableRetry, SerializationRetryExhaustedError } from "@thebookingkit/core";
import { getTeamSlots, assignHost, resolveManagedEventType, isFieldLocked, propagateTemplateChanges } from "@thebookingkit/core";
import { evaluateCancellationFee, validateCancellationPolicy, computePaymentSummary, requiresPayment, hasNoShowFee, validatePaymentAmount, validateCurrency, formatPaymentAmount, PaymentValidationError } from "@thebookingkit/core";
import { resolveTemplateVariables, evaluateConditions, validateWorkflow, matchWorkflows, DEFAULT_TEMPLATES, TEMPLATE_VARIABLES, WorkflowValidationError } from "@thebookingkit/core";
import { signWebhookPayload, verifyWebhookSignature, createWebhookEnvelope, resolvePayloadTemplate, matchWebhookSubscriptions, getRetryDelay, isSuccessResponse, validateWebhookSubscription, WebhookValidationError, DEFAULT_RETRY_CONFIG, WEBHOOK_TRIGGERS, SIGNATURE_HEADER, TIMESTAMP_HEADER } from "@thebookingkit/core";
import { generateOccurrences, checkRecurringAvailability, cancelFutureOccurrences, isValidFrequency, RecurringBookingError } from "@thebookingkit/core";
import { computeSeatAvailability, canReserveSeat, isGroupEvent, computeGroupEventSummary, formatSeatCount, validateSeatReservation, SeatError } from "@thebookingkit/core";
import { sendConfirmationEmail, sendReminderEmail, sendCancellationEmail, sendRescheduleEmail, scheduleAutoReject, syncBookingToCalendar, deleteBookingFromCalendar, formatDateTimeForEmail, formatDurationForEmail } from "@thebookingkit/core";
import { interpolateTemplate, CONFIRMATION_EMAIL_HTML, CONFIRMATION_EMAIL_TEXT, REMINDER_EMAIL_HTML, CANCELLATION_EMAIL_HTML, RESCHEDULE_EMAIL_HTML } from "@thebookingkit/core";
import { validateRoutingForm, evaluateRoutingRules, validateRoutingResponses, computeRoutingAnalytics, RoutingFormValidationError } from "@thebookingkit/core";
import { validateEmbedConfig, generateEmbedSnippet, generateAllSnippets, buildEmbedUrl, EmbedConfigError } from "@thebookingkit/core";
import { createErrorResponse, createSuccessResponse, createPaginatedResponse, generateApiKey, hashApiKey, verifyApiKey, hasScope, isKeyExpired, checkRateLimit, encodeCursor, decodeCursor, validateSlotQueryParams, parseSortParam, API_ERROR_CODES } from "@thebookingkit/core";
import { COMPONENT_REGISTRY, findComponent, resolveComponentDependencies, listComponents, createManifestEntry, hasLocalModifications, generateSlotkitConfig, generateEnvTemplate, parseMigrationFiles, getPendingMigrations, DEFAULT_MANIFEST } from "@thebookingkit/core";
import { resolveEffectiveSettings, getRolePermissions, roleHasPermission, assertOrgPermission, assertTenantScope, buildOrgBookingUrl, parseOrgBookingPath, TenantAuthorizationError, GLOBAL_DEFAULTS } from "@thebookingkit/core";
import { BookingConflictError, SerializationRetryExhaustedError, UnauthorizedError, ForbiddenError } from "@thebookingkit/core";
import type { AuthAdapter, EmailAdapter, CalendarAdapter, JobAdapter, PaymentAdapter, StorageAdapter, SmsAdapter } from "@thebookingkit/core";
import { generateICSAttachment, JOB_NAMES } from "@thebookingkit/core";