KERNIT Documentation
Feedback and Search Analytics
KERNIT docs expose lightweight browser events for search, playground use, endpoint responses, and page feedback so the documentation can keep improving from real developer signals.
Browser Event Contract#
The static docs emit a kernit-docs-event browser event, keep the last events in localStorage.kernit_docs_events, and send the same sanitized event to /api/docs-events for durable product analytics.
| Event type | When it fires | Typical fields |
|---|---|---|
| search | A docs search query is evaluated. | query, results |
| feedback | A user clicks Yes or No on page feedback. | value, page |
| playground_submit | A per-endpoint request builder is submitted. | endpoint, method |
| playground_response | The request builder receives a response. | endpoint, status |
| playground_error | The request builder fails before a response. | endpoint, message |
Integration Example#
window.addEventListener('kernit-docs-event', (event) => {
console.log(event.detail.type, event.detail.path, event.detail.detail);
});Durable Event Sink#
The production event sink accepts only docs paths, docs event types, and whitelisted fields such as endpoint, status, search query, result count, and feedback value. It rejects invalid JSON, rejects non-docs paths, redacts credential-looking strings, and does not send API keys, files, or request bodies.
Why This Exists#
Good developer docs improve from search misses, endpoint testing friction, and page-level feedback. These hooks give KERNIT a practical feedback surface while keeping the docs fully static and crawlable.