sourcey.config.ts
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)
| Field | Type | Default | Description |
|---|---|---|---|
preset | "default" | "minimal" | "api-first" | "default" | Layout preset |
colors.primary | string | "#6366f1" | Primary accent color (6-digit hex) |
colors.light | string | primary value | Lighter accent variant |
colors.dark | string | primary value | Darker accent variant |
fonts.sans | string | Inter system stack | Sans-serif font family |
fonts.mono | string | Geist Mono system stack | Monospace font family |
layout.sidebar | string | "18rem" | Sidebar width |
layout.toc | string | "19rem" | Table of contents width |
layout.content | string | "44rem" | Content area width |
css | string[] | [] | 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[] }
Use defineConfig() for TypeScript autocomplete. It's an identity function that returns the config as-is, but gives your editor full type information.
