Index sources
Where Peam discovers pages to index
Overview
Index sources discover pages or files that should be indexed. Each source produces a list of page candidates (path + file path) that the pipeline can filter and index.
Peam ships with two sources today:
The prerender source is primarily used by withPeam on Next.js 15+ to auto-discover pages, but it can also be selected manually via the CLI.
Automatic prerender discovery only works on Next.js 15+. For Next.js 14 (or older), add a postbuild script that
runs peam to discover pages after next build. See the Next.js getting started
guide.
Configure sources
Next.js (withPeam)
When using Next.js, withPeam auto-detects build output and wires the default source for you. You typically only set filters and storage options:
// next.config.ts
import withPeam from '@peam-ai/next';
export default withPeam({
exclude: ['/admin/**'],
robotsTxt: true,
})();CLI
Use the CLI to explicitly choose and configure sources:
peam \
--source fileBased --projectDir . --sourceDir dist --glob "**/*.html" \
--source prerender --projectDir . --prerenders ./out/prerender-manifest.json \
--store fileBased --indexPath .peam/index.json