Web vitals

Endpoint POST /api/v1/vitals

De browser-SDK stuurt deze beacon; het formaat is vast en klein, zodat het met sendBeacon als text/plain kan worden verstuurd zonder CORS-preflight.

1Request

Sleutel in ?key= of X-Blipit-Key, optionele instance. Body tot 4 KB, JSON als application/json of text/plain: path (1 tot 512 tekens, begint met /, geen ?, # of spaties), metrics {lcp, inp, cls, fcp, ttfb} (eindig, 0 tot 120 s; INP tot 60 s; CLS tot 100; elke deelverzameling), nav (het navigatietype; route voor een routewijziging in een single-page-app), connection en device (alleen bekende types).

js
navigator.sendBeacon(
  "https://in.blipit.io/api/v1/vitals?key=<public key>",
  JSON.stringify({ path: "/checkout", metrics: { lcp: 1840, cls: 0.03, ttfb: 320 }, nav: "navigate", device: "mobile", connection: "4g" })
);

2Antwoorden

202 {ok: true}, of 202 {ok: true, skipped: 'bot'} voor bot-user-agents. 400 voor alles buiten de vorm. 401 of 403 bij sleutelproblemen.

Goed om te weten

  • 1.200 requests per minuut per sleutel.
  • Samples worden 30 dagen bewaard.
  • Zet de query string niet in path; ingest weigert die.

Kom je er niet uit? Mail support@blipit.io. Sleutels en de exacte DSN van elk project staan onder API-sleutels in app.blipit.io.