Socket
Book a DemoInstallSign in
Socket

@djangocfg/seo

Package Overview
Dependencies
Maintainers
1
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@djangocfg/seo

SEO analytics and indexing diagnostics module with Google Search Console integration and AI-ready reports

latest
Source
npmnpm
Version
2.1.107
Version published
Maintainers
1
Created
Source

@djangocfg/seo

SEO audit toolkit for Next.js App Router. Parallel execution, AI-ready split reports.

Part of DjangoCFG — modern Django framework for production-ready SaaS applications.

Two Modes

ModeTargetUse Case
Audit (HTTP)Live siteProduction SEO check, broken links, GSC data
Content (files)content/ dirMDX link validation, sitemap generation

Audit — crawls your deployed site via HTTP. Use for production audits.

Content — scans local MDX files in content/ directory. Use for Nextra/docs projects to validate links before deploy and generate sitemap.ts.

Quick Start

pnpm add @djangocfg/seo

# Full SEO audit
djangocfg-seo audit

# Scan app/ routes and compare with sitemap
djangocfg-seo routes --check

# Check broken links
djangocfg-seo links

Commands

CommandDescription
auditFull audit (robots + sitemap + crawl + links + routes + GSC)
routesScan app/ directory, compare with sitemap
crawlCrawl site, analyze meta/titles/H1
linksCheck for broken links
robotsAnalyze robots.txt
sitemapValidate sitemap.xml
inspectGSC URL inspection
content checkCheck MDX links in content/
content fixFix absolute → relative links
content sitemapGenerate sitemap.ts from content/

Options

--env, -e          prod (default) or dev
--site, -s         Site URL (overrides env)
--output, -o       Output directory (default: ./seo-reports)
--format, -f       split (default), json, markdown, ai-summary, all
--max-pages        Max pages to crawl (default: 100)
--service-account  Google service account JSON path
--app-dir          Path to app/ directory
--check            Compare routes with sitemap
--verify           Verify routes are accessible

Routes Command

Scans Next.js App Router app/ directory:

djangocfg-seo routes           # List all routes
djangocfg-seo routes --check   # Compare with sitemap
djangocfg-seo routes --verify  # Verify routes return 200

Output:

Routes found: 16
├── Static: 11
├── Dynamic: 1
└── API: 4

Sitemap comparison:
├── Matching: 8
├── Missing from sitemap: 3
└── Extra in sitemap: 50

Handles: route groups (group), dynamic [slug], catch-all [...slug], parallel @folder, private _folder.

Reports

Default split format - AI-optimized files under 1000 lines:

@reports/seo/
├── CLAUDE.md              # AI context file
├── seo-*-index.md         # Summary + links to categories
├── seo-*-technical.md     # Broken links, sitemap, robots.txt
├── seo-*-content.md       # H1, meta, titles
├── seo-*-performance.md   # Load time, TTFB
└── seo-ai-summary-*.md    # Quick overview

Google Search Console

Auto-detects gsc-key.json in project root:

  • Create service account: console.cloud.google.com
  • Download JSON key as gsc-key.json
  • Enable API: searchconsole API
  • Add service account email to GSC with Full access
  • Run audit - GSC data included automatically

Programmatic Usage

import { SiteCrawler, analyzeCrawlResults } from '@djangocfg/seo/crawler';
import { checkLinks, linkResultsToSeoIssues } from '@djangocfg/seo/link-checker';
import { scanRoutes, compareWithSitemap } from '@djangocfg/seo/routes';
import { generateAndSaveReports } from '@djangocfg/seo/reports';

// Crawl
const crawler = new SiteCrawler('https://example.com', { maxPages: 100 });
const results = await crawler.crawl();
const crawlIssues = analyzeCrawlResults(results);

// Routes
const routes = scanRoutes({ appDir: './app' });
console.log(routes.staticRoutes, routes.dynamicRoutes);

// Links
const linkResult = await checkLinks({ url: 'https://example.com' });
const linkIssues = linkResultsToSeoIssues(linkResult);

// Reports
await generateAndSaveReports('https://example.com', {
  issues: [...crawlIssues, ...linkIssues],
}, {
  outputDir: './reports',
  formats: ['split'],
});

Exports

// Main
import { SiteCrawler, checkLinks, GoogleConsoleClient } from '@djangocfg/seo';

// Submodules
import { SiteCrawler, analyzeCrawlResults } from '@djangocfg/seo/crawler';
import { checkLinks, linkResultsToSeoIssues } from '@djangocfg/seo/link-checker';
import { scanRoutes, compareWithSitemap, verifyRoutes } from '@djangocfg/seo/routes';
import { GoogleConsoleClient } from '@djangocfg/seo/google-console';
import { generateAndSaveReports } from '@djangocfg/seo/reports';
import type { SeoIssue, SeoReport, CrawlResult } from '@djangocfg/seo/types';

Issue Types

SeverityDescription
criticalBlocks indexing
errorSEO problems
warningRecommendations
infoBest practices
CategoryExamples
technicalBroken links, sitemap, robots.txt
contentMissing H1, meta description
indexingNot indexed, crawl errors
performanceSlow load time, high TTFB

Architecture

djangocfg-seo audit
    │
    ├─ robots.txt → get sitemap URLs
    │
    ├─ [PARALLEL] ─┬─ Sitemap
    │              ├─ Crawl (+ TTFB metrics)
    │              └─ Links
    │
    ├─ Routes (compare with sitemap)
    │
    └─ GSC (sc-domain:xxx)
           │
           └─ @reports/seo/

License

MIT

Keywords

seo

FAQs

Package last updated on 12 Jan 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts