"use strict";
const getDailyAppKeys = require("./getDailyAppKeys-hu993QaD.cjs");
const errors = require("./errors-fb9bpDY1.cjs");
const fetcher = async (endpoint, init) => {
  const { api_key } = await getDailyAppKeys.getDailyAppKeys();
  return fetch(`https://api.daily.co/v1${endpoint}`, {
    method: "GET",
    headers: {
      Authorization: `Bearer ${api_key}`,
      "Content-Type": "application/json",
      ...init?.headers
    },
    ...init
  }).then(errors.handleErrorsJson);
};
exports.fetcher = fetcher;
