Skip to content

Built for people who want to own their automations. Join the waitlist for an invite.

Package listing

@kody/cal-com

src/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)
}