Skip to content

Commit

Permalink
refactor: use of NODE_ENV which is 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 f4df122 commit dedbb44
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": "that-us",
"version": "3.13.3",
"version": "3.13.4",
"description": "THAT.us website",
"main": "index.js",
"type": "module",
Expand Down
7 changes: 4 additions & 3 deletions src/_utils/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://that.us',
nodeEnv: env.NODE_ENV,
version: '3.2.1',
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://15d4b436dc0a4366a0ac388c65772926@o235190.ingest.sentry.io/5357492',
environment: env.NODE_ENV
environment: env.PUBLIC_VERCEL_ENV
};

export const debug = {
Expand Down
4 changes: 3 additions & 1 deletion src/hooks.client.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as Sentry from '@sentry/sveltekit';
import { env } from '$env/dynamic/public';

// If you don't want to use Session Replay, remove the `Replay` integration,
// `replaysSessionSampleRate` and `replaysOnErrorSampleRate` options.
Expand All @@ -7,7 +8,8 @@ Sentry.init({
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 * as Sentry from '@sentry/sveltekit';
import { env } from '$env/dynamic/public';

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

export const handleError = Sentry.handleErrorWithSentry();
Expand Down

0 comments on commit dedbb44

Please sign in to comment.