reportd

command module
v0.0.0-...-174411e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2025 License: MIT Imports: 20 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

reportd

GoDoc Go Report Card

A service for receiving CSP reports and others.

Report To

This service will log the reports recieved from a variety of report-uri and report-to systems as validated JSON to standard out.

To start sending reports, target https://reportd.natwelch.com/reports/$yourservicename

TODO

We need to add support for the following:

Also need to add support for Reporting API v1. see migration policy https://developer.chrome.com/blog/reporting-api-migration

Analytics

This service will log the reports recieved for web-vitals. We have only tested with next.js. See https://nextjs.org/docs/advanced-features/measuring-performance and https://web.dev/vitals/ for more information.

To start sending analytics, target https://reportd.natwelch.com/analytics/$yourservicename

    <script type="module">
      import { onCLS, onINP, onLCP, onFCP, onFID, onTTFB } from 'https://unpkg.com/web-vitals@4?module';

      function sendToAnalytics(metric) {
        const body = JSON.stringify(metric);
        (navigator.sendBeacon && navigator.sendBeacon('https://reportd.natwelch.com/analytics/$yourservicename', body)) ||
          fetch('https://reportd.natwelch.com/analytics/$yourservicename', { body, method: 'POST', keepalive: true });
      }

      onCLS(sendToAnalytics);
      onFCP(sendToAnalytics);
      onFID(sendToAnalytics);
      onINP(sendToAnalytics);
      onLCP(sendToAnalytics);
      onTTFB(sendToAnalytics);
    </script>

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg
lib

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址