@consilioweb/payload-seo-analyzer 1.9.0 → 1.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +42 -0
- package/dist/client.cjs +655 -85
- package/dist/client.js +655 -85
- package/dist/index.cjs +1064 -211
- package/dist/index.d.cts +111 -3
- package/dist/index.d.ts +111 -3
- package/dist/index.js +1059 -212
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -631,6 +631,8 @@ All endpoints are prefixed with the configured `endpointBasePath` (default: `/se
|
|
|
631
631
|
| `GET` | `/indexation-audit` | Cross-page indexation hygiene — surfaces every `noindex` / canonical problem in one place |
|
|
632
632
|
| `GET` | `/core-web-vitals` | Real LCP/INP/CLS via PageSpeed Insights — informational, on-demand, SSRF-safe (own origin only) |
|
|
633
633
|
| `GET` `POST` | `/gsc/*` | Google Search Console OAuth (opt-in `features.gscApi`): `status`, `auth`, `callback`, `data`, `disconnect` |
|
|
634
|
+
| `POST` `GET` | `/rank-snapshot` `/rank-history` | Rank tracking (opt-in `features.gscApi`) — daily GSC position snapshots + movement over time |
|
|
635
|
+
| `GET` `POST` | `/alerts-digest` `/alerts-run` | Monitoring digest (opt-in `features.alerts`) — score regressions, new 404s, ranking drops via webhook/email |
|
|
634
636
|
| `GET` | `/history` | Score history data for trend charts |
|
|
635
637
|
| `GET` | `/sitemap-audit` | Sitemap structure audit |
|
|
636
638
|
| `GET` `PATCH` | `/settings` | Read or update SEO settings |
|
|
@@ -640,6 +642,7 @@ All endpoints are prefixed with the configured `endpointBasePath` (default: `/se
|
|
|
640
642
|
| `POST` | `/ai-generate` | Heuristic meta title/description generation (no API key needed) |
|
|
641
643
|
| `POST` | `/ai-rewrite` | Rewrite a single meta field (Claude if `ANTHROPIC_API_KEY` set, else heuristic) |
|
|
642
644
|
| `POST` | `/ai-optimize` | **AI SEO Optimize** — scan a page, propose optimized meta (Claude Opus 4.8 by default), server-validated; applied in one click from the sidebar |
|
|
645
|
+
| `GET` `POST` | `/alt-text-audit` `/ai-alt-text` | **AI image alt-text** (Claude vision, `features.aiFeatures`) — list images missing alt, generate + apply |
|
|
643
646
|
| `GET` | `/cannibalization` | Detect keyword cannibalization |
|
|
644
647
|
| `POST` | `/external-links` | Check external link status (live HTTP checks with SSRF protection) |
|
|
645
648
|
| `GET` | `/sitemap-config` | Sitemap configuration data |
|
|
@@ -668,6 +671,45 @@ Scope is **meta only** by design: the SEO 2026 analysis classifies mass AI-gener
|
|
|
668
671
|
|
|
669
672
|
The endpoint is gated behind `features.aiFeatures` (default `true`). Suggestions are **validated/clamped server-side** (title ≤ 70, description ≤ 160, focus keyword only filled when empty) so what gets applied is always rule-compliant, regardless of the model's output.
|
|
670
673
|
|
|
674
|
+
### AI image alt-text (`/ai-alt-text`)
|
|
675
|
+
|
|
676
|
+
Generate the `alt` attribute for images that lack one (accessibility + SEO) using **Claude vision**. The Performance view lists media missing alt; for each image you **Generate**, review/edit, then **Apply** in one click. Gated by `features.aiFeatures`; uses `ANTHROPIC_API_KEY` and `SEO_AI_MODEL` (default `claude-opus-4-8`). Images are fetched server-side and must be on the site origin (or `SEO_MEDIA_ORIGIN`) — SSRF-safe.
|
|
677
|
+
|
|
678
|
+
### Rank tracking & monitoring alerts
|
|
679
|
+
|
|
680
|
+
- **Rank tracking** (opt-in `features.gscApi`): once Google Search Console is connected, the plugin snapshots **daily query positions** into `seo-rank-history` and shows **movement over time** in the Performance view. No extra setup beyond GSC.
|
|
681
|
+
- **Monitoring alerts** (opt-in `features.alerts`): a periodic digest (default daily) reports **score regressions**, **new 404s** and **ranking drops** via **webhook and/or email**. Configure delivery with env vars:
|
|
682
|
+
|
|
683
|
+
| Env var | Default | Purpose |
|
|
684
|
+
|---|---|---|
|
|
685
|
+
| `SEO_ALERT_WEBHOOK_URL` | — | POST the digest JSON to this URL (Slack/Discord/automation). |
|
|
686
|
+
| `SEO_ALERT_EMAIL` | — | Comma-separated recipients (uses Payload's email adapter). |
|
|
687
|
+
| `SEO_ALERT_SCORE_DROP` | `10` | Minimum score drop to report. |
|
|
688
|
+
| `SEO_ALERT_POSITION_DROP` | `5` | Minimum SERP positions lost to report. |
|
|
689
|
+
| `SEO_ALERT_INTERVAL_HOURS` | `24` | Digest frequency. |
|
|
690
|
+
|
|
691
|
+
### Frontend render helpers — produce the SEO, not just grade it
|
|
692
|
+
|
|
693
|
+
Pure, dependency-free helpers to output the actual `<head>` metadata + JSON-LD from a Payload document, e.g. in a Next.js route:
|
|
694
|
+
|
|
695
|
+
```ts
|
|
696
|
+
import { buildSeoMetadata, buildJsonLd } from '@consilioweb/payload-seo-analyzer'
|
|
697
|
+
|
|
698
|
+
export async function generateMetadata({ params }) {
|
|
699
|
+
const doc = await payload.findByID({ collection: 'pages', id, depth: 1 })
|
|
700
|
+
return buildSeoMetadata(doc, { collection: 'pages', siteName: 'My Site', siteUrl: 'https://example.com' })
|
|
701
|
+
// → { title, description, alternates: { canonical, languages }, robots, openGraph, twitter }
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
// In a Server Component, render the JSON-LD:
|
|
705
|
+
function PageJsonLd({ doc }) {
|
|
706
|
+
const { jsonLd } = buildJsonLd(doc, { collection: 'pages' })
|
|
707
|
+
return <script type="application/ld+json" dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }} />
|
|
708
|
+
}
|
|
709
|
+
```
|
|
710
|
+
|
|
711
|
+
`buildSeoMetadata` returns a structural subset of Next's `Metadata` (assignable to it). `buildJsonLd` reuses the exact builders behind the admin schema generator (Article, Product, LocalBusiness, FAQPage, BreadcrumbList, Organization, Person, Event, Recipe, Video). Also exported: `renderJsonLdScript`, `detectSchemaType`, `getSchemaImageUrl`, `SCHEMA_TYPES`.
|
|
712
|
+
|
|
671
713
|
### Low-memory hosting (e.g. Infomaniak)
|
|
672
714
|
|
|
673
715
|
The site-wide audit (`/admin/seo` dashboard) is the heaviest operation. On constrained shared Node hosting it is built **single-flight, in the background**: the first uncached load returns `202` and the dashboard shows a “generating…” state while it computes, then polls until ready — it never blocks or OOM-kills the process. Tune it via env vars if needed:
|