/** * Drift Health Check API * * GET /api/drift/health - Get current health status */ import { NextRequest, NextResponse } from 'next/server' import { getDriftHealthMonitor } from '@/lib/monitoring/drift-health-monitor' export async function GET(req: NextRequest) { try { const monitor = getDriftHealthMonitor() const status = monitor.getHealthStatus() return NextResponse.json({ success: true, ...status, message: status.healthy ? 'Drift SDK connections healthy' : `Warning: ${status.errorCount} accountUnsubscribe errors detected` }) } catch (error: any) { return NextResponse.json({ success: false, error: error.message }, { status: 500 }) } }