Skip to main content
Api Doc

Configuration Reference

Use defineUnlighthouseConfig from unlighthouse/config for typed project config.

Root options

OptionPurpose
siteBase site URL. Supply it alongside URL provider functions.
rootProject root for config lookup and relative paths.
configFileConfig filename or path.
outputPathDirectory for scan storage and exports.
cachePreserve output, or reset it when false.
debugEnable debug logging.
urlsExplicit URLs or a URL provider function. Disables link following.
lighthouseOptionsLighthouse audit flags.
extraHeadersHeaders for fetch helpers and Lighthouse.
authBasic-auth username and password.
defaultQueryParamsQuery parameters for fetch helpers.

Scanner

OptionPurpose
scanner.deviceMobile or desktop for a single-device config.
scanner.samplesAudit repetitions, from 1 to 10. Keeps the median run.
scanner.perfConcurrencySerial performance audits by default, or parallel audits with contended scores.
scanner.include and scanner.excludeURL path filters.
scanner.maxRoutesMaximum route count.
scanner.modeSite scan or single-page scan.
scanner.crawlerStop following links when false.
scanner.sitemapEnable sitemap discovery, disable it, or supply sitemap URLs.
scanner.ignoreI18nPagesSkip localized duplicates with an x-default alternate URL.
scanner.throttleControl the resolved Lighthouse throttling profile.

JavaScript link discovery, dynamic sampling, custom sampling, and legacy robots.txt rules do not control the v1 pipeline. See URL Discovery for supported routes.

Route definitions

import { defineUnlighthouseConfig } from 'unlighthouse/config'

export default defineUnlighthouseConfig({
  site: 'https://example.com',
  routeDefinitions: { framework: 'nuxt', pagesDir: 'pages', extensions: ['vue', 'md'] },
})

framework accepts nuxt or next. Replace legacy discovery settings with this option.

CI

OptionPurpose
ci.budgetGlobal or category score budget, using percentages.
ci.reporterJSON, expanded JSON, CSV, expanded CSV, or false.
ci.reporterConfig.columnsColumn arrays for expanded CSV. Takes precedence over client.columns.
ci.buildStaticGenerate a static dashboard after the scan.
ci.assertionsAssertions evaluated by the CI runner.

An explicit reporter flag overrides the configured reporter. Exports include a device value for each route result.

Authentication

localStorage, sessionStorage, and indexedDb seed the local Lighthouse browser. cookies applies to fetch helpers, but does not seed that browser. The HTML crawler does not receive authentication headers. See Authentication before scanning protected pages.

Removed runtime customization

Register supported events on host.hooks, rather than config-file hooks. Use the host factory callback onResolvedConfig before initialization. puppeteerOptions and puppeteerClusterOptions do not configure the local auditor. See Migrating to v1 for the supported replacements.

Did this page help you?
Anything that could be done better? :)
Help us improve this page. You can edit this page on GitHub or provide anonymous feedback below.