Examples

The Simplist SDK provides powerful SEO tools to improve your content's search engine visibility. Generate sitemaps, RSS feeds, and structured data with minimal code.

MethodDescriptionReturns
Get SEO metadata for an articleArticleWithSeo
Generate sitemap (XML/JSON)string | Sitemap
Generate RSS 2.0 feedstring
Get JSON-LD structured dataStructuredDataResponse

Configure article URL paths once when creating the client, instead of repeating them in every SEO method call.

client-with-path.ts
import { SimplistClient } from "@simplist.blog/sdk"

const client = new SimplistClient({
  apiKey: process.env.SIMPLIST_API_KEY,
  path: 'blog'  // Articles will use: /blog/article-slug
})

// Now all SEO methods automatically use 'blog/' prefix
const sitemap = await client.seo.getSitemap('https://myblog.com', 'xml')
// Generates URLs like: https://myblog.com/blog/article-slug

Fetch complete SEO metadata for a specific article.

get-seo.ts
const article = await client.seo.getArticle(
  'my-article-slug',
  'https://myblog.com'
)

console.log(article.seo.metaTitle)
console.log(article.seo.metaDescription)
console.log(article.seo.ogImage)
console.log(article.seo.structuredData)

PropertyTypeDescriptionDefault
metaTitle*stringPage title for search results-
metaDescription*stringPage description for search results-
ogTitlestringOpen Graph title-
ogDescriptionstringOpen Graph description-
ogImagestringOpen Graph image URL-
ogType*stringOpen Graph type (article, website)-
twitterTitlestringTwitter card title-
twitterDescriptionstringTwitter card description-
twitterImagestringTwitter card image-
twitterCard*'summary' | 'summary_large_image'Twitter card type-
canonicalUrlstringCanonical URL-
structuredDataRecord<string, any>JSON-LD structured data-
keywordsstring[]Article keywords-
language*stringContent language-
authorstringAuthor name-
publishedTimestringPublication timestamp-
modifiedTimestringLast modified timestamp-
readingTimenumberReading time in minutes-

Perfect for Next.js generateMetadata:

article-page.tsx
import { SimplistClient } from "@simplist.blog/sdk"
import { Metadata } from "next"

// Uses SIMPLIST_API_KEY from environment variables
const client = new SimplistClient()

export async function generateMetadata({ params }: {
  params: { slug: string }
}): Promise<Metadata> {
  const article = await client.seo.getArticle(
    params.slug,
    'https://myblog.com'
  )

  const { seo } = article

  return {
    title: seo.metaTitle,
    description: seo.metaDescription,
    keywords: seo.keywords,
    authors: seo.author ? [{ name: seo.author }] : undefined,
    openGraph: {
      title: seo.ogTitle,
      description: seo.ogDescription,
      images: seo.ogImage ? [seo.ogImage] : undefined,
      type: seo.ogType as any,
      publishedTime: seo.publishedTime,
      modifiedTime: seo.modifiedTime,
      locale: seo.language
    },
    twitter: {
      card: seo.twitterCard,
      title: seo.twitterTitle,
      description: seo.twitterDescription,
      images: seo.twitterImage ? [seo.twitterImage] : undefined
    },
    alternates: {
      canonical: seo.canonicalUrl
    }
  }
}

export default async function ArticlePage({ params }: {
  params: { slug: string }
}) {
  const article = await client.seo.getArticle(
    params.slug,
    'https://myblog.com'
  )

  return (
    <article>
      <h1>{article.title}</h1>
      <div dangerouslySetInnerHTML={{ __html: article.content }} />
    </article>
  )
}

Create XML or JSON sitemaps for search engines.

sitemap-route.ts
// app/sitemap.xml/route.ts (Next.js App Router)
import { SimplistClient } from "@simplist.blog/sdk"

// Uses SIMPLIST_API_KEY from environment variables
const client = new SimplistClient()

