Skip to content
← Public packages

@kody/cal-com

Read booking pages, event types, slots, and webhooks on the caller's Cal.com account, with dry-run mutations.

FollowFork

Files

get-available-slots.js

18 lines · 839 B · JavaScript
import { getAvailableSlots } from './cal-com.js'

/**
 * Get bookable Cal.com slots for an event type over a date range.
 * @param {Object} input
 * @param {number|string} input.eventTypeId Event type to check.
 * @param {string} input.start Range start date.
 * @param {string} input.end Range end date.
 * @param {string} [input.timeZone] IANA timezone for slot formatting.
 * @returns {Promise<Record<string, unknown>>} Available slots payload.
 * @example
 * import getAvailableSlots from 'kody:@kody/cal-com/get-available-slots'
 * const result = await getAvailableSlots({ eventTypeId: 123, start: '2026-06-01', end: '2026-06-08', timeZone: 'America/Denver' })
 * // => { slots: { '2026-06-01': [{ time: '...' }] } }
 */
export default async function getAvailableSlotsEntrypoint(input = {}) {
	return await getAvailableSlots(input)
}