Send errors from any language or framework to NexaGaze Tracer.
Every integration sends a POST request to the same webhook endpoint. You just need your API key and the error details.
POST https://tracer.nexagaze.com/api/webhook
{
"api_key": "et_your_project_key",
"message": "Something went wrong",
"stack": "Error: Something went wrong\n at handleClick (app/page.js:42)",
"url": "https://mysite.com/page",
"line": 42,
"col": 12,
"user_agent": "Mozilla/5.0 ...",
"language": "javascript",
"breadcrumbs": []
}Drop this in your HTML. Catches JS errors, promise rejections, and console.error automatically.
<script src="https://tracer.nexagaze.com/cdn/tracker.js" data-key="et_your_api_key_here" crossorigin="anonymous" ></script>
import Script from "next/script"
export default function RootLayout({ children }) {
return (
<html>
<body>
{children}
{process.env.NODE_ENV === "production" && (
<Script
src="https://tracer.nexagaze.com/cdn/tracker.js"
data-key={process.env.NEXT_PUBLIC_NEXTGAZE_TRACER_API}
strategy="afterInteractive"
crossOrigin="anonymous"
/>
)}
</body>
</html>
)
}const NEXTGAZE_TRACER_API = "et_your_api_key_here"
const NEXTGAZE_TRACER_URL = "https://tracer.nexagaze.com/api/webhook"
async function reportError(error, req) {
await fetch(NEXTGAZE_TRACER_URL, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
api_key: NEXTGAZE_TRACER_API,
message: error.message,
stack: error.stack,
url: req?.url || "",
language: "node",
}),
})
}
// Express middleware
app.use((err, req, res, next) => {
reportError(err, req)
res.status(500).send("Something broke")
})import requests
import traceback
NEXTGAZE_TRACER_API = "et_your_api_key_here"
NEXTGAZE_TRACER_URL = "https://tracer.nexagaze.com/api/webhook"
def report_error(error, request=None):
requests.post(NEXTGAZE_TRACER_URL, json={
"api_key": NEXTGAZE_TRACER_API,
"message": str(error),
"stack": traceback.format_exc(),
"url": request.url if request else "",
"language": "python",
})
# Django middleware example
class NexaGazeTracerMiddleware:
def __init__(self, get_response):
self.get_response = get_response
def __call__(self, request):
return self.get_response(request)
def process_exception(self, request, exception):
report_error(exception, request)function reportError($error, $url = '') {
$ch = curl_init('https://tracer.nexagaze.com/api/webhook');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'api_key' => 'et_your_api_key_here',
'message' => $error->getMessage(),
'stack' => $error->getTraceAsString(),
'url' => $url,
'language' => 'php',
]));
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_exec($ch);
curl_close($ch);
}
// Laravel exception handler
// app/Exceptions/Handler.php
public function register() {
$this->reportable(function (Throwable $e) {
reportError($e, request()->url());
});
}require 'net/http'
require 'json'
NEXTGAZE_TRACER_API = "et_your_api_key_here"
NEXTGAZE_TRACER_URL = "https://tracer.nexagaze.com/api/webhook"
def report_error(error, request = nil)
uri = URI(NEXTGAZE_TRACER_URL)
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
req = Net::HTTP::Post.new(uri)
req['Content-Type'] = 'application/json'
req.body = {
api_key: NEXTGAZE_TRACER_API,
message: error.message,
stack: error.backtrace&.join("\n"),
url: request&.url || '',
language: 'ruby'
}.to_json
http.request(req)
endpackage main
import (
"bytes"
"encoding/json"
"net/http"
)
const NEXTGAZE_TRACER_API = "et_your_api_key_here"
const NEXTGAZE_TRACER_URL = "https://tracer.nexagaze.com/api/webhook"
func reportError(message string, stack string, url string) {
body, _ := json.Marshal(map[string]interface{}{
"api_key": NEXTGAZE_TRACER_API,
"message": message,
"stack": stack,
"url": url,
"language": "go",
})
http.Post(NEXTGAZE_TRACER_URL, "application/json", bytes.NewBuffer(body))
}| Field | Required | Description |
|---|---|---|
| api_key | yes | Your project API key |
| message | yes | Error message string |
| stack | no | Full stack trace |
| url | no | URL where error occurred |
| line | no | Line number |
| col | no | Column number |
| user_agent | no | Browser user agent |
| language | no | Language/framework (node, python, php, ruby, go) |
| breadcrumbs | no | Array of previous events |