← Back to dashboard
lighthousemonitoringfreshReader view (for NotebookLM)

Lighthouse Monitoring Dashboard & Custom SEO Plugin

📡Lighthouse Dashboard

Pick a site → run (or view cached) Lighthouse report including the custom Kenyan Schools SEO plugin audits.

Target: https://kenyanschools.org • Realtime via Google PageSpeed Insights (Lighthouse)
performance
0
/ 100
accessibility
0
/ 100
bestPractices
0
/ 100
seo
0
/ 100
Core Web Vitals (mobile)
LCP: 0 ms
INP: n/a (field p75 from CrUX; no lab value)
CLS: 0
User Locations
Lab data
Device Types
N/A
Time Spent Proxies
TTI: N/Ams
Live data via PSI (Lighthouse 13 engine, mobile Slow 4G) or the full Chrome runner (?full=true). Four 0-100 categories shown; Agentic Browsing (Lighthouse 13.3+) is a pass ratio and PWA was removed in v12. Core Web Vitals "good" at p75: LCP ≤ 2.5 s, INP ≤ 200 ms, CLS ≤ 0.1. Custom plugin for kenyanschools.org.
Text
██╗     ██╗ ██████╗ ██╗  ██╗████████╗██╗  ██╗ ██████╗ ██╗   ██╗███████╗███████╗
██║     ██║██╔════╝ ██║  ██║╚══██╔══╝██║  ██║██╔═══██╗██║   ██║██╔════╝██╔════╝
██║     ██║██║  ███╗███████║   ██║   ███████║██║   ██║██║   ██║███████╗█████╗  
██║     ██║██║   ██║██╔══██║   ██║   ██╔══██║██║   ██║██║   ██║╚════██║██╔══╝  
███████╗██║╚██████╔╝██║  ██║   ██║   ██║  ██║╚██████╔╝╚██████╔╝███████║███████╗
╚══════╝╚═╝ ╚═════╝ ╚═╝  ╚═╝   ╚═╝   ╚═╝  ╚═╝ ╚═════╝  ╚═════╝ ╚══════╝╚══════╝

Lighthouse Monitoring Dashboard & Custom SEO Plugin

Focus: Run Google Lighthouse on demand or in CI, pick from your sites, and see scores, Core Web Vitals (lab and field) and custom domain audits. Also covers a custom Lighthouse plugin you can publish to npm, a Lighthouse CI gate with budgets, and PSI + CrUX API recipes.

Why Lighthouse in 2026

Lighthouse is the Chrome team's automated auditor. The same engine powers:

  • Chrome DevTools (Lighthouse panel). 13.5.0 is expected to ship in Chrome 156.
  • PageSpeed Insights (PSI). The changelog says each Lighthouse release reaches PSI "within 2 weeks".
  • Lighthouse CI (@lhci/cli, GitHub Actions, Vercel previews).
  • Your own Node scripts (import lighthouse from 'lighthouse').

Lighthouse measures lab data: one synthetic load on an emulated device. Google Search uses field data instead: Core Web Vitals from real Chrome users, collected by CrUX. You need both. Lab data catches regressions before merge, and field data shows what users actually get.

Versions & tooling (verified 2026-10-20)

Package / APICurrentNotes
lighthouse13.5.0 (2026-09-17)engines.node is >= 22.19 (since 13.0.0). ESM-only ("type": "module").
chrome-launcher1.2.2launches headless Chrome for Node runs
@lhci/cli0.15.1 (2025-06-25)still the latest. Bundles lighthouse 12.6.1 for its own collection runs, not 13.x.
treosh/lighthouse-ci-action12.6.2wraps @lhci/cli ^0.15.1, runs on node24
PageSpeed Insights APIv5GET https://www.googleapis.com/pagespeedonline/v5/runPagespeed
CrUX APIv1POST https://chromeuxreport.googleapis.com/v1/records:queryRecord, 150 queries/min per Cloud project, free

Node version gotcha: lighthouse@13 requires Node >= 22.19, but this monorepo's root package.json declares engines.node >= 20. That mismatch is a known latent EBADENGINE for packages/dashboard, which depends on lighthouse ^13.4.1. Run anything that imports lighthouse on Node 22.19 or later. On Vercel, set the project's Node version to 22.x or 24.x. The PSI path only needs Node 18+ (global fetch).

What changed in Lighthouse 12 → 13.5

