@seomesh/next
v0.1.3
Published
Next.js App Router integration � sitemap, robots.txt, llms.txt, SEO audit and all seo-mesh components
Maintainers
Readme
Installation
npm install @seomesh/next
# or
pnpm add @seomesh/nextWhat's Included?
@seomesh/next re-exports all @seomesh/react components and adds Next.js-specific utilities:
Components (re-exported from React)
| Component | Description |
|-----------|-------------|
| <Product>, <Article>, <FAQPage> ... | 40+ schema.org JSON-LD components |
| <OpenGraph> | og:* and twitter:* meta tags |
| <Canonical> | <link rel="canonical"> |
| <HreflangAlternate> | Multilingual hreflang tags |
| <AiBotPolicy> | Block GPTBot, CCBot, Google-Extended |
| <Speakable> | AI summarization marker |
| <SchemaGraph> | Merge multiple schemas into @graph |
Functions
| Function | Description |
|----------|-------------|
| generateSitemap() | XML sitemap with xhtml:link alternates |
| generateRobotsTxt() | robots.txt generator |
| generateLlmsTxt() | LLM crawler standard file |
| auditPage() | SEO score 0-100 |
Usage
JSON-LD
// app/product/page.tsx
import { Product, Offer } from '@seomesh/next';
export default function Page() {
return (
<Product name="WordPress Hosting" description="NVMe SSD hosting.">
<Offer prop="offers" price={9.9} priceCurrency="USD" availability="https://schema.org/InStock" />
</Product>
);
}Sitemap
// app/sitemap.xml/route.ts
import { generateSitemap } from '@seomesh/next';
export function GET() {
return new Response(generateSitemap({
entries: [
{
url: 'https://mysite.com',
lastmod: '2026-05-15',
changefreq: 'weekly',
priority: 1.0,
alternates: [
{ lang: 'en', href: 'https://mysite.com/en' },
{ lang: 'tr', href: 'https://mysite.com/tr' },
],
},
],
}), { headers: { 'Content-Type': 'application/xml' } });
}robots.txt
// app/robots.txt/route.ts
import { generateRobotsTxt } from '@seomesh/next';
export function GET() {
return new Response(generateRobotsTxt({
rules: [
{ userAgent: '*', allow: '/', disallow: '/api/' },
{ userAgent: ['GPTBot', 'CCBot', 'Google-Extended'], disallow: '/' },
],
sitemap: 'https://mysite.com/sitemap.xml',
}), { headers: { 'Content-Type': 'text/plain' } });
}llms.txt
// app/llms.txt/route.ts
import { generateLlmsTxt } from '@seomesh/next';
export function GET() {
return new Response(generateLlmsTxt({
siteName: 'My Site',
tagline: 'What my site does',
sections: [
{ title: 'Docs', links: [{ label: 'Getting Started', url: '/docs' }] },
],
}), { headers: { 'Content-Type': 'text/plain' } });
}SEO Audit
import { auditPage } from '@seomesh/next';
const { score, passed, issues } = auditPage({
title: 'Page Title (30-60 chars)',
description: 'Meta description (120-160 chars)...',
canonical: 'https://mysite.com/page',
og: { title: '...', description: '...', image: '...', imageAlt: '...' },
schema: { '@type': 'Article', headline: '...', description: '...' },
});
// score: 95
// passed: ['Title length is optimal', 'og:title is set', ...]
// issues: [{ rule: 'og-image-alt', message: '...', impact: 'info' }]License
MIT © Mehmet Can Öztürk
