Sitemaps (SDK)

Fetch URL entries for sitemap.xml generation.

Wraps the Sitemaps REST API. For most projects you should reach for createSitemapGenerator in inventra/next — it combines this with your static routes automatically. Use the raw method below when you need the entries for a custom pipeline.

Methods

inventra.sitemaps.listEntries()

Returns every sitemap entry Inventra manages for your organization.

const entries = await inventra.sitemaps.listEntries();

Returns Promise<SitemapEntry[]>

Type

interface SitemapEntry {
  slug: string; // e.g. "my-post" — renders as "/blog/my-post" in the default generator
  lastModified: string; // ISO 8601
}

Next.js integration

The ergonomic path is createSitemapGenerator:

// app/sitemap.ts
import { createSitemapGenerator, withISR } from 'inventra/next';
import { inventra } from '@/packages/plugins/config';

export default createSitemapGenerator(inventra, {
  baseUrl: 'https://example.com',
  staticRoutes: [
    { path: '/', priority: 1 },
    { path: '/about', priority: 0.8 },
    { path: '/blog', priority: 0.9, changeFrequency: 'daily' }
  ],
  fetchConfig: withISR(3600)
});

See inventra/next for the full reference.