Skip to main content

Command Palette

Search for a command to run...

JavaScript SEO Audit Tool: Error Fix Your Pages

Updated
6 min read
JavaScript SEO Audit Tool: Error Fix Your Pages
M
I build websites and apps using Javascript. I love making things work fast and look great. Let's create something cool

Most SEO tools are dashboards. You click around, read a report, maybe export a CSV. But what if your SEO checks ran automatically in your CI pipeline — blocking a deploy the moment a page drops below a score threshold?

That’s exactly what a JavaScript SEO audit tool enables.

In this article, we’ll explore how to audit JavaScript-rendered pages using @power-seo/audit, a zero-dependency TypeScript library that scores pages across four categories:

  • Meta tags

  • Content quality

  • Document structure

  • Performance

No browser. No API keys. No external services. Just deterministic SEO scoring in Node.js.

Why SEO auditing needs to be code-driven

Traditional SEO tools like Screaming Frog or Ahrefs are excellent for manual audits, but they don’t fit modern engineering workflows.

They fail in key scenarios like:

  • Template changes affecting hundreds of pages

  • Missing canonical tags introduced by a deployment

  • JavaScript-rendered content behaving differently for crawlers

  • Late detection of SEO regressions (weeks after release)

JavaScript SEO is especially complex because frameworks like React, Vue, and Next.js can serve different HTML depending on hydration and rendering behavior.

A programmatic approach solves this by running audits in a controlled environment where input and output are fully deterministic.

Core idea behind a JavaScript SEO audit tool

A JavaScript SEO audit tool maps SEO into four measurable systems:

  • Meta signals (titles, descriptions, canonicals)

  • Content quality (depth, keywords, readability)

  • Structure (headings, links, schema)

  • Performance signals (assets, optimization hints)

These directly reflect how search engines evaluate page quality.

Installation

npm install @power-seo/audit
# or
pnpm add @power-seo/audit

Zero runtime dependencies. Works across Node.js, Vercel Edge, Cloudflare Workers, and Deno.

Auditing a single page

The core function is auditPage(input).

It accepts structured data instead of raw HTML, making results consistent across frameworks.

import { auditPage } from '@power-seo/audit';

const result = auditPage({
  url: 'https://example.com/blog/react-seo-guide',
  title: 'React SEO Guide — Best Practices for 2026',
  metaDescription:
    'Learn how to optimize React applications for search engines with meta tags, structured data, and Core Web Vitals improvements.',
  canonical: 'https://example.com/blog/react-seo-guide',
  robots: 'index, follow',
  content: '<h1>React SEO Guide</h1><p>Search engine optimization for React apps...</p>',
  headings: ['h1:React SEO Guide', 'h2:Why SEO Matters for React', 'h2:Meta Tags in React'],
  images: [{ src: '/hero.webp', alt: 'React SEO guide illustration' }],
  internalLinks: ['/blog', '/docs/meta-tags'],
  externalLinks: ['https://developers.google.com/search'],
  focusKeyphrase: 'react seo',
  wordCount: 1850,
});

console.log(result.score); // e.g. 84
console.log(result.categories);

Example score breakdown

  • Overall: 84

  • Meta: 90

  • Content: 82

  • Structure: 74

A low structure score often indicates missing alt text, broken heading hierarchy, or poor internal linking.

Full real-world implementation

Below is a complete working example of how a JavaScript SEO audit tool evaluates a page:

import { auditPage } from '@power-seo/audit';

const result = auditPage({
  url: 'https://example.com/blog/react-seo-guide',
  title: 'React SEO Guide — Best Practices for 2026',
  metaDescription:
    'Learn how to optimize React applications for search engines with meta tags, structured data, and Core Web Vitals improvements.',
  canonical: 'https://example.com/blog/react-seo-guide',
  robots: 'index, follow',
  content: '<h1>React SEO Guide</h1><p>Search engine optimization for React apps...</p>',
  headings: ['h1:React SEO Guide', 'h2:Why SEO Matters for React', 'h2:Meta Tags in React'],
  images: [{ src: '/hero.webp', alt: 'React SEO guide illustration' }],
  internalLinks: ['/blog', '/docs/meta-tags'],
  externalLinks: ['https://developers.google.com/search'],
  focusKeyphrase: 'react seo',
  wordCount: 1850,
});

