API reference
Web vitals
Endpoint POST /api/v1/vitals
The browser SDK sends this beacon; the format is fixed and small so it can go out with sendBeacon as text/plain without a CORS preflight.
1Request
Key in ?key= or X-Blipit-Key, optional instance. Body up to 4 KB, JSON as application/json or text/plain: path (1 to 512 characters, starts with /, no ?, # or spaces), metrics {lcp, inp, cls, fcp, ttfb} (finite, 0 to 120 s; INP up to 60 s; CLS up to 100; any subset), nav (the navigation type; route for a single-page-app route change), connection and device (known types only).
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" })
);2Responses
202 {ok: true}, or 202 {ok: true, skipped: 'bot'} for bot user agents. 400 for anything outside the shape. 401 or 403 for key problems.
Good to know
- 1,200 requests a minute per key.
- Samples are kept 30 days.
- Do not put the query string in path; ingest refuses it.
- 409 when the data comes from a different platform than the project's, for example {"error": "This project is for iOS. Create a separate Android project in Blipit and use its key.", "reason": "platform_mismatch", "project_platform": "ios", "sent_platform": "android"}. Events, sessions, logs, OTLP traces and metrics, bug reports, replays and web vitals all answer this way. Refused data is not stored and does not count against the quota. The Blipit SDKs log this error once and stop sending for the rest of the run. To fix it, create a project for that platform and use its key.
Stuck? Email support@blipit.io. Keys and the project id for each project are under API keys in app.blipit.io.