24 lines
659 B
JavaScript
24 lines
659 B
JavaScript
// PocketBase client initialization
|
|
// Update this URL to match your PocketBase instance
|
|
const POCKETBASE_URL = 'https://pocketbase.ccllc.pro';
|
|
|
|
// Initialize PocketBase client
|
|
const pb = new PocketBase(POCKETBASE_URL);
|
|
|
|
// Handle connection errors
|
|
pb.beforeSend = function (url, options) {
|
|
console.log('PocketBase request:', url, options);
|
|
return { url, options };
|
|
};
|
|
|
|
// Handle auth state changes
|
|
pb.authStore.onChange((token, model) => {
|
|
console.log('Auth state changed:', token ? 'authenticated' : 'not authenticated');
|
|
});
|
|
|
|
// Export for use in other modules
|
|
if (typeof module !== 'undefined' && module.exports) {
|
|
module.exports = pb;
|
|
}
|
|
|