Home
Reference

sourcey.config.ts

Full configuration reference. Every option, every type.

Sourcey is configured with a TypeScript file that exports a SourceyConfig object via defineConfig(). The only required field is navigation.tabs.

Minimal config

import { defineConfig } from "sourcey";

export default defineConfig({
  navigation: {
    tabs: [{
      tab: "Documentation",
      slug: "",
      groups: [{
        group: "Getting Started",
        pages: ["introduction"],
      }],
    }],
  },
});

Full config

import { defineConfig } from "sourcey";

export default defineConfig({
  name: "My Docs",
  theme: {
    preset: "default",
    colors: {
      primary: "#0066cc",
      light: "#3399ff",
      dark: "#003d99",
    },
    fonts: {
      sans: "Inter",
      mono: "JetBrains Mono",
    },
    layout: {
      sidebar: "18rem",
      toc: "19rem",
      content: "44rem",
    },
    css: ["./custom.css"],
  },
  logo: {
    light: "./logo.png",
    dark: "./logo-dark.png",
    href: "/",
  },
  favicon: "./favicon.png",
  repo: "https://github.com/org/repo",
  editBranch: "main",
  codeSamples: ["curl", "javascript", "python"],
  navigation: {
    tabs: [/* ... */],
  },
  navbar: {
    links: [
      { type: "github", href: "https://github.com/org/repo" },
    ],
    primary: {
      type: "button",
      label: "Dashboard",
      href: "https://app.example.com",
    },
  },
  footer: {
    links: [
      { type: "github", href: "https://github.com/org/repo" },
    ],
  },
});

For a production example of a complete config, see the Cheese Store demo source.

Field reference

name

Display name for the documentation site. Appears in the header alongside the logo.

Type: string Default: ""

theme

Theme configuration. Controls the visual appearance of the site.

Type: ThemeConfig (see Theme Tokens)

FieldTypeDefaultDescription
preset"default" | "minimal" | "api-first""default"Layout preset
colors.primarystring"#6366f1"Primary accent color (6-digit hex)
colors.lightstringprimary valueLighter accent variant
colors.darkstringprimary valueDarker accent variant
fonts.sansstringInter system stackSans-serif font family
fonts.monostringGeist Mono system stackMonospace font family
layout.sidebarstring"18rem"Sidebar width
layout.tocstring"19rem"Table of contents width
layout.contentstring"44rem"Content area width
cssstring[][]Custom CSS file paths
logo

Site logo displayed in the header.

Type: string | { light: string; dark?: string; href?: string }

As a string, it's a path to a single logo image. As an object, you can provide separate light/dark variants and an optional link target.

favicon

Path to a favicon file.

Type: string

repo

GitHub repository URL. Enables the repository link in the navbar and powers "Edit this page" links when combined with editBranch.

Type: string Example: "https://github.com/org/repo"

editBranch

Git branch name for "Edit this page" links. When set (along with repo), each markdown page shows an edit link pointing to the source file on GitHub.

Type: string Example: "main"

codeSamples

Languages for auto-generated API code samples. Applies to OpenAPI tabs. MCP tabs generate JSON-RPC, TypeScript, and Python samples automatically.

Type: string[] Default: ["curl", "javascript", "python"] Available: "curl", "javascript", "typescript", "python", "go", "ruby", "java", "php", "rust", "csharp"

navigation

Site navigation structure. The only required top-level field.

Type: { tabs: TabConfig[] }

See Navigation for the full tab and group reference. Tab sources include openapi, mcp, doxygen, and groups.

navbar

Header navigation links and optional CTA button.

Type: { links?: NavbarLink[]; primary?: { type: "button"; label: string; href: string } }

See Navbar & Footer for link types.

footer

Footer navigation links.

Type: { links?: NavbarLink[] }

Tip

Use defineConfig() for TypeScript autocomplete. It's an identity function that returns the config as-is, but gives your editor full type information.