ReleaseChange that matters
12.0.0 (2024-04-22)PWA category removed. Installability checks now live in DevTools > Application. Budgets (budget.json) removed from Lighthouse itself. SEO category reorganised: viewport and font-size moved to Best Practices, and tap-targets was replaced by target-size in Accessibility.
13.0.0 (2025-10-10)Legacy performance audits replaced by performance insights: uses-long-cache-ttl → cache-insight, third-party-summary → third-parties-insight, render-blocking-resources → render-blocking-insight, font-display → font-display-insight, uses-optimized-images → image-delivery-insight, and others. Removed offscreen-images, no-document-write, uses-passive-event-listeners, third-party-facades, uses-rel-preload, preload-fonts and font-size. Accessibility weights re-tuned. onlyCategories now errors on unknown ids. Minimum Node is 22.19.
13.1.0 (2026-04-03)Baseline compatibility audit.
13.2.0 (2026-04-30)WebMCP audits (webmcp-registered-tools, webmcp-schema-validity, webmcp-form-coverage) and an llms-txt check.
13.3.0 (2026-05-07)Agentic Browsing category added to the default config.
13.4.0 / 13.4.1Public types entrypoint, docs for the agentic audits, and the viewer enables Agentic Browsing via the PSI API.
13.5.0 (2026-09-17)ard-schema (Agent Resource Discovery) audit, stricter validation of plugin categories, and the plugin version now appears in report credits.

Categories

Category idScoredWhat it checks
performance0-100FCP, Speed Index, LCP, TBT, CLS (lab) + insights
accessibility0-100ARIA, contrast, labels, focus, target size
best-practices0-100HTTPS, console errors, deprecated APIs, viewport
seo0-100crawlability, titles, meta, hreflang, canonical, structured data
agentic-browsingpass ratio, not 0-100agent accessibility tree, CLS, llms.txt, WebMCP tool registration/schema, ARD schema. Google labels it "still under development and subject to change".

When a dashboard needs four numbers, run --only-categories=performance,accessibility,best-practices,seo. Request agentic-browsing separately and show it as "N of M checks passed".

The PSI v5 REST reference still lists only the four classic category enums. The 13.4.1 changelog, though, says the Lighthouse viewer enables agentic browsing through the PSI API. Treat agentic data from PSI as unverified until you see it in a response.

Performance score weights (Lighthouse 10–13.5)

Weights as read from default-config.js in 13.5.0:

MetricWeight
Total Blocking Time (TBT)30%
Largest Contentful Paint (LCP)25%
Cumulative Layout Shift (CLS)25%
First Contentful Paint (FCP)10%
Speed Index (SI)10%

Score bands: 90–100 good, 50–89 needs improvement, 0–49 poor.

Core Web Vitals: INP replaced FID

MetricGoodNeeds improvementPoor
LCP (loading)≤ 2.5 s≤ 4.0 s> 4.0 s
INP (responsiveness)≤ 200 ms≤ 500 ms> 500 ms
CLS (visual stability)≤ 0.1≤ 0.25> 0.25
  • Each metric is judged at the 75th percentile of page loads, split by mobile and desktop. A page passes only when all three metrics are "good".
  • INP replaced FID as the responsiveness Core Web Vital on 12 March 2024, and FID is retired. Some PSI docs samples still show FIRST_INPUT_DELAY_MS. Read INTERACTION_TO_NEXT_PAINT instead.
  • INP is field-only. A cold navigation run has no user interaction, so lab INP is empty. TBT is the lab proxy. Lighthouse timespan mode (user flows) can measure INP for a scripted interaction.

Throttling presets: US-first, Kenya 3G opt-in

These values come from lighthouse/core/config/constants.js in 13.5.0. By default Lighthouse uses simulated throttling (Lantern).

ProfileRTTThroughputCPUWhen
Mobile, Slow 4G (mobileSlow4G, the default)150 ms1,638.4 Kbps4xcodeAmani default (US-first). PSI mobile uses the same profile: Moto G Power UA, 412×823 screen.
Desktop (--preset=desktop, desktopDense4G)40 ms10,240 Kbps1xdesktop audits, 1350×940
Regular 3G (mobileRegular3G)300 ms700 Kbps4xKenya-targeted projects only. Their design target is 2G/3G Android.
Bash
# US-first default (mobile, Slow 4G)
npx lighthouse@13.5.0 https://example.com --output=json --output-path=./report.json

