@lubed/performance-uploader
v0.9.2
Published
Upload Lighthouse performance reports to Lube.
Readme
Lube Performance Uploader
Upload Lighthouse JSON reports to Lube from CI.
Install
npm install --save-dev @lubed/performance-uploaderUpload A Lighthouse Report
LUBE_API_KEY=mk_... npx performance-uploader upload-lighthouse \
--target perf_target_123 \
--file ./lhci/lighthouse-report.json \
--env preview \
--jsonlube-lighthouse is also published as a compatibility alias for the same command.
The CLI sends a multipart upload to:
POST /api/performance-targets/:targetId/lighthouse-runsIt uploads:
file: the raw Lighthouse JSON report.context: CI metadata such as branch, commit, repository, workflow run id, environment label, service id/name, and tested URL.
Environment Variables
LUBE_API_KEY: required API key.MERGED_API_KEYis accepted as a compatibility fallback.LUBE_API_URL: optional API base URL. Defaults tohttps://api.lube.work.MERGED_API_URLis accepted as a compatibility fallback.
Authenticated Pages
For authenticated pages, run the browser and login flow inside your CI runner, then upload the generated Lighthouse report. Lube does not need your app login credentials.
A typical workflow is:
- Use Playwright or your app's test helper to create authenticated browser state.
- Run Lighthouse against the authenticated or preview URL.
- Upload the resulting JSON with this CLI.
JSON Output
--json emits one stable JSON object on stdout:
{
"budgetStatus": null,
"cls": 0.01,
"dashboardUrl": null,
"ingestFailed": false,
"lcpMs": 2500,
"performanceScore": 0.82,
"runId": "run_123",
"summaryStatus": "warning",
"tbtMs": 180
}This shape is intended for the public GitHub Action wrapper.
