import { paths } from "https://esm.town/v/pomdtr/openapi_schema";
import createClient2 from "npm:openapi-fetch";
export default function createClient(options: {
baseUrl?: string;
token?: string | null | undefined;
} = {}) {
return createClient2<paths>({
baseUrl: options?.baseUrl ?? "https://api.val.town",
headers: options?.token === null ? {} : { Authorization: `Bearer ${options.token ?? Deno.env.get("valtown")}` },
});
}