bottleneckcrm/frontend/src/env.js
Ashwin f6e453098b Refactor imports to use new aliasing convention and update environment variable handling
- Changed imports from '$lib' to '#lib' for consistency across the codebase.
- Updated environment variable imports to use the new structure from '$app/env/public' and '$app/env/private'.
- Removed deprecated svelte.config.js and adjusted vite.config.js to accommodate new configurations.
- Added stubs for environment variables in tests to ensure compatibility with the new import structure.
2026-10-15 20:38:58 +05:30

33 lines
1.1 KiB
JavaScript

import { defineEnvVars } from '@sveltejs/kit/env';
/**
* Every environment variable the app reads. SvelteKit 3 exposes only what is
* declared here, through `$app/env/public` and `$app/env/private`.
*
* None is `static`, so each is read when the server starts rather than baked
* in at build time: one Docker image serves any deployment. Each schema passes
* the raw value through, so an unset variable is `undefined`, which is what
* every caller already handles.
*/
/** @param {string | undefined} value */
const optional = (value) => value;
export const variables = defineEnvVars({
PUBLIC_DJANGO_API_URL: {
public: true,
schema: optional,
description: 'The Django API origin, without a trailing /api.'
},
PUBLIC_SENTRY_DSN: {
public: true,
schema: optional,
description: 'Sentry DSN. Unset disables Sentry.'
},
RELAY_SECRET: {
schema: optional,
description: "Shared with the API's RELAY_SECRET so it believes the relayed visitor address."
},
GOOGLE_CLIENT_ID: { schema: optional },
GOOGLE_LOGIN_DOMAIN: { schema: optional },
NODE_ENV: { schema: optional }
});