@djangocfg/devtools
v2.1.466
Published
Frontend devtools for django-cfg apps: error/console capture with backend ingest, plus a floating debug panel. One package, one event stream.
Maintainers
Readme
@djangocfg/devtools
Frontend devtools for django-cfg apps. One package, one event stream:
- Capture —
window.onerror, unhandled rejections,console.warn/error, zod validation events from@djangocfg/apiclients. - Ingest — errors/warnings are batched to
POST /cfg/monitor/ingest/(django-cfg'sdjango_monitorextension) with dedupe, keepalive flush on unload, and a circuit breaker. - Debug panel — floating button (auto in dev,
?debug=1in prod, ⌘D) with a filterable log feed and app-defined custom tabs.
Replaces the retired @djangocfg/monitor + @djangocfg/debuger pair.
Usage
// Root layout — that's the whole setup
import { Devtools } from '@djangocfg/devtools'
<Devtools project="my-app" environment={process.env.NODE_ENV} />// Anywhere in client code
import { devtools } from '@djangocfg/devtools'
devtools.error('Payment widget crashed', { orderId }) // panel + backend
const log = devtools.log('CheckoutForm') // panel only
log.info('step changed', { step })// Server (route handlers / RSC)
import { serverDevtools } from '@djangocfg/devtools/server'
serverDevtools.configure({ project: 'my-app', baseUrl: process.env.API_URL })
await serverDevtools.captureError(err, { url: req.url })In the browser console: window.devtools.status(), window.devtools.error('test').