# Desktop
npx lighthouse@13.5.0 https://example.com --preset=desktop

# Kenya-targeted projects only: Regular 3G
npx lighthouse@13.5.0 https://example.com \
  --throttling.rttMs=300 --throttling.throughputKbps=700 --throttling.cpuSlowdownMultiplier=4

Keep one fixed profile per project so runs stay comparable. Never compare a 3G run against a Slow 4G baseline. examples/node-api-throttling.mts does the same from the Node API, with the profiles us-mobile, us-desktop and kenya-3g.

Node API (Lighthouse 13)

TypeScript
import * as chromeLauncher from 'chrome-launcher';
import lighthouse, { desktopConfig, type Flags } from 'lighthouse';

const chrome = await chromeLauncher.launch({ chromeFlags: ['--headless=new'] });
try {
  const flags: Flags = { port: chrome.port, output: 'json', logLevel: 'error',
    onlyCategories: ['performance', 'accessibility', 'best-practices', 'seo'] };
  const result = await lighthouse('https://example.com', flags /* , desktopConfig */);
  if (!result) throw new Error('no result');
  const perf = result.lhr.categories['performance']?.score; // 0..1 or null
} finally {
  chrome.kill();
}
  • For desktop, pass the built-in desktopConfig export. If you only set formFactor: 'desktop', mobile throttling and screen emulation stay in place.
  • Read the 13.x insight audits (cache-insight, third-parties-insight, lcp-breakdown-insight, and so on). An "opportunity" is now any failing audit with non-zero metricSavings. The old details.type === 'opportunity' check returns nothing.

PageSpeed Insights API (+ key)

GET https://www.googleapis.com/pagespeedonline/v5/runPagespeed?url=…&strategy=mobile|desktop&category=performance&category=seo&key=…

  • Parameters: url (required), category (repeatable: accessibility, best-practices, performance, seo), strategy, locale, utm_campaign, utm_source and captchaToken.
  • Response: lighthouseResult holds the lab result (a Lighthouse LHR). Field data comes in two CrUX blocks: loadingExperience (URL level) and originLoadingExperience (origin level). Each field p75 is at loadingExperience.metrics.<METRIC>.percentile, e.g. INTERACTION_TO_NEXT_PAINT or FIRST_CONTENTFUL_PAINT_MS.
  • Get a key: in the Google Cloud console, open APIs & Services, enable the PageSpeed Insights API, then go to Credentials and choose Create API key. Restrict the key to the PSI API, and to server IPs where you can. Send it as the key= parameter.
  • Always use a key. Keyless calls share a global per-day quota. A keyless call on 2026-10-20 returned 429 Quota exceeded … 'Queries per day'. Third-party sources cite a default of 25,000 queries/day, but Google's PSI docs don't state one, so check the Quotas page for your project.
  • A PSI run takes 10–30 s. Cache the results (the dashboard route sets max-age=300), and never call PSI from the browser with your key.

CrUX: field data

The Chrome UX Report gives real-user p75 values over a 28-day rolling window. It updates daily at around 04:00 UTC.

  • Request: POST https://chromeuxreport.googleapis.com/v1/records:queryRecord?key=… with a JSON body of { "origin" | "url", "formFactor": "PHONE" | "DESKTOP" | "TABLET", "metrics": [...] }.
  • Metrics include largest_contentful_paint, interaction_to_next_paint, cumulative_layout_shift (its p75 is encoded as a string), first_contentful_paint and experimental_time_to_first_byte.
  • Limits and errors: 150 queries/min per project, free. A 404 means the page has too little Chrome traffic. Fall back to lab data plus your own RUM.
  • A separate CrUX History API serves trend data. See the CrUX docs before relying on its shape.
  • Key: use a separate key provisioned for the Chrome UX Report API. examples/psi-crux.mts uses it to grade all three CWV against the thresholds.
  • Sites with no data: low-traffic and new sites, which describes most new codeAmani products, often have no CrUX data. Add RUM with the web-vitals library or Vercel Speed Insights, and use Lighthouse CI as the regression gate.

Lighthouse CI in GitHub Actions (SHA-pinned)

The full workflow is in examples/github/lighthouse.yml and the full config in examples/lighthouserc.cjs.

