Skip to content

Commit 4577110

Browse files
committed
Introduce DEV_MODE configuration to control MCP tracking behavior
1 parent cd92439 commit 4577110

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@ export class Config {
1111
constructor(
1212
public readonly browserstackUsername: string,
1313
public readonly browserstackAccessKey: string,
14+
public readonly DEV_MODE: boolean,
1415
) {}
1516
}
1617

1718
const config = new Config(
1819
process.env.BROWSERSTACK_USERNAME!,
1920
process.env.BROWSERSTACK_ACCESS_KEY!,
21+
process.env.DEV_MODE === "true"
2022
);
2123

2224
export default config;

src/lib/instrumentation.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ export function trackMCP(
2020
clientInfo: { name?: string; version?: string },
2121
error?: unknown,
2222
): void {
23+
24+
if (config.DEV_MODE) {
25+
logger.info("Tracking MCP is disabled in dev mode");
26+
return;
27+
}
28+
2329
const instrumentationEndpoint = "https://api.browserstack.com/sdk/v1/event";
2430
const isSuccess = !error;
2531
const mcpClient = clientInfo?.name || "unknown";

0 commit comments

Comments
 (0)