Type-safe JSON-LD structured data for Next.js App Routerβbuilt for SEO, AI discovery, and CI validation.
Getting Started β’ Documentation β’ Examples
Schema Sentry provides a type-safe SDK and CLI for generating, validating, and auditing JSON-LD structured data with deterministic output. Designed for predictable diffs, CI-grade enforcement, and maximum discoverability across both traditional search engines (Google, Bing) and AI-powered systems (ChatGPT, Claude, Perplexity).
Current release: v0.5.0 (new schemasentry scaffold command with pattern-based auto-detection)
Next release target: v0.6.0 (VS Code extension and CLI visualization)
- π Type-safe JSON-LD builders for 15+ schema types (Organization, Article, Product, FAQPage, HowTo, VideoObject, ImageObject, Event, Review, and more)
- π― Deterministic JSON-LD output for clean, reviewable version control diffs
- βοΈ App Router
<Schema />component for seamless Next.js integration - π§ Manifest-driven schema coverage ensures every route has proper structured data
- π CLI validation with clear, actionable errors for CI/CD pipelines
- π Schema audit β Analyze site health, detect missing/incomplete schema
- π₯ Automated data collection β
collectcommand scans built apps to auto-generate schema data files - π§ͺ CLI commands β
init,validate,audit,collect,scaffoldfor complete workflows - ποΈ Schema scaffolding β
scaffoldcommand auto-generates schema stubs from URL patterns (/blog/* β BlogPosting, /products/* β Product) - π HTML Reports β Generate shareable reports with
--format html --output <path> - π£οΈ PR Annotations β GitHub Actions annotations with
--annotations github - π΄ Zero network calls in OSS mode (privacy-first, offline-friendly)
- π€ AI-ready output optimized for LLM consumption, citations, and AI agent recommendations
Modern content discovery happens through two channels:
- Traditional Search (Google, Bing) - Rich snippets, knowledge panels, improved rankings
- AI-Powered Discovery (ChatGPT, Claude, Perplexity, AI agents) - Contextual answers, citations, voice assistants
Teams often add JSON-LD late, inconsistently, or incorrectly. This leads to:
- β Missing rich snippets in Google search results
- β AI systems failing to understand and cite your content
- β Hard-to-debug CI failures after content changes
- β Inconsistent JSON-LD creating noisy diffs in version control
Schema Sentry enforces structured data in CI, ensuring your content is:
- β Machine-readable for both search engines and AI systems
- β Deterministically generated for clean, reviewable diffs
- β Validated automatically before deployment
- β Complete across all routes via manifest-driven checks
AI is eating the web. ChatGPT, Claude, Perplexity, and AI agents now drive significant traffic. Structured data is how AI understands and recommends your content.
| Feature | Traditional SEO | AI/LLM Discovery |
|---|---|---|
| Rich snippets | β | β Better citations |
| Knowledge panels | β | β Contextual answers |
| Voice search | β | β Voice assistant results |
| AI agent recommendations | β | β Direct inclusion |
By using Schema Sentry, you're not just optimizing for Googleβyou're making your content discoverable by the next generation of AI-powered search.
| Package | Version | Description |
|---|---|---|
@schemasentry/core |
Typed builders and validation primitives | |
@schemasentry/next |
App Router <Schema /> component |
|
@schemasentry/cli |
CI validation and report output |
# pnpm
pnpm add @schemasentry/next @schemasentry/core
pnpm add -D @schemasentry/cli
# npm
npm install @schemasentry/next @schemasentry/core
npm install -D @schemasentry/cli
# yarn
yarn add @schemasentry/next @schemasentry/core
yarn add -D @schemasentry/cliimport { Schema, Article, Organization } from "@schemasentry/next";
const org = Organization({
name: "Acme Corp",
url: "https://acme.com"
});
const article = Article({
headline: "Launch Update",
authorName: "Jane Doe",
datePublished: "2026-02-09",
url: "https://acme.com/blog/launch"
});
export default function Page() {
return (
<>
<Schema data={[org, article]} />
<main>...</main>
</>
);
}{
"routes": {
"/": ["Organization", "WebSite"],
"/blog/[slug]": ["Article"]
}
}Quick start
- Generate starter files:
pnpm schemasentry init- Optionally scan your app and add
WebPageentries for discovered routes:
pnpm schemasentry init --scan- Validate coverage and rules:
pnpm schemasentry validate \
--manifest ./schema-sentry.manifest.json \
--data ./schema-sentry.data.json- Audit schema health:
pnpm schemasentry audit --data ./schema-sentry.data.json
pnpm schemasentry audit --data ./schema-sentry.data.json --manifest ./schema-sentry.manifest.json- Scan for missing routes:
pnpm schemasentry audit --data ./schema-sentry.data.json --scan- Generate an HTML report:
pnpm schemasentry audit \
--data ./schema-sentry.data.json \
--manifest ./schema-sentry.manifest.json \
--format html \
--output ./schema-sentry-report.htmlAll commands
pnpm schemasentry init
pnpm schemasentry init --scan
pnpm schemasentry audit \
--data ./schema-sentry.data.json
pnpm schemasentry audit \
--data ./schema-sentry.data.json \
--manifest ./schema-sentry.manifest.json
pnpm schemasentry audit \
--data ./schema-sentry.data.json \
--scan
pnpm schemasentry validate \
--manifest ./schema-sentry.manifest.json \
--data ./schema-sentry.data.json
pnpm schemasentry validate \
--manifest ./schema-sentry.manifest.json \
--data ./schema-sentry.data.json \
--format html \
--output ./schema-sentry-validate-report.html
pnpm schemasentry audit \
--data ./schema-sentry.data.json \
--format html \
--output ./schema-sentry-audit-report.html
pnpm schemasentry collect \
--root ./out \
--output ./schema-sentry.data.json
pnpm schemasentry collect \
--root ./out \
--check \
--data ./schema-sentry.data.json
pnpm schemasentry collect \
--root ./out \
--routes / /blog /faq \
--strict-routes \
--check \
--data ./schema-sentry.data.json
pnpm schemasentry scaffold \
--manifest ./schema-sentry.manifest.json \
--data ./schema-sentry.data.json
pnpm schemasentry scaffold \
--manifest ./schema-sentry.manifest.json \
--data ./schema-sentry.data.json \
--write
pnpm schemasentry scaffold \
--manifest ./schema-sentry.manifest.json \
--data ./schema-sentry.data.json \
--write \
--forceThe CLI emits JSON output by default and exits with code 1 on errors, making it perfect for CI/CD pipelines.
Use --format html --output <path> to generate a shareable report file.
Use --annotations github in GitHub Actions to emit PR annotations.
Recommended field checks run as warnings by default. Disable them with --no-recommended.
See docs/ci.md for complete CI workflow examples.
Create schema-sentry.config.json to control defaults:
{
"recommended": false
}CLI flags override config. Use --config ./path/to/config.json to point at a custom file.
| File | Purpose | How It Works |
|---|---|---|
schema-sentry.manifest.json |
Defines expected schema types per route | You create this manually - tells Schema Sentry what each page should have |
schema-sentry.data.json |
Contains the actual schema data | You create this manually - mirrors your actual schema |
Why two files? The manifest ensures every route has the right schema type. The data file validates that your actual schema matches expectations.
Use schemasentry init to generate starter files. Add --scan to include all discovered routes as WebPage entries, and use schemasentry audit --scan to detect missing routes later.
- Organization
- Person
- Place
- LocalBusiness
- WebSite
- WebPage
- Article
- BlogPosting
- Product
- VideoObject
- ImageObject
- Event
- Review
- FAQPage
- HowTo
- BreadcrumbList
A minimal Next.js App Router example lives in examples/next-app and includes a manifest and data file. It targets Next.js 16.1.6 and React 19.1.1.
Run the end-to-end workflow demo (init -> collect -> validate):
pnpm --filter schema-sentry-example-next-app schema:e2e- Next.js App Router (Next.js 13.4+)
- React 18+
- Node.js 18+
See ROADMAP.md for planned milestones and future work.
See CONTRIBUTING.md for workflow, scope guardrails, and expectations.
MIT Β© Arindam Dawn
- Report bugs: https://github.com/arindamdawn/schema-sentry/issues/new?template=bug_report.md
- Request features: https://github.com/arindamdawn/schema-sentry/issues/new?template=feature_request.md
- Discussions: https://github.com/arindamdawn/schema-sentry/discussions
Made with β€οΈ for the Next.js community