YAML
jobs:
  lhci:
    runs-on: ubuntu-latest
    permissions: { contents: read }
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
        with: { ref: "${{ github.event.pull_request.head.sha }}", fetch-depth: 20 }
      - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
        with: { node-version: 22, cache: npm }
      - run: npm ci && npm run build
      - run: npx --yes @lhci/cli@0.15.1 autorun
        env:
          LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}
  • Pinning: pin every action to a full commit SHA with the tag in a comment, and pin @lhci/cli to an exact version. To re-resolve a SHA, run gh api repos/<owner>/<repo>/commits/<tag> --jq .sha.
  • Preview URLs: to audit a deployed Vercel preview instead of localhost, use treosh/lighthouse-ci-action@3e7e23fb74242897f95c0ba9cabad3d0227b9b18 # 12.6.2 with urls:. Give it an rc file that has no collect.url and no startServerCommand.
  • LHCI audits with Lighthouse 12.6.1, not 13.x. Assertions on 13-only audit IDs (*-insight, agentic-browsing) won't match in LHCI 0.15.1. Assert on categories and core metrics, which exist in both versions.
  • Upload targets: upload.target: 'temporary-public-storage' is public, and reports are deleted after a few days. To keep history, use lhci (a self-hosted LHCI server) or filesystem.

Budgets & assertions

Lighthouse 12 removed budget.json support from Lighthouse itself, so budgets now go in LHCI assertions:

JavaScript
assert: {
  preset: 'lighthouse:recommended',
  assertions: {
    'categories:performance': ['error', { minScore: 0.9, aggregationMethod: 'median-run' }],
    'categories:seo': ['error', { minScore: 0.95 }],
    'largest-contentful-paint': ['error', { maxNumericValue: 2500 }],
    'cumulative-layout-shift': ['error', { maxNumericValue: 0.1 }],
    'total-blocking-time': ['warn', { maxNumericValue: 200 }],
    'resource-summary:script:size': ['warn', { maxNumericValue: 300000 }],
    'resource-summary:third-party:count': ['warn', { maxNumericValue: 10 }],
  },
},
  • Levels: off, warn or error.
  • Options: minScore, maxNumericValue, maxLength and aggregationMethod. The aggregation methods are optimistic (the default), pessimistic, median and median-run.
  • Presets: lighthouse:all, lighthouse:recommended and lighthouse:no-pwa. no-pwa now behaves like recommended, because PWA audits no longer exist.
  • Runs: numberOfRuns defaults to 3. Lab results vary from run to run, so gate on median-run rather than on a single run.

Environment variables

These are secrets. Keep them server-side and never put them in NEXT_PUBLIC_*:

Bash
PSI_API_KEY=your-pagespeed-insights-api-key
CRUX_API_KEY=your-crux-api-key
LHCI_GITHUB_APP_TOKEN=your-lhci-github-app-token

Non-secret settings:

SettingValueWhere
PSI endpointhttps://www.googleapis.com/pagespeedonline/v5/runPagespeedcode constant
CrUX endpointhttps://chromeuxreport.googleapis.com/v1/records:queryRecordcode constant
Default strategymobileroute / CLI flag
Throttling profileus-mobile (Kenya-targeted: kenya-3g)per-project config
Node version22.19+ for anything importing lighthouseVercel project settings / CI setup-node

The Interactive Dashboard

Use the Site Selector to pick a portfolio site (primary: kenyanschools.org) or type a custom URL, then click Run Audit (PSI). You'll see:

  • Category scores (0–100) for the four scored categories, plus radial gauges.
  • Core Web Vitals. LCP and CLS come from the lab run. INP comes from CrUX field data when PSI returns it; otherwise it's empty, because INP is field-only.
  • Custom plugin audits ("Has KSO index", "County geo present", "School JSON-LD").
  • Cache data, opportunities, a network summary, third-party usage and a history trend.

Live: https://tech-stack.codeamanilabs.org/guide/lighthouse

  • Production data path: PSI, called server-side by /api/lighthouse. Set PSI_API_KEY in the Vercel env.
  • ?full=true: runs local headless Chrome. It's for local and CI use only. Vercel has no Chrome binary, so there it falls back to PSI.

To run the same logic from the CLI: node lighthouse/examples/run-audit.js https://kenyanschools.org [--full].

Lighthouse Plugin System

A plugin is an npm package named lighthouse-plugin-* that adds audits and one category. Since 13.5.0, Lighthouse validates plugin categories strictly. Only title, description, manualDescription, auditRefs and supportedModes are allowed, and any other key throws. The official guide is at https://github.com/GoogleChrome/lighthouse/blob/main/docs/plugins.md.

