How it works
How it works
Onboarding a repo has three steps: Registration, wiring lighthouserc.js and adding the CI upload step. The server only has to be deployed once.
- Step 1
Deploy the server
Run apps/server as a container with a Postgres database and set LHCI_DATABASE_URL and the server basicAuth pair, LHCI_BASIC_AUTH_USERNAME and LHCI_BASIC_AUTH_PASSWORD.
- Step 2
Register the repo
lhci-toolkit register <name> creates a Project and prints its id, its Build token and its Admin token. Registration itself needs the server basicAuth pair.
- Step 3
Wire lighthouserc.js
Point upload at your server with target lhci, the Build token and upload.basicAuth. Without basicAuth the upload fails with 401, even with a valid token.
- Step 4
Add the CI step
Run npx @lhci/cli autorun with LHCI_BUILD_TOKEN, LHCI_BASIC_AUTH_USERNAME and LHCI_BASIC_AUTH_PASSWORD. Add GITHUB_TOKEN and Lighthouse CI posts its score on the pull request.
- Step 5
Compare builds
Each upload becomes a Build for that commit. The dashboard compares it against the Project’s base branch.
- Step 6
Audit the live site too
To audit a deployed URL as well, register a second Project named <repo>-live with its own no-build workflow. The server keeps one Build per Project and commit, so the two paths need separate Projects.
Keep your score history in one place you own
Deploy the server once, then onboard each repo in a few minutes.