console.log(result.score); // e.g. 84
console.log(result.categories);
// { meta: { score: 90, passed: 9, warnings: 1, errors: 0 }, ... }

Understanding rule output

Each audit produces a rules array containing every check.

Severity levels:

  • pass → rule satisfied

  • warning → needs improvement

  • error → critical SEO issue

  • info → optimization opportunity

Example:

  • Title length → pass

  • Meta description too long → warning

  • Missing image alt text → error

  • No preconnect hints → info

Priority order:

  1. Fix errors

  2. Fix warnings

  3. Improve info items

Running selective rule sets

You don’t always need a full audit.

import {
  runMetaRules,
  runContentRules,
  runStructureRules,
  runPerformanceRules,
} from '@power-seo/audit';

// Only check meta tags — title, description, canonical, robots, Open Graph
const metaRules = runMetaRules(input);
const errors = metaRules.filter(r => r.severity === 'error');
console.log(`${errors.length} critical meta issues found`);

This is ideal for CMS validation or pre-save hooks.

Site-wide SEO audit

For multiple pages, use auditSite():

import { auditSite } from '@power-seo/audit';

const report = auditSite({ pages: [page1Input, page2Input, page3Input] });

console.log(`Average score: ${report.score}/100`);
console.log(`Pages audited: ${report.totalPages}`);

report.topIssues.forEach(({ id, title, severity }) => {
  console.log(`  [\({severity}] \){title}`);
});

report.pageResults.forEach(({ url, score }) => {
  console.log(`\({url}: \){score}/100`);
});

This helps identify:

  • Template-level SEO issues

  • Repeated structural problems

  • Site-wide optimization gaps

CI/CD integration (blocking bad deployments)

This is where a JavaScript SEO audit tool becomes powerful.

// scripts/seo-audit.ts
import { auditSite } from '@power-seo/audit';
import { pages } from './test-pages.js';

const report = auditSite({ pages });

const SCORE_THRESHOLD = 75;
const ALLOWED_ERRORS = 0;

const totalErrors = report.pageResults
  .flatMap(p => p.rules.filter(r => r.severity === 'error'))
  .length;

if (report.score < SCORE_THRESHOLD || totalErrors > ALLOWED_ERRORS) {
  console.error('SEO audit FAILED');
  console.error(`  Average score: \({report.score} (min: \){SCORE_THRESHOLD})`);
  console.error(`  Critical errors: \({totalErrors} (max: \){ALLOWED_ERRORS})`);
  process.exit(1);
}

console.log(`SEO audit PASSED — average score: ${report.score}/100`);

This ensures:

  • No missing canonicals ship to production

  • No empty meta descriptions

  • No broken heading structures

What the tool checks

Meta rules

  • Title length (50–60 chars)

  • Meta description (120–158 chars)

  • Canonical validity

  • Robots directives

  • Open Graph completeness

Content rules

  • Word count thresholds

  • Keyword presence

  • Readability scoring

Structure rules

  • Single H1 enforcement

  • Proper heading hierarchy

  • Image alt completeness

  • Link structure validation

  • JSON-LD schema checks

Performance rules

  • Image optimization formats

  • Missing width/height

  • Resource hints (preload/preconnect)

  • Third-party script efficiency

TypeScript types

import type {
  AuditCategory,
  AuditSeverity,
  AuditRule,
  PageAuditInput,
  PageAuditResult,
  CategoryResult,
  SiteAuditInput,
  SiteAuditResult,
} from '@power-seo/audit';

Full type safety ensures autocomplete across the entire SEO pipeline.

Wrapping up

A JavaScript SEO audit tool transforms SEO from a manual process into an automated engineering system.

With @power-seo/audit, you can:

  • Score pages programmatically

  • Enforce SEO rules in CI/CD

  • Catch regressions before deployment

  • Standardize SEO quality across your entire app

The biggest win is simple: you stop shipping broken SEO in the first place.

From there, you can extend into dashboards, CMS integrations, and per-route SEO validation inside frameworks like Next.js or Remix.

More from this blog

P

Power SEO Free Tool

30 posts