Sign In

@browser-echo/react

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@browser-echo/react - npm Package Compare versions

Comparing version
0.0.6
to
1.0.0
+2
-2
package.json
{
"name": "@browser-echo/react",
"version": "0.0.6",
"version": "1.0.0",
"type": "module",

@@ -29,3 +29,3 @@ "sideEffects": false,

"dependencies": {
"@browser-echo/core": "^0.0.6"
"@browser-echo/core": "^1.0.0"
},

@@ -32,0 +32,0 @@ "devDependencies": {

@@ -9,2 +9,9 @@ # @browser-echo/react

## Table of Contents
- [Installation](#installation)
- [Usage](#usage)
- [Configuration](#configuration)
- [Install MCP Server](#install-mcp-server)
## Features

@@ -158,2 +165,47 @@

## Install MCP Server
For React (non-Vite) apps, MCP forwarding depends on your server-side route implementation. The React provider only handles browser-side log collection.
**📖 [First, set up the MCP server](../mcp/README.md#installation) for your AI assistant, then configure framework options below.**
### Environment Variables
- `BROWSER_ECHO_MCP_URL=http://127.0.0.1:5179/mcp` — Set in your server environment
- `BROWSER_ECHO_SUPPRESS_TERMINAL=1` — Control terminal output in your route handler
### Server Route MCP Integration
Update your server route to forward to MCP:
```js
// Example Express route with MCP forwarding
app.post('/__client-logs', async (req, res) => {
const payload = req.body;
// Forward to MCP if configured
const mcpUrl = process.env.BROWSER_ECHO_MCP_URL;
if (mcpUrl) {
const ingestUrl = mcpUrl.replace('/mcp', '/__client-logs');
try {
await fetch(ingestUrl, {
method: 'POST',
headers: { 'content-type': 'application/json' },
body: JSON.stringify(payload)
});
// Suppress terminal output when forwarding
if (process.env.BROWSER_ECHO_SUPPRESS_TERMINAL !== '0') {
return res.status(204).end();
}
} catch {}
}
// Local terminal output
for (const entry of payload.entries) {
console.log(`[browser] ${entry.level.toUpperCase()}: ${entry.text}`);
}
res.status(204).end();
});
```
## Dependencies

@@ -160,0 +212,0 @@