JavaScript
// lighthouse-plugin-kenyan-schools/plugin.js
export default {
  audits: [
    { path: 'lighthouse-plugin-kenyan-schools/audits/school-index-present.js' },
  ],
  category: {
    title: 'Kenyan Schools SEO',
    auditRefs: [{ id: 'school-index-present', weight: 1 }],
  },
};
JavaScript
// audits/school-index-present.js
import { Audit } from 'lighthouse';

class SchoolIndexPresent extends Audit {
  static get meta() {
    return {
      id: 'school-index-present',
      title: 'Page contains unique KSO school index',
      failureTitle: 'No unique KSO index identifier found',
      description: 'The directory uses internal KSO-XXXX codes.',
      requiredArtifacts: ['MainDocumentContent'],
    };
  }
  static audit({ MainDocumentContent }) {
    const has = /KSO-\d{4}/i.test(MainDocumentContent);
    return { score: has ? 1 : 0, numericValue: has ? 1 : 0 };
  }
}
export default SchoolIndexPresent;
Bash
npx lighthouse@13.5.0 https://kenyanschools.org \
  --plugins=lighthouse-plugin-kenyan-schools \
  --only-categories=lighthouse-plugin-kenyan-schools,seo

The audits bundled in examples/audits/ are:

  • school-index-present: checks for a KSO-XXXX code.
  • county-geo-data: checks for a county name plus lat/long.
  • structured-school-data: checks for "@type": "School" JSON-LD.

Copy-paste templates (examples/)

FileWhat
run-audit.jsCLI that runs PSI (default) or local Chrome with --full, and prints insights JSON
extract-insights.jsshared PSI/Chrome → insights transform (Lighthouse 13 audit IDs, field INP) plus an SSRF guard
dashboard-server.jsExpress GET /audit that mirrors the Next.js route
node-api-throttling.mtsNode API with us-mobile / us-desktop / kenya-3g profiles
psi-crux.mtsPSI lab + CrUX field data, graded against the CWV thresholds
lighthouserc.cjsLHCI collect/assert/upload config with budgets
github/lighthouse.ymlSHA-pinned GitHub Actions workflow
plugin.js, audits/*.jscustom plugin
../reference/cheatsheet.mdversions, presets, audit renames, assertion syntax

codeAmani notes

  • Server-side keys only. PSI_API_KEY and CRUX_API_KEY live in the secrets vault or Vercel env, and only route handlers read them. The dashboard calls /api/lighthouse same-origin, so the browser never sees a Google key. Restrict both keys to their own APIs.
  • SSRF: any endpoint that audits a user-supplied URL fetches that URL server-side. Keep assertPublicUrl(), which rejects loopback, RFC1918, link-local and metadata IPs. Require auth, and prefer a hostname allowlist of sites we own.
  • US-first defaults: gate on mobile Slow 4G (the Lighthouse and PSI default) plus a desktop run. Add the kenya-3g (Regular 3G) profile as an extra CI job only for Kenya-targeted projects: the codeAmani-labs-projects/ WhatsApp + M-Pesa apps and kenyanschools.org. Those projects should also keep tight JS budgets; see AFRICAN_MARKET_GUIDE.md.
  • Payments pages: Stripe is the default rail. Stripe Checkout is hosted on Stripe's domain, so audit your own pricing and checkout-start pages, not checkout.stripe.com. For Kenya-targeted M-Pesa flows, audit the STK-push status page on 3G.
  • Supply chain: pin all Actions to SHAs and pin @lhci/cli exactly. A Lighthouse audit is a CI check, not a shipped artifact, so it doesn't need SLSA provenance. Lighthouse itself has published to npm through Trusted Publishing (OIDC) since 13.4.1.
  • AI routing: to summarise a Lighthouse report or turn insights into a fix plan, send the extracted JSON to Claude rather than the 1–3 MB raw LHR.
  • Node version: keep packages/dashboard builds on Node 22.19+. The root engines field still says >=20.
  • Agentic Browsing: an early signal for our MCP-exposed and agent-facing products (llms.txt, WebMCP). Track it as informational, and don't gate PRs on it while Google marks it "under development".

Status: Reviewed 2026-10-20 against lighthouse 13.5.0, chrome-launcher 1.2.2, @lhci/cli 0.15.1, PSI API v5 and CrUX API v1.