export type GetApiContactDemoArgs = {email?: string | undefined}; export type GetApiContactDemoOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Book a 30-minute demo * * GET /contact/demo */ export const getApiContactDemo = async (args: GetApiContactDemoArgs, options?: GetApiContactDemoOptions) => { const {baseUrl = "https://www.getvocal.ai", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.email != null) query.append("email", String(args.email)) const url = `${baseUrl.replace(/\/+$/, '')}/contact/demo${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };