Ingest Web Vitals
POST
/ingest/web-vitals
const url = 'https://hitkeep.com/ingest/web-vitals';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"n":"LCP","v":1,"p":"example","nt":"example","sid":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","pid":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","tsrc":"example","tv":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://hitkeep.com/ingest/web-vitals \ --header 'Content-Type: application/json' \ --data '{ "n": "LCP", "v": 1, "p": "example", "nt": "example", "sid": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "pid": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "tsrc": "example", "tv": "example" }'Ingests opt-in Web Vitals samples from hk-vitals.js. The server resolves the site from browser Origin context, strips query strings and hashes from paths, derives standard Web Vitals ratings, and queues tenant-local persistence.
Request Body required
Section titled “Request Body required ” Media type application/json
object
n
required
Metric name.
string
v
required
Metric value. LCP, INP, FCP, and TTFB use milliseconds. CLS is unitless.
number
p
required
Browser path. Query strings and hashes are stripped server-side.
string
nt
Navigation type.
string
sid
required
string format: uuid
pid
required
string format: uuid
tsrc
string
tv
string
Responses
Section titled “ Responses ”Accepted
Invalid request
Media type application/json
object
message
string
Example generated
{ "message": "example"}