Skip to content

Commit

Permalink
Updated config
Browse files Browse the repository at this point in the history
  • Loading branch information
niemyjski committed Feb 13, 2024
1 parent d10e37c commit bba1a08
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build/update-config-next.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ config="

config_footer="
};
}());"
})(this);"

echo "Exceptionless UI Config"
echo "$config"
Expand Down
15 changes: 14 additions & 1 deletion src/Exceptionless.Web/ClientApp/src/hooks.client.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
import { Exceptionless, toError } from '@exceptionless/browser';

import { env } from '$env/dynamic/public';
const { __env = {} } = globalThis as unknown as { __env: typeof env };

import { Exceptionless, toError } from '@exceptionless/browser';
// if we are in production, we will use the environment variables that were injected via docker configuration.
if (__env && import.meta.env.PROD) {
Object.assign(env, __env);
}

// If the PUBLIC_BASE_URL is set in local storage, we will use that instead of the one from the environment variables.
// This allows you to target other environments from your browser.
const PUBLIC_BASE_URL = localStorage?.getItem('PUBLIC_BASE_URL');
if (PUBLIC_BASE_URL) {
env.PUBLIC_BASE_URL = PUBLIC_BASE_URL;
}

await Exceptionless.startup((c) => {
c.apiKey = env.PUBLIC_EXCEPTIONLESS_API_KEY;
Expand Down
2 changes: 1 addition & 1 deletion src/Exceptionless.Web/ClientApp/static/runtime-env.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
PUBLIC_INTERCOM_APPID: '',
PUBLIC_SLACK_APPID: ''
};
}(this));
})(this);

0 comments on commit bba1a08

Please sign in to comment.