Skip to content

Commit

Permalink
πŸš‘ global: fix sentry dsn import
Browse files Browse the repository at this point in the history
  • Loading branch information
cruzdanilo committed Jan 2, 2025
1 parent 96ceae8 commit 247493f
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 5 deletions.
6 changes: 6 additions & 0 deletions .changeset/famous-plums-drum.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@exactly/server": patch
"@exactly/mobile": patch
---

πŸš‘ fix sentry dsn import
3 changes: 3 additions & 0 deletions common/domain.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = /** @type {string} */ (
process.env.EXPO_PUBLIC_DOMAIN || process.env.APP_DOMAIN || "sandbox.exactly.app" // eslint-disable-line @typescript-eslint/prefer-nullish-coalescing -- ignore empty string
);
1 change: 0 additions & 1 deletion common/domain.ts

This file was deleted.

5 changes: 3 additions & 2 deletions common/sentryDSN.ts β†’ common/sentryDSN.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import domain from "@exactly/common/domain";
const domain = require("@exactly/common/domain");

const defaultDSN = "https://[email protected]/4506186349674496";

export default process.env.EXPO_PUBLIC_SENTRY_DSN || // eslint-disable-line @typescript-eslint/prefer-nullish-coalescing -- ignore empty string
module.exports =
process.env.EXPO_PUBLIC_SENTRY_DSN || // eslint-disable-line @typescript-eslint/prefer-nullish-coalescing -- ignore empty string
{
"web.exactly.app": defaultDSN,
"sandbox.exactly.app": defaultDSN,
Expand Down
2 changes: 1 addition & 1 deletion server/instrument.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const { nodeProfilingIntegration } = require("@sentry/profiling-node");

init({
release: require("@exactly/common/generated/release"),
dsn: process.env.EXPO_PUBLIC_SENTRY_DSN,
dsn: require("@exactly/common/sentryDSN"),
environment: process.env.NODE_ENV === "production" ? "production" : "development",
tracesSampleRate: process.env.NODE_ENV === "production" ? 1 : 0.01,
profilesSampleRate: process.env.NODE_ENV === "production" ? 1 : 0.01,
Expand Down
3 changes: 2 additions & 1 deletion src/app/_layout.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import release from "@exactly/common/generated/release";
import sentryDSN from "@exactly/common/sentryDSN";
import { init, mobileReplayIntegration, reactNavigationIntegration, wrap } from "@sentry/react-native";
import { ToastProvider } from "@tamagui/toast";
import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
Expand Down Expand Up @@ -29,7 +30,7 @@ export { ErrorBoundary } from "expo-router";
const routingInstrumentation = reactNavigationIntegration();
init({
release,
dsn: process.env.EXPO_PUBLIC_SENTRY_DSN,
dsn: sentryDSN,
environment: __DEV__ ? "development" : "production",
tracesSampleRate: 1,
attachStacktrace: true,
Expand Down

0 comments on commit 247493f

Please sign in to comment.