Files
web-pwa/src/lib/owlClient.ts

22 lines
526 B
TypeScript

import { OwlBoardClient, ValidationError, ApiError } from '@owlboard/owlboard-ts';
import { browser, dev } from '$app/environment';
// Import the runes containing the API Key config Here...
const baseUrl: string = browser ? window.location.origin : '';
const getBaseUrl = () => {
if (!browser) return '';
if (dev) return 'https://test.owlboard.info';
return window.location.origin;
};
export const OwlClient = new OwlBoardClient(
getBaseUrl()
// API Key Here when ready!!!
);
export { ValidationError, ApiError };