Skip to content

API Reference & Compatibility

The inventory is generated from the package source exports across ., ./next, and ./payload.

Functions

createRobots

Source
createRobots(options: { site: SeoSite; disallow?: string[]; }) => MetadataRoute.Robots

Exported from: @nexload-sdk/seo/next

Generate Next.js `robots.txt` rules with AI crawler presets and baseline disallows.

createSitemap

Source
createSitemap(options: { site: SeoSite; sources: Record<string, SeoSitemapSource>; logger?: Logger; }) => () => Promise<MetadataRoute.Sitemap>

Exported from: @nexload-sdk/seo/next

Create a Next.js sitemap collector with fault isolation, pagination, and deduplication.

nexloadSeo

Source
nexloadSeo(options: NexloadSeoOptions) => Plugin

Exported from: @nexload-sdk/seo/payload

Payload CMS plugin that installs SEO meta fields, `seo-settings` global, and Persian labels.

resolveSeo

Source
resolveSeo(doc: SeoDocument, site: SeoSite, options?: { logger?: Logger; }) => { metadata: Metadata; jsonLd: string | null; }

Exported from: @nexload-sdk/seo/next

Resolve Next.js `Metadata` and JSON-LD script payload for a document and site.

toRedirectKey

Source
toRedirectKey(path: string) => string

Exported from: @nexload-sdk/seo

Normalize a path into a canonical redirect lookup key with decoded segments and preserved separators.

toSeoDocument

Source
toSeoDocument(doc: SeoSourceDoc, options: { path: string; entity?: SeoEntity; breadcrumbs?: SeoDocument["breadcrumbs"]; }) => SeoDocument

Exported from: @nexload-sdk/seo

Project a Payload collection document into a normalized `SeoDocument` contract.

toSeoSite

Source
toSeoSite(settings: SeoSettingsDoc | null | undefined, options: { url: string; }) => SeoSite

Exported from: @nexload-sdk/seo

Project a Payload `seo-settings` global document into a normalized `SeoSite` contract.

Types

NexloadSeoCollectionOptions

Source
type NexloadSeoCollectionOptions = {
  freshness?: string[];
  path?: (doc: { slug?: string | null } & Record<string, unknown>) => string;
};

Exported from: @nexload-sdk/seo/payload

Public type exported by @nexload-sdk/seo.

NexloadSeoOptions

Source
type NexloadSeoOptions = {
  siteUrl: string;
  settingsAccess: {
    update: NonNullable<GlobalAccess["update"]>;
    read?: GlobalAccess["read"];
  };
  collections: Record<string, NexloadSeoCollectionOptions>;
  uploadsCollection?: string;
  redirects?: boolean;
  sitemapSources?: string[];
};

Exported from: @nexload-sdk/seo/payload

Public type exported by @nexload-sdk/seo.

SeoAiCrawlerPolicy

Source
type SeoAiCrawlerPolicy = "allow-all" | "search-only" | "block-all-ai";

Exported from: @nexload-sdk/seo

Public type exported by @nexload-sdk/seo.

SeoDocument

Source
type SeoDocument = {
  id: string;
  path: string;
  title: string;
  meta: {
    title?: string;
    description?: string;
    image?: SeoImage;
    canonicalUrl?: string;
    noIndex?: boolean;
    noFollow?: boolean;
    noSnippet?: boolean;
  };
  publishedAt?: string;
  contentUpdatedAt?: string;
  breadcrumbs?: ReadonlyArray<{ name: string; path: string }>;
  entity?: SeoEntity;
};

Exported from: @nexload-sdk/seo

Public type exported by @nexload-sdk/seo.

SeoEntity

Source
type SeoEntity =
  | { kind: "article"; author: { id: string; name: string } }
  | { kind: "product"; sku: string; images: string[]; price?: Money; inStock: boolean };

Exported from: @nexload-sdk/seo

Public type exported by @nexload-sdk/seo.

SeoImage

Source
type SeoImage = { url: string; alt: string; width?: number; height?: number };

Exported from: @nexload-sdk/seo

Public type exported by @nexload-sdk/seo.

SeoRoute

Source
type SeoRoute =
  | { kind: "page"; page: SeoDocument }
  | { kind: "redirect"; location: string }
  | { kind: "missing" };

Exported from: @nexload-sdk/seo

Public type exported by @nexload-sdk/seo.

SeoSettingsDoc

