Skip to content
← Public packages

@kentcdodds/cal-com

Cal.com helpers for booking pages, event types, slots, and webhooks.

src/smoke-test.js

15 lines · 777 B · JavaScript
import { smokeTest } from './cal-com.js'

/**
 * Verify Cal.com credentials with a real catalog event type.
 * Reads `/me`, lists event types, then (when one exists) fetches that type
 * and a week of slots. Never probes with placeholder ids.
 * @returns {Promise<{ ok: true, profile: Record<string, unknown>, eventTypeCount: number, eventTypeId: number|string|null, checks: Record<string, unknown> }>} Smoke-test summary.
 * @example
 * import smokeTest from 'kody:@kentcdodds/cal-com/smoke-test'
 * const result = await smokeTest()
 * // => { ok: true, profile: { id: 1, username: '...' }, eventTypeCount: 9, eventTypeId: 587527, checks: { profile: true, eventType: true, slots: true } }
 */
export default async function smokeTestEntrypoint() {
  return await smokeTest()
}