Skip to content

Commit

Permalink
refactor: environment variable use of node_env. Not exposed by sveltekit
Browse files Browse the repository at this point in the history
  • Loading branch information
brettski committed Sep 29, 2023
1 parent 23ac46c commit 92e40cc
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "thatconference.com",
"version": "5.0.3",
"version": "5.0.4",
"description": "THATConference.com website",
"main": "index.js",
"type": "module",
Expand Down
4 changes: 3 additions & 1 deletion src/hooks.client.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import * as Sentry from '@sentry/sveltekit';
import { env } from '$env/dynamic/public';

Sentry.init({
dsn: 'https://857800ed593d481bb0da2843516d7845@o235190.ingest.sentry.io/4504617287417856',
tracesSampleRate: 1,
replaysSessionSampleRate: 0.1,
replaysOnErrorSampleRate: 1,
integrations: [new Sentry.Replay()]
integrations: [new Sentry.Replay()],
environment: env.PUBLIC_VERCEL_ENV
});

export const handleError = Sentry.handleErrorWithSentry();
4 changes: 3 additions & 1 deletion src/hooks.server.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { sequence } from '@sveltejs/kit/hooks';
import { env } from '$env/dynamic/public';
import * as Sentry from '@sentry/sveltekit';

Sentry.init({
dsn: 'https://857800ed593d481bb0da2843516d7845@o235190.ingest.sentry.io/4504617287417856',
tracesSampleRate: 1
tracesSampleRate: 1,
environment: env.PUBLIC_VERCEL_ENV
});

export const handleError = Sentry.handleErrorWithSentry();
Expand Down
7 changes: 4 additions & 3 deletions src/lib/config.public.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { env } from '$env/dynamic/public';
import { version } from '$app/environment';

function configMissing(configKey) {
const message = `Missing required public environment varable: ${configKey}`;
Expand All @@ -7,8 +8,8 @@ function configMissing(configKey) {

export default {
hostURL: env.PUBLIC_HOST_URL || 'https://thatconference.com',
nodeEnv: env.NODE_ENV,
version: '5.0.0',
nodeEnv: env.PUBLIC_VERCEL_ENV,
version: version ?? '0.0.0.0',
eventId: 'YWavA70szR8rxSwrLJaL',
eventSlug: 'thatus/daily',
api: {
Expand Down Expand Up @@ -47,7 +48,7 @@ export const securityConfig = () => {

export const logging = {
dsn: 'https://857800ed593d481bb0da2843516d7845@o235190.ingest.sentry.io/4504617287417856',
environment: env.NODE_ENV
environment: env.PUBLIC_VERCEL_ENV
};

export const debug = {
Expand Down

0 comments on commit 92e40cc

Please sign in to comment.