import createClient from 'openapi-fetch';
import type { paths } from '$lib/api/api.gen'; // generated by openapi-typescript
import { DB_ADAPTER, CF_ACCESS_CLIENT_ID, CF_ACCESS_CLIENT_SECRET } from '$env/static/private';

export const client = createClient<paths>({
	baseUrl: DB_ADAPTER || 'http://localhost:5237',
	headers: {
		'CF-Access-Client-Secret': CF_ACCESS_CLIENT_SECRET || '',
		'CF-Access-Client-Id': CF_ACCESS_CLIENT_ID || ''
	}
});
