Nuxt API

Configuration

Last updated by Harlan Wilton in doc: sync.
nuxt.config.ts
export default defineNuxtConfig({
  aiReady: {
    // options
  }
})

enabled

  • Type: boolean
  • Default: true
aiReady: {
  enabled: process.env.NODE_ENV === 'production'
}

debug

  • Type: boolean
  • Default: false

Enable debug logging for module operations.

mdreamOptions

  • Type: HTMLToMarkdownOptions & { preset?: 'minimal' }
  • Default: { preset: 'minimal' }

Configure mdream HTML-to-markdown conversion.

export default defineNuxtConfig({
  aiReady: {
    mdreamOptions: {
      preset: 'minimal'
    }
  }
})

markdownCacheHeaders

  • Type: { maxAge?: number, swr?: boolean }
  • Default: { maxAge: 3600, swr: true }

Cache settings for runtime markdown endpoints.

OptionTypeDefaultDescription
maxAgenumber3600Cache duration in seconds
swrbooleantrueStale-while-revalidate

llmsTxt

  • Type: LlmsTxtConfig
  • Default: Auto-generated

Configure llms.txt generation.

export default defineNuxtConfig({
  aiReady: {
    llmsTxt: {
      sections: [
        {
          title: 'API Reference',
          links: [
            { title: 'REST API', href: '/docs/api', description: 'API docs' }
          ]
        }
      ],
      notes: 'Built with Nuxt AI Ready'
    }
  }
})

LlmsTxtSection:

PropertyTypeDescription
titlestringSection title
descriptionstring | string[]Section description
links{ title, href, description? }[]Links in section

LlmsTxtConfig:

PropertyTypeDescription
sectionsLlmsTxtSection[]Custom sections
notesstring | string[]Notes at end

contentSignal

  • Type: false | { aiTrain?: boolean, search?: boolean, aiInput?: boolean }
  • Default: false

Content Signal directives for robots.txt. See Content Signals guide.

export default defineNuxtConfig({
  aiReady: {
    contentSignal: {
      aiTrain: false, // Block training
      search: true, // Allow search indexing
      aiInput: true, // Allow RAG/grounding
    }
  }
})

mcp

  • Type: { tools?: boolean, resources?: boolean }
  • Default: { tools: true, resources: true }

Control MCP features when @nuxtjs/mcp-toolkit installed.

export default defineNuxtConfig({
  aiReady: {
    mcp: {
      tools: true, // list_pages, search_pages
      resources: true, // pages resource
    }
  }
})

See MCP guide for tool/resource details.

cacheMaxAgeSeconds

  • Type: number
  • Default: 600 (10 minutes)

Cache duration for llms.txt route handlers. Uses stale-while-revalidate.

export default defineNuxtConfig({
  aiReady: {
    cacheMaxAgeSeconds: 3600 // 1 hour
  }
})

database

  • Type: { type?: string, filename?: string, bindingName?: string, url?: string, authToken?: string }
  • Default: { type: 'sqlite', filename: '.data/ai-ready/pages.db' }

Configure the SQLite database for page storage. The module auto-detects the best connector based on runtime.

OptionTypeDefaultDescription
type'sqlite' | 'd1' | 'libsql''sqlite'Database type
filenamestring'.data/ai-ready/pages.db'SQLite file path
bindingNamestring'AI_READY_DB'D1 binding name
urlstringLibSQL/Turso URL
authTokenstringLibSQL/Turso auth token
export default defineNuxtConfig({
  aiReady: {
    database: {
      filename: '.data/ai-ready/pages.db'
    }
  }
})

SQLite connector auto-detection:

RuntimeConnector
Bunbun:sqlite
Node.js 22.5+node:sqlite
Node.js <22.5better-sqlite3

For serverless deployments, the module generates a compressed dump at build time that's restored on cold start.

Table naming:

All tables are prefixed with ai_ready_ to avoid conflicts with existing database tables:

  • ai_ready_pages - Main pages table
  • ai_ready_pages_fts - FTS5 full-text search index
  • _ai_ready_info - Schema version tracking

This allows safe use with existing D1/LibSQL databases without risk of overwriting user tables.

runtimeSync

  • Type: { enabled?: boolean, ttl?: number, batchSize?: number, cron?: string, secret?: string, pruneTtl?: number }
  • Default: { enabled: false }

Opt-in runtime sync for dynamic content sites. Most sites don't need this—prerendering handles page indexing automatically.

Enable only if your site has frequently changing content that can't be prerendered.

OptionTypeDefaultDescription
enabledbooleanfalseEnable runtime sync
ttlnumber3600Re-index pages & refresh sitemap older than this (seconds)
batchSizenumber20Pages per batch (max: 50)
cronstringCron expression for scheduled indexing
secretstringAuth token for /__ai-ready/poll endpoint
pruneTtlnumber0Prune routes not in sitemap for this long (0 = never)
export default defineNuxtConfig({
  aiReady: {
    runtimeSync: {
      enabled: true,
      ttl: 3600,
      batchSize: 20,
      secret: process.env.AI_READY_SECRET,
      pruneTtl: 604800, // prune after 7 days
      cron: '*/5 * * * *' // enable scheduled indexing
    }
  }
})

When enabled:

  • GET /__ai-ready/status - Check indexing progress
  • POST /__ai-ready/poll?secret=<token> - Trigger batch indexing
  • POST /__ai-ready/prune?secret=<token> - Prune stale routes

See Runtime Sync guide for details.

indexNow

  • Type: { enabled?: boolean, key?: string, host?: string }
  • Default: Auto-enabled when NUXT_AI_READY_INDEXNOW_KEY env var is set

Instantly notify search engines (Bing, Yandex, Naver, Seznam) when pages change.

OptionTypeDefaultDescription
enabledbooleantrue (when key exists)Enable IndexNow
keystringprocess.env.NUXT_AI_READY_INDEXNOW_KEYYour IndexNow API key
hoststring'api.indexnow.org'IndexNow endpoint

Minimal setup (just set env var):

.env
NUXT_AI_READY_INDEXNOW_KEY=your-api-key-here

Explicit configuration:

export default defineNuxtConfig({
  aiReady: {
    indexNow: {
      enabled: true,
      key: process.env.INDEXNOW_KEY,
      host: 'api.indexnow.org'
    }
  }
})

When enabled:

  • Key verification route registered at /{key}.txt
  • Automatic sync after scheduled indexing (when runtimeSync.cron set)
  • Manual sync via POST /__ai-ready/indexnow
  • Stats included in /__ai-ready/status

See IndexNow guide for details.

Did this page help you?