Skip to content

Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥

feat(api/research-proxy): forward team id in Firecrawl-Team-Id header

mogeryb9fd99b4f3c9
diff --git a/apps/api/src/controllers/v2/research-proxy.ts b/apps/api/src/controllers/v2/research-proxy.ts
index 1df989701..2ea86ea5b 100644
--- a/apps/api/src/controllers/v2/research-proxy.ts
+++ b/apps/api/src/controllers/v2/research-proxy.ts
@@ -1,8 +1,8 @@
-import { NextFunction, Request, Response } from "express";
+import { NextFunction, Response } from "express";
import { Agent, fetch } from "undici";
import { config } from "../../config";
import { logger } from "../../lib/logger";
-import { RequestWithMaybeACUC } from "../v1/types";
+import { RequestWithAuth, RequestWithMaybeACUC } from "../v1/types";
const TIMEOUT_MS = 120_000;
@@ -27,7 +27,7 @@ export function researchFlagMiddleware(
}
export async function researchProxyController(
- req: Request,
+ req: RequestWithAuth<any, any, any>,
res: Response,
): Promise<void> {
const base = config.RESEARCH_PROXY_URL;
@@ -51,6 +51,7 @@ export async function researchProxyController(
const v = req.headers[h];
if (typeof v === "string") headers[h] = v;
}
+ headers["firecrawl-team-id"] = req.auth.team_id;
const init: Parameters<typeof fetch>[1] = {
method: req.method,