diff --git a/packages/daemon/src/routes/marketplace-reviews.ts b/packages/daemon/src/routes/marketplace-reviews.ts index 292eb8cc7..6956a877b 100644 --- a/packages/daemon/src/routes/marketplace-reviews.ts +++ b/packages/daemon/src/routes/marketplace-reviews.ts @@ -27,9 +27,12 @@ interface ReviewsSyncConfig { readonly lastSyncError: string | null; } +// Production sync endpoint. Pre-configured so users only need to set enabled: true. +const REVIEWS_SYNC_URL = "https://reviews.signetai.sh/api/reviews/sync"; + const DEFAULT_CONFIG: ReviewsSyncConfig = { enabled: false, - endpointUrl: "", + endpointUrl: REVIEWS_SYNC_URL, lastSyncAt: null, lastSyncError: null, }; @@ -140,7 +143,7 @@ function readConfig(): ReviewsSyncConfig { if (!isRecord(raw)) return DEFAULT_CONFIG; return { enabled: raw.enabled === true, - endpointUrl: typeof raw.endpointUrl === "string" ? raw.endpointUrl : "", + endpointUrl: typeof raw.endpointUrl === "string" && raw.endpointUrl.length > 0 ? raw.endpointUrl : REVIEWS_SYNC_URL, lastSyncAt: typeof raw.lastSyncAt === "string" ? raw.lastSyncAt : null, lastSyncError: typeof raw.lastSyncError === "string" ? raw.lastSyncError : null, }; @@ -344,7 +347,7 @@ export function mountMarketplaceReviewsRoutes(app: Hono): void { try { const response = await fetch(config.endpointUrl, { method: "POST", - headers: { "Content-Type": "application/json" }, + headers: { "Content-Type": "application/json", "X-Signet-Sync": "1" }, body: JSON.stringify({ source: "signet-marketplace", type: "reviews-sync",