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:
@@ -12,5 +12,5 @@ NEXT_PUBLIC_SUPABASE_URL=
|
||||
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=
|
||||
|
||||
# MONITORING
|
||||
MONITORING_PROVIDER=
|
||||
NEXT_PUBLIC_MONITORING_PROVIDER=
|
||||
MONITORING_INSTRUMENTATION_ENABLED=false
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user