Simplified SEO management for Next.js App Router
Seox is an open source tool that centralizes and automates SEO management (meta tags, Open Graph, JSON-LD...) in Next.js projects using the App Router.
It combines TypeScript-typed configuration, automatic metadata injection, and an intuitive CLI to guide developers.
In a typical Next.js project, each page manually repeats its <Head> tags, metadata, and JSON-LD.
π This creates duplication, inconsistencies, and complicates maintenance.
Seox provides:
- TypeScript-typed configuration (
lib/seo.ts) - Automatic metadata injection into your Next.js files
- Simple API:
seoConfig.configToMetadata() - Complete CLI to initialize and configure your project
# Using Bun (recommended)
bun i seox
# Using npm
npm i seox
# Using pnpm
pnpm i seox# Using Bun (recommended)
bunx seox init
# Using npx
npx seox initThis creates a lib/seo.ts file with interactive setup.
# Scan and inject metadata into your Next.js files
bunx seox configure# Check your SEO configuration
bunx seox doctorCreated via the init command:
import { Seox } from "seox/next";
export const seoConfig = new Seox({
name: "My Awesome Site",
url: "https://mysite.com",
title: {
default: "My Awesome Site",
template: "%s | My Awesome Site",
},
description: "Welcome to my modern Next.js site",
keywords: ["nextjs", "seo", "typescript"],
creator: "Your Name",
publisher: "Your Company",
authors: [
{
name: "Your Name",
url: "https://mysite.com/about",
},
],
openGraph: {
type: "website",
locale: "en_US",
url: "https://mysite.com",
siteName: "My Awesome Site",
},
twitter: {
card: "summary_large_image",
creator: "@yourhandle",
},
});π§ TypeScript typing guides you through field completion.
Configuration is centralized and reusable.
Once the file is completed:
bunx seox configureThis command:
- Scans your Next.js files (
app/andpages/) - Injects metadata into your
layout.tsxandpage.tsx - Handles conflicts with existing metadata
- Validates SEO consistency of your configuration
After running bunx seox configure, your files are automatically updated:
// app/layout.tsx (automatically generated)
import { seoConfig } from "@/lib/seo";
import { JsonLd } from "seox/next";
export const metadata = seoConfig.configToMetadata();
export default function RootLayout({ children }) {
return (
<html lang="en">
<head>
<JsonLd seo={seoConfig} />
</head>
<body>{children}</body>
</html>
);
}π‘ The
<JsonLd />component automatically injects all JSON-LD structured data configured in yourseoConfig.
// app/page.tsx
import { seoConfig } from "@/lib/seo";
export const metadata = seoConfig.configToMetadata({
title: "Home | My Awesome Site",
description: "Welcome to our homepage",
openGraph: {
title: "Home - My Awesome Site",
description: "Discover our modern website",
},
});π‘ Why this approach?
- β Compatible with all environments (AWS Amplify, Vercel, etc.)
- β Predictable and explicit
- β Performant (direct injection into Next.js metadata)
- β Type-safe with TypeScript
- β Automatic (no need to manually manage each page)
π‘ The configToMetadata() method:
- Automatically generates:
<title>and title templates<meta name="description">- OpenGraph tags
- Twitter Card tags
- robots metadata
- JSON-LD (if configured)
- Server-side rendering (SSR/SSG) for optimal performance
Need to modify certain values on the fly?
// app/page.tsx
import { seoConfig } from "@/lib/seo";
export const metadata = seoConfig.configToMetadata({
title: "Home | Promo 2025",
description: "New offer available!",
openGraph: {
title: "Promo 2025 - My Awesome Site",
description: "Discover our exceptional offers",
},
});Seox merges these fields with the global configuration.
Seox provides full support for JSON-LD structured data to improve your SEO with rich snippets in Google search results.
Add your JSON-LD schemas in your seo.ts configuration:
import { Seox } from "seox/next";
export const seoConfig = new Seox({
name: "My Site",
url: "https://mysite.com",
// ... other config
jsonld: [
{
"@context": "https://schema.org",
"@type": "Organization",
name: "My Company",
url: "https://mysite.com",
logo: "https://mysite.com/logo.png",
},
{
"@context": "https://schema.org",
"@type": "LocalBusiness",
name: "My Business",
address: {
"@type": "PostalAddress",
addressLocality: "Paris",
addressCountry: "FR",
},
},
{
"@context": "https://schema.org",
"@type": "FAQPage",
mainEntity: [
{
"@type": "Question",
name: "What is your service?",
acceptedAnswer: {
"@type": "Answer",
text: "We provide amazing services...",
},
},
],
},
],
});The <JsonLd /> component automatically renders all your JSON-LD schemas as <script type="application/ld+json"> tags:
// app/layout.tsx
import { seoConfig } from "@/lib/seo";
import { JsonLd } from "seox/next";
export default function RootLayout({ children }) {
return (
<html lang="en">
<head>
<JsonLd seo={seoConfig} />
</head>
<body>{children}</body>
</html>
);
}You can add additional schemas for specific pages:
// app/product/[id]/page.tsx
import { seoConfig } from "@/lib/seo";
import { JsonLd } from "seox/next";
export default function ProductPage() {
const productSchema = {
"@context": "https://schema.org",
"@type": "Product",
name: "Amazing Product",
price: "99.99",
};
return (
<>
<JsonLd seo={seoConfig} additionalSchemas={[productSchema]} />
{/* Page content */}
</>
);
}You can also access JSON-LD data programmatically:
// Get JSON-LD as objects
const schemas = seoConfig.getJsonLd();
// Get JSON-LD as stringified JSON (ready for injection)
const jsonStrings = seoConfig.getJsonLdStrings();Seox supports all Schema.org types:
| Schema Type | Use Case |
|---|---|
Organization |
Company information |
LocalBusiness |
Local business with address, hours |
FAQPage |
FAQ sections for rich snippets |
Product |
E-commerce products |
Article |
Blog posts and articles |
BreadcrumbList |
Navigation breadcrumbs |
WebSite |
Site-wide search box |
Person |
Author profiles |
Review / AggregateRating |
Reviews and ratings |
Seox provides an intuitive CLI:
| Command | Description |
|---|---|
seox init |
Creates lib/seo.ts with interactive setup |
seox configure |
Scans and injects metadata into your Next.js files |
seox doctor (soon) |
Validates your SEO configuration |
# Force overwrite existing metadata
bunx seox configure --force
# Validation only (no generation)
bunx seox configure --validate[ lib/seo.ts ] β TypeScript-typed configuration
β (configure)
[ Scan Next.js files ] β automatic detection
β
[ Inject metadata ] β into layout.tsx/page.tsx
β
[ Server-side rendering ] β Next.js App Router
β
Centralized configuration in TypeScript
β
Automatic injection into your files
β
Type-safe with autocompletion
β
Optimized SEO server-side
β
Simplified maintenance
Centralized SEO configuration with complete TypeScript typing.
Method that generates Next.js metadata from your configuration.
Accepts optional overrides to customize per page.
Returns the JSON-LD schemas as an array of objects.
Accepts optional additional schemas to merge with config.
Returns the JSON-LD schemas as stringified JSON strings, ready for injection.
React component to inject JSON-LD structured data into the page <head>.
import { JsonLd } from "seox/next";
<JsonLd seo={seoConfig} additionalSchemas={[...]} />| Prop | Type | Description |
|---|---|---|
seo |
Seox |
Your Seox configuration instance |
additionalSchemas |
SEOJsonLd[] |
Optional additional schemas to include |
| Feature | Status |
|---|---|
| TypeScript-typed configuration | β |
CLI init / configure |
β |
| Automatic metadata injection | β |
| OpenGraph and Twitter Cards support | β |
| Local overrides per page | β |
SEO validation with doctor |
β |
CLI doctor |
π |
Multilingual support (hreflang) |
π |
| Automatic OG image generation | π |
Predefined templates (--template blog) |
π |
| JSON-LD structured data | β |
<JsonLd /> React component |
β |
- Node.js >= 18.0.0
- Next.js >= 14.0.0
- React >= 18.0.0
- TypeScript >= 5.9.3
# Bun (recommended)
bun add seox
# npm
npm install seox
# pnpm
pnpm add seox
# yarn
yarn add seoxWe welcome contributions! Please see our Contributing Guide for details.
# Clone the repository
git clone https://github.com/neysixx/seox.git
cd seox
# Install dependencies
bun install
# Build the project
bun run buildMIT Β© 2025 β Designed for modern Next.js developers π§βπ»
- Built with Next.js
- Powered by TypeScript
- CLI built with Commander.js
- Styling with Chalk
- π Documentation
- π Report Issues
- π¬ Discussions
- π§ Email
Made with β€οΈ for the Next.js community