Skip to content

Configuration

github-actions[bot] edited this page Jun 26, 2026 · 1 revision

Configuration

Configuration is validated by Zod in @rankmyseo/core. Use defineConfig() for type-safe objects.

Full schema

import { defineConfig } from "@rankmyseo/core";

export default defineConfig({
  databaseUrl: "sqlite://./data/rankmyseo.sqlite",
  tenantId: "tenant-a",
  projectId: "project-1",

  dataSources: [
    { provider: "fixture", default: true },
    // { provider: "gsc", apiKey: "...", default: true },
  ],

  schedule: {
    cron: "0 6 * * *",
    enabled: false,
  },

  siteFeatures: {
    sitemap: true,
    llmsTxt: true,
    collector: true,
    markdownNegotiation: true,
    blog: false,           // opt-in blog API
  },

  sitemapRoutes: ["/", "/about"],

  llmsTxt: {
    projectName: "My Site",
    summary: "SEO tracking powered by RankMySEO.",
    links: [{ title: "About", url: "/about.md" }],
  },

  dashboard: {
    widgets: [/* optional default widgets */],
  },
});

Fields

Field Type Default Description
databaseUrl string required SQLite path (sqlite:///abs/path or sqlite://./relative)
tenantId string required Default tenant for single-tenant setups
projectId string required Default project
dataSources array [{ provider: "fixture", default: true }] Rank data providers
schedule.cron string "0 6 * * *" Cron expression for ingestion
schedule.enabled boolean false Enable scheduled jobs
siteFeatures.sitemap boolean true Serve GET /sitemap.xml
siteFeatures.llmsTxt boolean true Serve GET /llms.txt
siteFeatures.collector boolean true Enable POST /collect
siteFeatures.markdownNegotiation boolean true HTML/markdown on GET /
siteFeatures.blog boolean false Enable /blog CRUD routes
sitemapRoutes string[] ["/"] Paths included in sitemap
llmsTxt object optional Content for llms.txt
dashboard.widgets array optional Seed dashboard layout

Data source providers

Only "fixture" and "gsc" are valid in OSS:

dataSources: [
  { provider: "fixture", default: true },
  { provider: "gsc", apiKey: process.env.GSC_API_KEY, default: false },
]

CLI scaffold

pnpm exec rankmyseo init

Generates a starter rankmyseo.config.ts with blog: false.

Handler options

When using createHandler or createRankMySeoApp, pass:

createHandler(store, {
  config: myConfig,
  agentModel: openai("gpt-4o"),  // optional — enables POST /agent/chat
});

Without agentModel, /agent/chat returns 503.

Clone this wiki locally