2
0
Files
cal/calcom/packages/lib/retellAIFetcher.ts
2024-08-09 00:39:27 +02:00

14 lines
409 B
TypeScript

import { handleErrorsJson } from "@calcom/lib/errors";
export const fetcher = async (endpoint: string, init?: RequestInit | undefined) => {
return fetch(`https://api.retellai.com${endpoint}`, {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.RETELL_AI_KEY}`,
"Content-Type": "application/json",
...init?.headers,
},
...init,
}).then(handleErrorsJson);
};