curl -X POST "https://kodostatus.com/api/beacon" \
-H "Content-Type: application/json" \
-d '{
"key": "bpk_your_key_here",
"events": [{
"type": "error",
"timestamp": 1704844800000,
"session_id": "sess_abc123",
"url": "https://example.com/dashboard",
"service": "my-app",
"environment": "production",
"data": {
"message": "Cannot read property x of undefined",
"stack": "TypeError: Cannot read property...",
"type": "TypeError"
}
}],
"user": { "id": "user123", "email": "[email protected]" }
}'
import { Beacon } from '@kodo-status/beacon';
const beacon = new Beacon({
key: 'bpk_your_key_here',
service: 'my-app',
environment: 'production'
});
// Errors are captured automatically
// Or report manually:
beacon.captureError(new Error('Something went wrong'));
beacon.log('info', 'User clicked checkout');
{
"success": true,
"received": 1,
"signatures_updated": 1,
"logs_stored": 0,
"traces_stored": 0,
"spans_stored": 0
}
Beacon
Report Client Events
Report JavaScript errors, logs, traces, and performance metrics from your frontend
POST
/
beacon
curl -X POST "https://kodostatus.com/api/beacon" \
-H "Content-Type: application/json" \
-d '{
"key": "bpk_your_key_here",
"events": [{
"type": "error",
"timestamp": 1704844800000,
"session_id": "sess_abc123",
"url": "https://example.com/dashboard",
"service": "my-app",
"environment": "production",
"data": {
"message": "Cannot read property x of undefined",
"stack": "TypeError: Cannot read property...",
"type": "TypeError"
}
}],
"user": { "id": "user123", "email": "[email protected]" }
}'
import { Beacon } from '@kodo-status/beacon';
const beacon = new Beacon({
key: 'bpk_your_key_here',
service: 'my-app',
environment: 'production'
});
// Errors are captured automatically
// Or report manually:
beacon.captureError(new Error('Something went wrong'));
beacon.log('info', 'User clicked checkout');
{
"success": true,
"received": 1,
"signatures_updated": 1,
"logs_stored": 0,
"traces_stored": 0,
"spans_stored": 0
}
This endpoint does not require API key authentication. Use your beacon public key (
bpk_...) in the request body.Body Parameters
string
required
Your beacon public key (
bpk_...) or API keyarray
required
Array of events to report
Event Object
string
required
Event type:
error, log, trace, vital, page_load, slow_requestnumber
required
Unix timestamp in milliseconds
string
required
Unique session identifier
string
Page URL where event occurred
string
Service/app name
string
Environment:
production, staging, developmentobject
Event-specific data (error message, stack trace, etc.)
object
User context:
{ id, email, username }Response
boolean
Whether events were recorded
integer
Number of events received
curl -X POST "https://kodostatus.com/api/beacon" \
-H "Content-Type: application/json" \
-d '{
"key": "bpk_your_key_here",
"events": [{
"type": "error",
"timestamp": 1704844800000,
"session_id": "sess_abc123",
"url": "https://example.com/dashboard",
"service": "my-app",
"environment": "production",
"data": {
"message": "Cannot read property x of undefined",
"stack": "TypeError: Cannot read property...",
"type": "TypeError"
}
}],
"user": { "id": "user123", "email": "[email protected]" }
}'
import { Beacon } from '@kodo-status/beacon';
const beacon = new Beacon({
key: 'bpk_your_key_here',
service: 'my-app',
environment: 'production'
});
// Errors are captured automatically
// Or report manually:
beacon.captureError(new Error('Something went wrong'));
beacon.log('info', 'User clicked checkout');
{
"success": true,
"received": 1,
"signatures_updated": 1,
"logs_stored": 0,
"traces_stored": 0,
"spans_stored": 0
}