import PocketBase from 'pocketbase';

const rawUrl = import.meta.env.VITE_POCKETBASE_URL ?? '';
// Ensure URL always has a protocol so PocketBase SDK treats it as absolute
const pbUrl = rawUrl.startsWith('http') ? rawUrl : `https://${rawUrl}`;

export const pb = new PocketBase(pbUrl);
