Install
openclaw skills install codemendMonitor, report, and get AI-generated fixes for JavaScript and TypeScript production errors with automated analysis and pull request integration.
openclaw skills install codemendCodemend captures production JavaScript/TypeScript errors, analyzes them with AI, and generates fixes — either as GitHub PRs or paste-back prompts for AI coding tools like Lovable, Replit, and Cursor.
Report a production error to Codemend. The error will be analyzed by AI within seconds.
curl -X POST "https://codemend.ai/api/errors/ingest" \
-H "Content-Type: application/json" \
-d '{
"key": "'$CODEMEND_API_KEY'",
"message": "TypeError: Cannot read properties of undefined (reading '\''map'\'')",
"stack": "TypeError: Cannot read properties of undefined\n at renderList (src/components/List.tsx:15:23)",
"source_url": "https://myapp.com/dashboard",
"source_type": "openclaw"
}'
Response:
{ "status": "queued", "error_id": "uuid-here" }
Get the AI-generated fix for a reported error. Includes explanation, root cause, confidence score, and a fix prompt you can paste into your AI coding tool.
curl -s "https://codemend.ai/api/errors/{ERROR_ID}/fix" \
-H "x-api-key: $CODEMEND_API_KEY"
Response:
{
"error": {
"id": "uuid",
"status": "analyzed",
"message": "TypeError: Cannot read properties of undefined",
"stack_trace": "...",
"source_url": "https://myapp.com/dashboard"
},
"fix": {
"id": "uuid",
"explanation": "The map() call fails because data is undefined on first render",
"root_cause": "Missing null check before array operation",
"confidence": 0.92,
"fix_prompt": "In src/components/List.tsx, add an early return if data is undefined...",
"pr_url": "https://github.com/user/repo/pull/42"
},
"dashboard_url": "https://codemend.ai/errors/uuid"
}
If the error is still being analyzed, the fix field will be null. Poll with check_status first.
Check if an error has been analyzed yet.
curl -s "https://codemend.ai/api/errors/{ERROR_ID}/status" \
-H "x-api-key: $CODEMEND_API_KEY"
Response:
{
"status": "analyzed",
"message": "TypeError: Cannot read properties of undefined",
"has_fix": true,
"fix_id": "uuid-here",
"dashboard_url": "https://codemend.ai/dashboard/errors/uuid"
}
Statuses: new → analyzing → analyzed / fix_applied / ignored
List recent errors for this project.
curl -s "https://codemend.ai/api/errors?limit=10&status=analyzed" \
-H "x-api-key: $CODEMEND_API_KEY"
Response:
{
"errors": [
{
"id": "uuid",
"status": "analyzed",
"message": "TypeError: Cannot read properties of undefined",
"source_type": "openclaw",
"has_fix": true,
"fix_id": "uuid",
"created_at": "2026-03-11T12:00:00Z"
}
],
"total": 42
}
Add to your HTML <head>:
<script src="https://codemend.ai/s.js" data-key="YOUR_API_KEY"></script>
Or if using an AI coding tool (Lovable, Replit, Bolt, etc.), paste this prompt:
Add this error monitoring script to my app. Put it in the
<head>section of index.html:<script src="https://codemend.ai/s.js" data-key="YOUR_API_KEY"></script>
npm install codemend
const codemend = require('codemend');
codemend.init({ apiKey: process.env.CODEMEND_API_KEY });
codemend.setupProcessHandlers();
const codemend = require('codemend');
codemend.init({ apiKey: process.env.CODEMEND_API_KEY });
app.use(codemend.expressErrorHandler());
import codemend from 'codemend/react-native';
codemend.init({ apiKey: 'YOUR_API_KEY' });
codemend.setupErrorHandler();
list_errors to see recent errorsget_fix to get the AI-generated fixfix_prompt into your AI tool, or review the PR on GitHub