14 lines
409 B
TypeScript
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);
|
|
};
|