Source
type SeoSettingsDoc = {
  general?: {
    siteName?: string | null;
    titleTemplate?: string | null;
    defaultImage?: SeoUploadValue;
    indexing?: boolean | null;
    verification?: {
      google?: string | null;
      bing?: string | null;
      yandex?: string | null;
    } | null;
  } | null;
  organization?: {
    name?: string | null;
    logo?: SeoUploadValue;
    sameAs?: ReadonlyArray<{ url?: string | null }> | null;
  } | null;
  robots?: {
    aiCrawlers?: SeoAiCrawlerPolicy | null;
    disallow?: ReadonlyArray<{ path?: string | null }> | null;
    rules?: ReadonlyArray<{
      userAgent?: string | null;
      allow?: ReadonlyArray<{ path?: string | null }> | null;
      disallow?: ReadonlyArray<{ path?: string | null }> | null;
    }> | null;
  } | null;
  sitemap?: {
    disabledSources?: ReadonlyArray<string> | null;
    excludePaths?: ReadonlyArray<{ path?: string | null }> | null;
    images?: boolean | null;
  } | null;
};

Exported from: @nexload-sdk/seo

JSON of the `seo-settings` global (Payload REST, depth=1). Every field optional.

SeoSite

Source
type SeoSite = {
  url: string;
  name: string;
  titleTemplate: string;
  defaultImage?: SeoImage;
  organization: { name: string; logoUrl?: string; sameAs: string[] };
  indexing: boolean;
  verification: { google?: string; bing?: string; yandex?: string };
  robots: {
    aiCrawlers: SeoAiCrawlerPolicy;
    disallow: string[];
    rules: ReadonlyArray<{ userAgent: string; allow: string[]; disallow: string[] }>;
  };
  sitemap: { disabledSources: string[]; excludePaths: string[]; images: boolean };
};

Exported from: @nexload-sdk/seo

Public type exported by @nexload-sdk/seo.

SeoSitemapSource

Source
type SeoSitemapSource = (
  page: number,
) => Promise<{ docs: SeoDocument[]; hasNextPage: boolean }>;

Exported from: @nexload-sdk/seo/next

Public type exported by @nexload-sdk/seo.

SeoSourceDoc

Source
type SeoSourceDoc = {
  id: string | number;
  title?: string | null;
  publishedAt?: string | null;
  contentUpdatedAt?: string | null;
  meta?: {
    title?: string | null;
    description?: string | null;
    image?: SeoUploadValue;
    canonicalUrl?: string | null;
    noIndex?: boolean | null;
    noFollow?: boolean | null;
    noSnippet?: boolean | null;
  } | null;
};

Exported from: @nexload-sdk/seo

A collection document as Payload REST returns it (depth=1).

SeoUploadValue

Source
type SeoUploadValue =
  | { url?: string | null; alt?: string | null; width?: number | null; height?: number | null }
  | string
  | number
  | null
  | undefined;

Exported from: @nexload-sdk/seo

Upload value as Payload REST returns it at depth=1, or an unpopulated id.

  • Module format: ESM only ("type": "module").
  • @nexload-sdk/seo: Universal (Node.js and browser). Never imports next, payload, or any @payloadcms/* package.
  • @nexload-sdk/seo/next: Runs in Next.js 16 App Router (next >=16.0.0 <17.0.0). Never imports payload or any @payloadcms/* package.
  • @nexload-sdk/seo/payload: Runs in Node.js on the Payload CMS server (payload >=3.85.0 <4.0.0, @payloadcms/plugin-seo >=3.85.0 <4.0.0). Never imports next.
  • @nexload-sdk/seo/payload/admin.css: Payload Admin UI stylesheet for bidirectional/RTL search preview rules (.nexload-seo-meta).

Structured logs use @nexload-sdk/logger child loggers ({ module: "seo-next" } in @nexload-sdk/seo/next, { module: "payload-seo" } in @nexload-sdk/seo/payload):

EventLevelWhereMeaning
seo.sitemap.source_failedwarncreateSitemapOne sitemap source threw or exceeded 1,000 pages; remaining sources still emit
seo.sitemap.size_warningwarncreateSitemapTotal sitemap entries reached 45,000
seo.schema.offer_skippedwarnresolveSeoProduct Offer omitted from JSON-LD due to invalid or negative price
seo.redirect.writteninfonexloadSeoAutomatic reference redirect row created on published path change
seo.redirect.preservedinfonexloadSeoExisting redirect row kept untouched on published path change