@consilioweb/payload-seo-analyzer 1.9.0 → 1.11.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 +46 -0
- package/dist/client.cjs +902 -85
- package/dist/client.js +902 -85
- package/dist/index.cjs +1431 -225
- package/dist/index.d.cts +114 -3
- package/dist/index.d.ts +114 -3
- package/dist/index.js +1435 -235
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -631,8 +631,11 @@ 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 |
|
|
638
|
+
| `GET` | `/sitemap.xml` `/sitemap-news.xml` `/sitemap-images.xml` `/sitemap-video.xml` | XML sitemaps (public) — standard + Google News (48h) + image + video |
|
|
636
639
|
| `GET` `PATCH` | `/settings` | Read or update SEO settings |
|
|
637
640
|
| `POST` | `/suggest-links` | Internal link suggestions for a page |
|
|
638
641
|
| `POST` | `/create-redirect` | Create a single redirect entry |
|
|
@@ -640,6 +643,8 @@ All endpoints are prefixed with the configured `endpointBasePath` (default: `/se
|
|
|
640
643
|
| `POST` | `/ai-generate` | Heuristic meta title/description generation (no API key needed) |
|
|
641
644
|
| `POST` | `/ai-rewrite` | Rewrite a single meta field (Claude if `ANTHROPIC_API_KEY` set, else heuristic) |
|
|
642
645
|
| `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 |
|
|
646
|
+
| `GET` `POST` | `/alt-text-audit` `/ai-alt-text` | **AI image alt-text** (Claude vision, `features.aiFeatures`) — list images missing alt, generate + apply |
|
|
647
|
+
| `POST` | `/ai-content-brief` | **AI content brief** (`features.aiFeatures`) — outline, entities, questions, word count for a keyword |
|
|
643
648
|
| `GET` | `/cannibalization` | Detect keyword cannibalization |
|
|
644
649
|
| `POST` | `/external-links` | Check external link status (live HTTP checks with SSRF protection) |
|
|
645
650
|
| `GET` | `/sitemap-config` | Sitemap configuration data |
|
|
@@ -668,6 +673,47 @@ Scope is **meta only** by design: the SEO 2026 analysis classifies mass AI-gener
|
|
|
668
673
|
|
|
669
674
|
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
675
|
|
|
676
|
+
### AI image alt-text (`/ai-alt-text`)
|
|
677
|
+
|
|
678
|
+
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.
|
|
679
|
+
|
|
680
|
+
### Rank tracking & monitoring alerts
|
|
681
|
+
|
|
682
|
+
- **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.
|
|
683
|
+
- **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:
|
|
684
|
+
|
|
685
|
+
| Env var | Default | Purpose |
|
|
686
|
+
|---|---|---|
|
|
687
|
+
| `SEO_ALERT_WEBHOOK_URL` | — | POST the digest JSON to this URL (Slack/Discord/automation). |
|
|
688
|
+
| `SEO_ALERT_EMAIL` | — | Comma-separated recipients (uses Payload's email adapter). |
|
|
689
|
+
| `SEO_ALERT_SCORE_DROP` | `10` | Minimum score drop to report. |
|
|
690
|
+
| `SEO_ALERT_POSITION_DROP` | `5` | Minimum SERP positions lost to report. |
|
|
691
|
+
| `SEO_ALERT_INTERVAL_HOURS` | `24` | Digest frequency. |
|
|
692
|
+
|
|
693
|
+
### Frontend render helpers — produce the SEO, not just grade it
|
|
694
|
+
|
|
695
|
+
Pure, dependency-free helpers to output the actual `<head>` metadata + JSON-LD from a Payload document, e.g. in a Next.js route:
|
|
696
|
+
|
|
697
|
+
```ts
|
|
698
|
+
import { buildSeoMetadata, buildJsonLd } from '@consilioweb/payload-seo-analyzer'
|
|
699
|
+
|
|
700
|
+
export async function generateMetadata({ params }) {
|
|
701
|
+
const doc = await payload.findByID({ collection: 'pages', id, depth: 1 })
|
|
702
|
+
return buildSeoMetadata(doc, { collection: 'pages', siteName: 'My Site', siteUrl: 'https://example.com' })
|
|
703
|
+
// → { title, description, alternates: { canonical, languages }, robots, openGraph, twitter }
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
// In a Server Component, render the JSON-LD:
|
|
707
|
+
function PageJsonLd({ doc }) {
|
|
708
|
+
const { jsonLd } = buildJsonLd(doc, { collection: 'pages' })
|
|
709
|
+
return <script type="application/ld+json" dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }} />
|
|
710
|
+
}
|
|
711
|
+
```
|
|
712
|
+
|
|
713
|
+
`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`.
|
|
714
|
+
|
|
715
|
+
**Multi-location local SEO**: give a document a `locations[]` array (each with `name`, `address`, `geo: { latitude, longitude }`, `openingHours`, `priceRange`) and `buildJsonLd(doc, { type: 'LocalBusiness' })` emits a `@graph` of `LocalBusiness` nodes — one per establishment.
|
|
716
|
+
|
|
671
717
|
### Low-memory hosting (e.g. Infomaniak)
|
|
672
718
|
|
|
673
719
|
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:
|