Files
dm-companion/src/lib/pocketbase.ts
2025-05-27 18:07:12 -07:00

14 lines
352 B
TypeScript

/**
* Initializes and exports a singleton PocketBase instance for use throughout the app.
*
* Throws if the PocketBase URL is invalid.
*/
import PocketBase from "pocketbase";
import { POCKETBASE_URL } from "@/config";
export const pb = new PocketBase(POCKETBASE_URL);
export function isAuthenticated(): boolean {
return pb.authStore.isValid;
}