Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions apps/expo/app/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ Sentry.init({
// Adds more context data to events (IP address, cookies, user, etc.)
// For more information, visit: https://docs.sentry.io/platforms/react-native/data-management/data-collected/
sendDefaultPii: true,
// Disable Sentry in local development or when no DSN is configured.
enabled: clientEnvs.NODE_ENV !== 'development' && !!clientEnvs.EXPO_PUBLIC_SENTRY_DSN,
});

const user = userStore.peek();
Expand Down
4 changes: 4 additions & 0 deletions packages/api/src/utils/__tests__/env-validation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ describe('env-validation', () => {
expect(apiEnvSchema.shape.SENTRY_DSN.safeParse('not-a-url').success).toBe(false);
});

it('accepts missing SENTRY_DSN for local development', () => {
expect(apiEnvSchema.shape.SENTRY_DSN.safeParse(undefined).success).toBe(true);
});

it('validates OPENAI_API_KEY starts with sk-', () => {
expect(apiEnvSchema.shape.OPENAI_API_KEY.safeParse('sk-test123').success).toBe(true);
});
Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/utils/env-validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { z } from 'zod';
export const apiEnvSchema = z.object({
// Environment & Deployment
ENVIRONMENT: z.enum(['development', 'production']).default('production'),
SENTRY_DSN: z.string().url(),
SENTRY_DSN: z.string().url().optional(),

// Database
NEON_DATABASE_URL: z.string().url(),
Expand Down
Loading