import PocketBase from 'pocketbase' import { toApiUrl } from '@/lib/apiUrl' /** @type {PocketBase | null} */ let client = null /** * @returns {PocketBase} */ export function getPocketBase() { const base = import.meta.env.VITE_POCKETBASE_URL if (!base) { throw new Error('VITE_POCKETBASE_URL이 설정되지 않았습니다.') } if (!client) { client = new PocketBase(toApiUrl(base)) } return client }