pagegraph

Configuration

Options for the pagegraph() Vite plugin, createSeo, and the defineSeoConfig fields in pagegraph.config.ts, with defaults and what each controls.

PageGraph is configured in two places. pagegraph() in vite.config.ts holds site, robots, collections, Markdown and claims settings. pagegraph.config.ts holds CLI policies and the graph loader. Option names below come from the types in the package source.

pagegraph() plugin options

Imported from pagegraph/tanstack-start.

OptionTypeWhat it does
originstringThis build's canonical origin, no trailing slash, such as https://example.com. Required
indexablebooleanWhether this host may be indexed. A non-indexable build serves a disallow-all robots.txt with no Sitemap line. Defaults to true
robots{ disallow, contentSignal, directives }disallow: path prefixes disallowed on an indexable host, beyond the route-config exclusions. contentSignal: the Content-Signal value. directives: extra lines in the User-agent: * group
collectionsstringRoot-relative module whose collections export is a SeoCollection[], or a function returning one (sync or async)
routeConfigobjectGenerates the route-config module and enforces per-group SEO coverage. Its robots exclusions join robots.disallow. See below
markdown{ origin, serverEntry }origin: canonical origin for rendered documents and twin links. serverEntry: relative to the Vite root, default dist/server/index.js
factsstringRoot-relative module exporting the code-owned document facts as facts
claims{ rules, model, cutoff, context, excludeHeads }Committed claims answers gate rendered documents and graph heads at build time. See Gate claims in page copy
ogImageOgImageResolverFallback social image resolver. Use the same one in createSeo. See Add per-page Open Graph images
excludestring[]Route-file globs, relative to the routes directory, that are never evaluated for the graph. Their paths stay out of the graph
routesDirectorystringRelative to the Vite root. Defaults to src/routes

pagegraph() returns an object with prerenderPages, which you pass to TanStack Start's pages option when you capture rendered Markdown.

routeConfig

The same options as seoRouteConfig from pagegraph/vite, without routesDirectory.

OptionWhat it does
outputPathAbsolute path the generated route-config module is written to
publicGroupsRoute groups whose page leaves form the public surface. Include the parens
enforceCoverageInRoute groups where every page leaf must declare staticData or head
disallowGroupsRoute groups whose page paths are disallowed in robots.txt, such as auth
extraPublicRoutesPublic routes outside any group folder, so nothing discovers them
reservedExtrasReserved top-level segments that are not route-tree paths, such as an API mount
alwaysDisallowPrefixes always disallowed in robots.txt, route tree or not

routeConfig.outputPath must be in an existing directory outside src/routes, so the route watcher does not loop. See Enforce route coverage in Vite.

createSeo options

Imported from pagegraph/react. createSeo binds site identity once so route files never repeat it.

OptionWhat it does
originCanonical origin, no trailing slash
siteSite identity: name, logo, publisherLogo, defaultImage, defaultAuthor
organizationOrganization data for JSON-LD: legalName, description, sameAs, contactPoint
websiteWebsite data for JSON-LD, such as searchPath
jsonLdOptional JSON-LD configuration
ogImageResolver shared with pagegraph({ ogImage }) so rendered tags and graph heads agree
transformHeadLast-mile override for every head seoHead renders. Runs after the canonical, title template and JSON-LD

Route declaration

The route's staticData.seo accepts these policy fields: kind, crumb, sitemap (or false), robots, related, link, redirectTo, modifiedAt and titleTemplate. head holds the full title and description, plus optional faqs, article, service, itemList, jsonLd, ogTitle, canonicalPath, breadcrumbs and image. crumb accepts (match) => string for dynamic segments. staticData.markdown is "rendered" or "source", and staticData.llms sets the llms.txt group.

Write staticData as an object literal and head: seo.head. The coverage gate reads both keys statically, and a helper call would make TanStack infer any search and loader types for the route tree.

defineSeoConfig fields

Imported from pagegraph/config, in pagegraph.config.ts.

FieldWhat it does
loadGraphHow the CLI gets the graph. Required. Use tanstackStartGraph({ root }) in a Start app, or viteGraphLoader otherwise
coverage{ path, minInbound }[]. Every sitemap-eligible page matching the glob needs minInbound incoming related edges
content{ minWords: { path, minWords }[] }. Word-count floors per path glob for check --site; a page matching several rules meets the highest
freshness{ maxAgeDays }. Turns older pages into stale-page findings
ogImage{ severity, publicDirectory }. severity is "structural" (default), "editorial" or "off". publicDirectory defaults to public
transformLast-mile robots.txt override, forwarded to renderRobots. Runs for indexable and preview hosts
workflowsAgent workflow settings. See below
openrouter{ referer, title }. App attribution for OpenRouter decision and agent requests

tanstackStartGraph returns the graph and site identity from the Vite plugin. It uses the built site by default. Pass command: "serve", mode: "development" to inspect a development configuration. Keep origin, indexability and robots settings in pagegraph().

workflows

FieldWhat it does
agent.presetDirectoryProject-owned agent preset directory, relative to the project root
agent.defaultModelDefault provider/model used by agentic workflows
agent.modelsPer-workflow provider/model overrides, such as "research.keywords"
agent.timeoutMsDeadline in milliseconds for each Pi research or action turn. Default 180000
context.filesDurable project context included in every workflow prompt
context.byWorkflowAdditional context files keyed by workflow id
repositoryRootRead root, relative to the config directory. Defaults to its Git top level, or the config directory outside Git
runsDirectoryIgnored run-artifact directory, relative to the project root

See Run agent workflows for how these are used.

Read next

Edit this page on GitHubView as Markdown