Service for retrieving SEO-related files (sitemap, robots.txt, LLM-optimized content, and individual Markdown exports).
Accessible via lynkow.seo. All methods return plain text (XML, TXT, or Markdown)
and are NOT cached by the SDK since they are typically served as route handlers
with their own HTTP caching headers.
Access via: lynkow.seo
Methods
6 methods
getMarkdown
getMarkdown(contentPath: string, options?: BaseRequestOptions): Promise<string>Retrieves a single content article or page as Markdown by its public URL path.
The SDK appends .md to the path automatically. This is useful for exposing
individual content items to LLMs or for Markdown-based rendering pipelines.
Parameter | Type | Description |
|---|---|---|
|
| The content's public URL path (must start with |
|
| Request options (custom fetch options) |
Returns: Promise<string>
// Get a blog article as Markdown (path includes locale automatically)
const article = await lynkow.contents.getBySlug('my-article')
const md = await lynkow.seo.getMarkdown(article.path)
// Get a page as Markdown (mono-language)
const page = await lynkow.pages.getBySlug('about')
const md = await lynkow.seo.getMarkdown(page.path!)
// Get a page as Markdown (multi-language — prepend locale)
const page = await lynkow.pages.getBySlug('about')
const md = await lynkow.seo.getMarkdown(`/${page.locale}${page.path}`)
// In a Next.js catch-all route handler
export async function GET(req: Request) {
const url = new URL(req.url)
const path = url.pathname.replace(/\.md$/, '')
const md = await lynkow.seo.getMarkdown(path)
return new Response(md, {
headers: { 'Content-Type': 'text/markdown; charset=utf-8' }
})
}llmsFullTxt
llmsFullTxt(options?: BaseRequestOptions): Promise<string>Retrieves the llms-full.txt file, which concatenates all published articles and pages into a single Markdown document. Useful for AI/LLM ingestion of the site's full content. Can be large for sites with many articles. Supports locale-specific versions for multilingual sites.
Parameter | Type | Description |
|---|---|---|
|
| Request options:<br> - |
Returns: Promise<string>
// In a Next.js route handler (app/llms-full.txt/route.ts)
export async function GET() {
const md = await lynkow.seo.llmsFullTxt()
return new Response(md, {
headers: { 'Content-Type': 'text/plain; charset=utf-8' }
})
}llmsTxt
llmsTxt(options?: BaseRequestOptions): Promise<string>Retrieves the llms.txt file, an LLM-optimized site index in Markdown format. This file provides a structured overview of the site's content, designed for AI crawlers and language models to understand the site's structure. Supports locale-specific versions for multilingual sites.
Parameter | Type | Description |
|---|---|---|
|
| Request options:<br> - |
Returns: Promise<string>
// In a Next.js route handler (app/llms.txt/route.ts)
export async function GET() {
const md = await lynkow.seo.llmsTxt()
return new Response(md, {
headers: { 'Content-Type': 'text/plain; charset=utf-8' }
})
}
// Fetch the French version
const md = await lynkow.seo.llmsTxt({ locale: 'fr' })robots
robots(options?: BaseRequestOptions): Promise<string>Retrieves the generated robots.txt file for the site, including
crawl directives and sitemap references. Typically served as a
route handler with Content-Type: text/plain.
Parameter | Type | Description |
|---|---|---|
|
| Request options (custom fetch options) |
Returns: Promise<string>
// In a Next.js route handler (app/robots.txt/route.ts)
export async function GET() {
const txt = await lynkow.seo.robots()
return new Response(txt, {
headers: { 'Content-Type': 'text/plain' }
})
}sitemap
sitemap(options?: BaseRequestOptions): Promise<string>Retrieves the complete XML sitemap for the site. If the site uses Sitemap
Index mode, this returns the index file pointing to individual parts.
Typically served as a route handler with Content-Type: application/xml.
Parameter | Type | Description |
|---|---|---|
|
| Request options (custom fetch options) |
Returns: Promise<string>
// In a Next.js route handler (app/sitemap.xml/route.ts)
export async function GET() {
const xml = await lynkow.seo.sitemap()
return new Response(xml, {
headers: { 'Content-Type': 'application/xml' }
})
}sitemapPart
sitemapPart(part: number, options?: BaseRequestOptions): Promise<string>Retrieves a specific sitemap part when Sitemap Index mode is enabled. Each part contains a subset of URLs, useful for large sites that exceed the 50,000 URL limit per sitemap file.
Parameter | Type | Description |
|---|---|---|
|
| The 1-indexed part number (e.g. |
|
| Request options (custom fetch options) |
Returns: Promise<string>
// In a Next.js dynamic route handler (app/sitemap-[part].xml/route.ts)
export async function GET(req: Request, { params }: { params: { part: string } }) {
const xml = await lynkow.seo.sitemapPart(parseInt(params.part))
return new Response(xml, {
headers: { 'Content-Type': 'application/xml' }
})
}