import { g as getDailyAppKeys } from "./getDailyAppKeys-Yq17PM_T.js";
import { h as handleErrorsJson } from "./errors-KLKo_Ptn.js";
const fetcher = async (endpoint, init) => {
  const { api_key } = await getDailyAppKeys();
  return fetch(`https://api.daily.co/v1${endpoint}`, {
    method: "GET",
    headers: {
      Authorization: `Bearer ${api_key}`,
      "Content-Type": "application/json",
      ...init?.headers
    },
    ...init
  }).then(handleErrorsJson);
};
export {
  fetcher as f
};
