diff --git a/backend/src/notifications/notifications.service.ts b/backend/src/notifications/notifications.service.ts index 27ee0f4..a2f1904 100644 --- a/backend/src/notifications/notifications.service.ts +++ b/backend/src/notifications/notifications.service.ts @@ -7,10 +7,14 @@ export class NotificationsService { private readonly fcmServerKey: string; constructor(private config: ConfigService) { - this.fcmServerKey = this.config.getOrThrow('FCM_SERVER_KEY'); + this.fcmServerKey = this.config.get('FCM_SERVER_KEY', ''); } async send(to: string, title: string, body: string, data?: Record) { + if (!this.fcmServerKey) { + this.logger.warn('FCM_SERVER_KEY not set, skipping notification'); + return; + } const message = { notification: { title, body }, priority: 'high' as const,