export async function GET() {
  const sitemapXml = await client.seo.getSitemap(
    'https://myblog.com',
    'xml'
  )

  return new Response(sitemapXml, {
    headers: {
      'Content-Type': 'application/xml',
      'Cache-Control': 'public, max-age=3600'
    }
  })
}

Get sitemap data programmatically:

json-sitemap.ts
const sitemap = await client.seo.getSitemap(
  'https://myblog.com',
  'json'
)

console.log(`Generated at: ${sitemap.generatedAt}`)
console.log(`Total pages: ${sitemap.entries.length}`)

sitemap.entries.forEach(entry => {
  console.log(`URL: ${entry.url}`)
  console.log(`Last Modified: ${entry.lastModified}`)
  console.log(`Priority: ${entry.priority}`)
  console.log(`Change Frequency: ${entry.changeFrequency}`)
})

Override the global path or specify paths per-call:

custom-path.ts
// Using global path (set in client config)
const client = new SimplistClient({
  path: 'blog'  // Articles at /blog/slug
})

const sitemap = await client.seo.getSitemap('https://myblog.com', 'xml')
// Generates: https://myblog.com/blog/article-slug

// Override with custom path
const sitemap2 = await client.seo.getSitemap(
  'https://myblog.com',
  'xml',
  'articles'  // Override to /articles/slug
)
// Generates: https://myblog.com/articles/article-slug

sitemap-entry.ts
{
  url: 'https://myblog.com/articles/my-article',
  lastModified: '2025-12-08T10:30:00Z',
  changeFrequency: 'weekly',
  priority: 0.8
}

Create RSS 2.0 feeds for syndication.

rss-route.ts
// app/rss.xml/route.ts (Next.js App Router)
import { SimplistClient } from "@simplist.blog/sdk"

// Uses SIMPLIST_API_KEY from environment variables
const client = new SimplistClient()

export async function GET() {
  const rssXml = await client.seo.getRssFeed(
    'https://myblog.com',
    20  // Include 20 latest articles
  )

  return new Response(rssXml, {
    headers: {
      'Content-Type': 'application/rss+xml',
      'Cache-Control': 'public, max-age=3600'
    }
  })
}

rss-custom-path.ts
// Using global path
const client = new SimplistClient({
  path: 'posts'
})

const rss = await client.seo.getRssFeed('https://myblog.com', 20)
// Generates: https://myblog.com/posts/article-slug

// Override per-call
const rss2 = await client.seo.getRssFeed(
  'https://myblog.com',
  20,
  'blog'  // Use /blog/ instead
)

PropertyTypeDescriptionDefault
baseUrl*stringBase URL for article links-
limitnumberMax articles to include20
pathstringArticle path (e.g., "blog", "articles")Global path

Get JSON-LD structured data for enhanced search results.

structured-data.ts
const data = await client.seo.getStructuredData('https://myblog.com')

console.log(data.project.name)
console.log(data.project.description)
console.log(`Total articles: ${data.articles.length}`)

// Get structured data for specific article
const articleData = data.articles.find(a => a.slug === 'my-article')

if (articleData) {
  console.log(JSON.stringify(articleData.structuredData, null, 2))
}

article-with-schema.tsx
import { SimplistClient } from "@simplist.blog/sdk"

// Uses SIMPLIST_API_KEY from environment variables
const client = new SimplistClient()

export default async function ArticlePage({ params }: {
  params: { slug: string }
}) {
  const article = await client.seo.getArticle(
    params.slug,
    'https://myblog.com'
  )

  return (
    <>
      {/* JSON-LD Structured Data */}
      <script
        type="application/ld+json"
        dangerouslySetInnerHTML={{
          __html: JSON.stringify(article.seo.structuredData)
        }}
      />

      {/* Article Content */}
      <article>
        <h1>{article.title}</h1>
        <time dateTime={article.publishedAt}>
          {new Date(article.publishedAt).toLocaleDateString()}
        </time>
        <div dangerouslySetInnerHTML={{ __html: article.content }} />
      </article>
    </>
  )
}

