19 lines
1.2 KiB
TypeScript
19 lines
1.2 KiB
TypeScript
const isDev = import.meta.env.DEV;
|
|
const isLocal = window.location.hostname === 'localhost' || window.location.hostname === '127.0.0.1';
|
|
|
|
// Use proxy paths when on inventory domains to avoid CORS
|
|
const useProxy = !isLocal && (window.location.hostname === 'inventory.kent.pw' || window.location.hostname === 'inventory.acot.site');
|
|
|
|
const liveDashboardConfig = {
|
|
auth: isDev || useProxy ? '/dashboard-auth' : 'https://dashboard.kent.pw/auth',
|
|
aircall: isDev || useProxy ? '/api/aircall' : 'https://dashboard.kent.pw/api/aircall',
|
|
klaviyo: isDev || useProxy ? '/api/klaviyo' : 'https://dashboard.kent.pw/api/klaviyo',
|
|
meta: isDev || useProxy ? '/api/meta' : 'https://dashboard.kent.pw/api/meta',
|
|
gorgias: isDev || useProxy ? '/api/gorgias' : 'https://dashboard.kent.pw/api/gorgias',
|
|
analytics: isDev || useProxy ? '/api/dashboard-analytics' : 'https://dashboard.kent.pw/api/analytics',
|
|
typeform: isDev || useProxy ? '/api/typeform' : 'https://dashboard.kent.pw/api/typeform',
|
|
acot: isDev || useProxy ? '/api/acot' : 'https://dashboard.kent.pw/api/acot',
|
|
clarity: isDev || useProxy ? '/api/clarity' : 'https://dashboard.kent.pw/api/clarity'
|
|
};
|
|
|
|
export default liveDashboardConfig;
|