Update environment variable references

Environment variables in multiple files have been updated to correctly reference public variables. Moreover, the conditional check for MONITORING_INSTRUMENTATION_ENABLED has been corrected to explicitly check for the string 'true'. This change ensures that our application correctly accesses public environmental variables and behaves as expected under the conditions defined by these variables.
This commit is contained in:
giancarlo
2024-05-01 18:59:18 +07:00
parent 15f6c72c6e
commit 591c4557c0
4 changed files with 4 additions and 4 deletions

View File

@@ -12,5 +12,5 @@ NEXT_PUBLIC_SUPABASE_URL=
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=
# MONITORING
MONITORING_PROVIDER=
NEXT_PUBLIC_MONITORING_PROVIDER=
MONITORING_INSTRUMENTATION_ENABLED=false

View File

@@ -7,7 +7,7 @@ export async function register() {
// only run in nodejs runtime
if (
process.env.NEXT_RUNTIME === 'nodejs' &&
process.env.MONITORING_INSTRUMENTATION_ENABLED
process.env.MONITORING_INSTRUMENTATION_ENABLED === 'true'
) {
const { registerMonitoringInstrumentation } = await import(
'@kit/monitoring/instrumentation'

View File

@@ -30,7 +30,7 @@ const storage = z.union([local, cloud, github]).parse({
pathPrefix: process.env.KEYSTATIC_PATH_PREFIX,
});
const path = process.env.KEYSTATIC_CONTENT_PATH ?? 'content';
const path = process.env.NEXT_PUBLIC_KEYSTATIC_CONTENT_PATH ?? './content';
const keyStaticConfig = createKeyStaticConfig(path);

View File

@@ -35,7 +35,7 @@ export async function registerMonitoringInstrumentation() {
default:
throw new Error(
`Unknown instrumentation provider: ${process.env.MONITORING_PROVIDER}`,
`Unknown instrumentation provider: ${process.env.NEXT_PUBLIC_MONITORING_PROVIDER}`,
);
}
}