Simplist automatically generates appropriate schema types:

  • Article - For blog posts
  • BlogPosting - For blog content
  • NewsArticle - For news content
  • Author - Author information
  • Organization - Site/project information

Full Next.js implementation with all SEO features:

complete-seo-setup.ts
// lib/simplist.ts
import { SimplistClient } from "@simplist.blog/sdk"

export const client = new SimplistClient({
  apiKey: process.env.SIMPLIST_API_KEY,
  path: 'blog'  // All articles at /blog/slug
})

// ===== Article Page with Metadata =====
// app/blog/[slug]/page.tsx
import { client } from "@/lib/simplist"
import { Metadata } from "next"

export async function generateMetadata({ params }: {
  params: { slug: string }
}): Promise<Metadata> {
  const article = await client.seo.getArticle(
    params.slug,
    process.env.NEXT_PUBLIC_URL
  )

  return {
    title: article.seo.metaTitle,
    description: article.seo.metaDescription,
    openGraph: {
      title: article.seo.ogTitle,
      description: article.seo.ogDescription,
      images: article.seo.ogImage ? [article.seo.ogImage] : undefined,
      type: 'article'
    }
  }
}

export default async function Page({ params }: {
  params: { slug: string }
}) {
  const article = await client.seo.getArticle(
    params.slug,
    process.env.NEXT_PUBLIC_URL
  )

  return (
    <>
      <script
        type="application/ld+json"
        dangerouslySetInnerHTML={{
          __html: JSON.stringify(article.seo.structuredData)
        }}
      />
      <article>
        <h1>{article.title}</h1>
        <div dangerouslySetInnerHTML={{ __html: article.content }} />
      </article>
    </>
  )
}

// ===== Sitemap Route =====
// app/sitemap.xml/route.ts
import { client } from "@/lib/simplist"

export async function GET() {
  const xml = await client.seo.getSitemap(
    process.env.NEXT_PUBLIC_URL!,
    'xml'
  )

  return new Response(xml, {
    headers: {
      'Content-Type': 'application/xml',
      'Cache-Control': 'public, max-age=3600'
    }
  })
}

// ===== RSS Feed Route =====
// app/rss.xml/route.ts
import { client } from "@/lib/simplist"

export async function GET() {
  const xml = await client.seo.getRssFeed(
    process.env.NEXT_PUBLIC_URL!,
    50
  )

  return new Response(xml, {
    headers: {
      'Content-Type': 'application/rss+xml',
      'Cache-Control': 'public, max-age=3600'
    }
  })
}

Cache generated sitemaps and RSS feeds:

  • Use Cache-Control headers (1-24 hours)
  • Consider static generation for better performance
  • Invalidate cache when content changes

Ensure consistent URL structure:

  • Use global path configuration for consistency
  • Always include protocol (https://)
  • Remove trailing slashes from base URLs

Optimize SEO operations:

  • Generate sitemaps at build time when possible
  • Use Next.js Route Handlers for dynamic generation
  • Consider incremental static regeneration (ISR)

Submit your URLs to search engines:

  • Add sitemap URL to robots.txt
  • Submit sitemap to Google Search Console
  • Submit sitemap to Bing Webmaster Tools

public/robots.txt
User-agent: *
Allow: /

Sitemap: https://myblog.com/sitemap.xml

Quick Help

Yes! Create /sitemap.xml/route.ts for sitemap and /robots.txt/route.ts for robots. Next.js Route Handlers make it easy to serve these as dynamic routes.
Absolutely! Add Cache-Control headers with max-age: 3600 (1 hour) or longer. This reduces server load and improves performance for crawlers and RSS readers.
Use Google's Rich Results Test (search.google.com/test/rich-results) or schema.org validator. Paste your article URL to verify JSON-LD is correctly formatted.

Command Palette

Search for a command to run...