What Lighthouse Strategies Are Supported by OpenSEO? A Complete Guide to Mobile, Desktop, Auto & None
OpenSEO supports four Lighthouse strategies in two distinct categories: mobile and desktop for platform-specific audits, plus auto and none for controlling whether Lighthouse runs during site-wide audits.
OpenSEO is a modular, open-source SEO platform that integrates Google Lighthouse for performance auditing. Understanding which Lighthouse strategies the framework supports is critical for configuring accurate, representative audits across different device types and automation scenarios. According to the every-app/open-seo source code, these strategies operate across two separate layers of the architecture.
Lighthouse Result Fetching: Mobile vs. Desktop Strategies
The first category controls which device platform Lighthouse simulates when auditing a specific URL. These strategies determine browser emulation, viewport dimensions, and network conditions.
Mobile Strategy
The mobile strategy emulates a mid-tier smartphone with standard mobile network throttling. This is the default for most modern SEO workflows, as Google predominantly uses mobile-first indexing.
Desktop Strategy
The desktop strategy emulates a standard desktop browser environment with faster network conditions and larger viewport dimensions.
Both strategies are defined in src/server/lib/dataforseoLighthousePayload.ts at lines 18-19, where LighthouseStrategy is typed as a union of literal strings:
// src/server/lib/dataforseoLighthousePayload.ts
type LighthouseStrategy = "mobile" | "desktop";
Usage Example: Fetching Lighthouse Results
To run a Lighthouse audit for a specific URL with platform selection, import fetchLighthouseResult from the DataForSEO integration module:
import { fetchLighthouseResult } from "@/server/lib/dataforseo/lighthouse";
const result = await fetchLighthouseResult({
url: "https://example.com",
strategy: "mobile", // "mobile" or "desktop"
});
The implementation in src/server/lib/dataforseo/lighthouse.ts (lines 16-24) forwards this strategy directly to the DataForSEO API payload generator, which constructs the proper request body for Google's Lighthouse runtime.
Audit Configuration: Auto vs. None Strategies
The second category controls whether Lighthouse runs at all during automated site audits and how many pages receive analysis. These strategies live in a different part of the codebase to separate audit orchestration from individual result fetching.
Auto Strategy
The auto strategy intelligently selects a representative page sample: the homepage plus one page per unique URL pattern, capped at 10 pages total. This balances thoroughness with API quota efficiency.
None Strategy
The none strategy disables Lighthouse entirely, running only crawler-based checks (metadata, links, structured data) without performance metrics.
These are defined in src/server/lib/audit/types.ts at lines 9-14:
// src/server/lib/audit/types.ts
export const lighthouseStrategySchema = z.enum(["auto", "none"]);
export type LighthouseStrategy = z.infer<typeof lighthouseStrategySchema>;
Usage Example: Configuring Site-Wide Audits
Parse audit configuration JSON using the schema validator to enforce valid strategy selection:
import { parseAuditConfig } from "@/server/lib/audit/types";
const rawConfig = '{"maxPages":20,"lighthouseStrategy":"auto"}';
const config = parseAuditConfig(rawConfig);
// config.lighthouseStrategy: "auto" | "none"
The schema validation at lines 21-32 in src/server/lib/audit/types.ts ensures runtime safety, rejecting invalid strategy strings before they reach the execution layer.
Key Implementation Files
| File | Purpose |
|---|---|
src/server/lib/dataforseoLighthousePayload.ts |
Defines LighthouseStrategy type for mobile/desktop selection |
src/server/lib/audit/types.ts |
Defines audit-level LighthouseStrategy enum (auto/none) and parsing logic |
src/server/lib/audit/lighthouse.ts |
Implements page-selection algorithm respecting the auto strategy limits |
src/serverFunctions/lighthouse.ts |
Exposes API endpoints accepting both strategy types |
Strategy Selection Matrix
| Your Goal | Recommended Strategy |
|---|---|
| Audit specific URL on mobile | mobile in fetchLighthouseResult() |
| Audit specific URL on desktop | desktop in fetchLighthouseResult() |
| Automated site audit with Lighthouse sampling | auto in audit configuration |
| Skip Lighthouse, crawl-only analysis | none in audit configuration |
Summary
- OpenSEO supports four Lighthouse strategies total:
mobile,desktop,auto, andnone. - Platform strategies (
mobile/desktop) are used when fetching individual Lighthouse results viafetchLighthouseResult()insrc/server/lib/dataforseo/lighthouse.ts. - Audit strategies (
auto/none) control site-wide automation behavior, defined insrc/server/lib/audit/types.tsand enforced byparseAuditConfig(). - No single "Lighthouse strategy" type exists in the codebase—these are intentionally separated to prevent mixing platform emulation with automation configuration.
- Strategy strings are type-safe through Zod schema validation, catching configuration errors at parse time rather than runtime.
Frequently Asked Questions
Can I use mobile or desktop in the audit configuration instead of auto or none?
No. The audit configuration only accepts auto or none for lighthouseStrategy. To specify mobile vs. desktop, you must set the platform at the individual URL level when calling fetchLighthouseResult(). These are separate concerns in the OpenSEO architecture.
What happens if I set lighthouseStrategy to auto but my site has 500 pages?
OpenSEO samples a maximum of 10 pages: the homepage plus one representative page per URL pattern. The selection logic in src/server/lib/audit/lighthouse.ts prioritizes coverage diversity over total volume to stay within reasonable API quota limits.
Does the none strategy disable all SEO checks or just Lighthouse?
Only Lighthouse performance audits are disabled. The none strategy still runs all crawler-based SEO checks including title tags, meta descriptions, canonical links, heading structure, and internal link analysis. This is useful for large-scale crawls where performance metrics are not required.
Is there a way to run Lighthouse on every single page of my site?
Not through the built-in auto strategy. The 10-page cap is hardcoded for quota protection. For full-site Lighthouse coverage, you would need to iterate through your URL list and call fetchLighthouseResult() directly with your preferred platform strategy.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →