@lynxflow/seo-engine 1.5.8 → 1.5.9
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 +74 -20
- package/dist/matrix-engine.d.ts +1 -0
- package/package.json +1 -1
- package/src/matrix-engine.ts +1 -0
package/README.md
CHANGED
|
@@ -57,47 +57,101 @@ The SDK structures programmatic content across **10 canonical root pillars** exp
|
|
|
57
57
|
|
|
58
58
|
## Quickstart
|
|
59
59
|
|
|
60
|
-
### 1. Initialize Engine
|
|
60
|
+
### 1. Initialize Engine & Configure Minimal Inputs
|
|
61
|
+
|
|
62
|
+
The SDK runs **in-memory inside the client application** (< 0.05ms) and automatically provisions verified cities, populations, GPS coordinates, and currencies from its built-in global demographic database.
|
|
61
63
|
|
|
62
64
|
```typescript
|
|
63
65
|
import { PseoMatrixEngine } from "@lynxflow/seo-engine";
|
|
64
66
|
|
|
65
|
-
export const matrixEngine = new PseoMatrixEngine(
|
|
66
|
-
companyName: "Acme Cloud",
|
|
67
|
-
language: "en", // "en" default, supports "fr", "de", "es", "it", "pt", etc.
|
|
68
|
-
correctionsEmail: "compliance@acme.com",
|
|
69
|
-
});
|
|
70
|
-
```
|
|
67
|
+
export const matrixEngine = new PseoMatrixEngine();
|
|
71
68
|
|
|
72
|
-
|
|
69
|
+
export const SEO_CONFIG = {
|
|
70
|
+
brandName: "Acme Cloud",
|
|
71
|
+
languages: ["fr", "en", "es"], // Supported site languages
|
|
72
|
+
countries: ["france", "espagne", "belgique"], // Or "europe" / "international" — SDK auto-provisions verified cities!
|
|
73
|
+
cleanDirectRoutes: true, // Eliminates parasite words (/solutions/, etc.) for direct /{service}/{city}
|
|
74
|
+
};
|
|
73
75
|
|
|
74
|
-
|
|
75
|
-
const pages = matrixEngine.generateAllMatrices("https://example.com", {
|
|
76
|
+
export const PSEO_DATASET = {
|
|
76
77
|
services: [
|
|
77
|
-
{
|
|
78
|
+
{
|
|
79
|
+
slug: "autopost-facebook",
|
|
80
|
+
name: "Autopost Facebook & Instagram",
|
|
81
|
+
category: "Social Media",
|
|
82
|
+
keyFeatures: ["AI Scheduling", "Visual Calendar", "Auto-Hashtags"],
|
|
83
|
+
description: "Automated social media posting engine"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
slug: "crm-pipeline",
|
|
87
|
+
name: "Visual CRM Pipeline",
|
|
88
|
+
category: "Sales",
|
|
89
|
+
keyFeatures: ["Kanban", "Lead scoring"],
|
|
90
|
+
description: "Visual deal tracking software"
|
|
91
|
+
},
|
|
78
92
|
],
|
|
79
93
|
targets: [
|
|
80
|
-
{ slug: "
|
|
94
|
+
{ slug: "agences", name: "Marketing Agencies", type: "industry", painPoints: ["Manual Posting"], benefits: ["10x Output"] }
|
|
81
95
|
],
|
|
82
96
|
integrations: [
|
|
83
|
-
{ slug: "
|
|
97
|
+
{ slug: "shopify", name: "Shopify", category: "E-Commerce", syncFeatures: ["Catalog sync"] }
|
|
84
98
|
],
|
|
85
99
|
templates: [
|
|
86
|
-
{ slug: "
|
|
100
|
+
{ slug: "social-calendar-excel", title: "Social Media Calendar", topic: "Social Media", format: "excel", benefits: ["Free download"] }
|
|
87
101
|
],
|
|
88
102
|
glossaryTerms: [
|
|
89
|
-
{ slug: "
|
|
103
|
+
{ slug: "engagement-rate", term: "Engagement Rate", shortDefinition: "Percentage of audience interacting with content" }
|
|
90
104
|
]
|
|
91
|
-
}
|
|
105
|
+
};
|
|
106
|
+
```
|
|
92
107
|
|
|
93
|
-
|
|
94
|
-
|
|
108
|
+
### 2. Next.js Universal Dynamic Catch-All (`app/[...slug]/page.tsx`)
|
|
109
|
+
|
|
110
|
+
```tsx
|
|
111
|
+
import { notFound } from "next/navigation";
|
|
112
|
+
import { matrixEngine, SEO_CONFIG, PSEO_DATASET } from "@/lib/seo";
|
|
113
|
+
|
|
114
|
+
export async function generateMetadata({ params }: { params: { slug: string[] } }) {
|
|
115
|
+
const domain = process.env.NEXT_PUBLIC_SITE_URL || "https://example.com";
|
|
116
|
+
const page = matrixEngine.resolvePage(params.slug, domain, PSEO_DATASET, SEO_CONFIG);
|
|
117
|
+
if (!page) return {};
|
|
118
|
+
return { title: page.title, description: page.description, alternates: { canonical: page.canonicalUrl }, robots: page.robots };
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export default async function ProgrammaticPage({ params }: { params: { slug: string[] } }) {
|
|
122
|
+
const domain = process.env.NEXT_PUBLIC_SITE_URL || "https://example.com";
|
|
123
|
+
// ⚡ Resolved mathematically in local RAM in < 0.05ms
|
|
124
|
+
const page = matrixEngine.resolvePage(params.slug, domain, PSEO_DATASET, SEO_CONFIG);
|
|
125
|
+
if (!page) notFound();
|
|
126
|
+
|
|
127
|
+
return (
|
|
128
|
+
<article className="min-h-screen bg-background text-foreground py-12 px-6 max-w-5xl mx-auto space-y-8">
|
|
129
|
+
<script type="application/ld+json" dangerouslySetInnerHTML={{ __html: JSON.stringify(page.schemaGraph) }} />
|
|
130
|
+
<h1 className="text-4xl font-extrabold">{page.h1}</h1>
|
|
131
|
+
<p className="text-lg text-muted-foreground">{page.description}</p>
|
|
132
|
+
{page.neighboringLinks && (
|
|
133
|
+
<nav className="flex flex-wrap gap-2 pt-6">
|
|
134
|
+
{page.neighboringLinks.map((l) => (
|
|
135
|
+
<a key={l.url} href={l.url} className="px-3 py-1 bg-secondary rounded text-xs">{l.name}</a>
|
|
136
|
+
))}
|
|
137
|
+
</nav>
|
|
138
|
+
)}
|
|
139
|
+
</article>
|
|
140
|
+
);
|
|
141
|
+
}
|
|
95
142
|
```
|
|
96
143
|
|
|
97
|
-
### 3.
|
|
144
|
+
### 3. XML Sitemap & `/llms.txt` Feeds (1 Line of Code)
|
|
98
145
|
|
|
99
146
|
```typescript
|
|
100
|
-
|
|
147
|
+
// app/sitemap.ts
|
|
148
|
+
export default function sitemap() {
|
|
149
|
+
const domain = process.env.NEXT_PUBLIC_SITE_URL || "https://example.com";
|
|
150
|
+
return matrixEngine.generateAllMatrices(domain, PSEO_DATASET, SEO_CONFIG)
|
|
151
|
+
.filter(p => p.robots.includes("index"))
|
|
152
|
+
.map(p => ({ url: p.canonicalUrl, lastModified: new Date() }));
|
|
153
|
+
}
|
|
154
|
+
```
|
|
101
155
|
|
|
102
156
|
const slug = cleanSeoSlug("The best software for managing client invoices in 2026", { language: "en" });
|
|
103
157
|
console.log(slug); // "best-software-managing-client-invoices"
|
package/dist/matrix-engine.d.ts
CHANGED
package/package.json
CHANGED
package/src/matrix-engine.ts
CHANGED
|
@@ -156,6 +156,7 @@ export interface GeneratedPageMeta {
|
|
|
156
156
|
export interface MatrixOptions {
|
|
157
157
|
brandName: string;
|
|
158
158
|
language?: string; // Default: "en", supports "fr", "de", "es", "pt", "it", etc.
|
|
159
|
+
languages?: string[]; // Array of supported site languages (e.g. ["fr", "en", "es"])
|
|
159
160
|
countries?: string[] | string; // e.g. ["france", "spain"] or "europe" or "international"
|
|
160
161
|
territories?: string[] | string; // Alias for countries
|
|
161
162
|
cleanDirectRoutes?: boolean; // When true (default), eliminates parasite words (/solutions/, etc.) for direct /{service}/{city}
|