API Reference
API Reference
SEOX API documentation
API Reference
SEOX provides a simple API for managing SEO in your Next.js applications.
Package Exports
Main Package (seox)
Types and configuration interfaces.
import type { SEOXConfig } from 'seox';Exports
| Export | Type | Description |
|---|---|---|
SEOXConfig | Type | Configuration interface |
DEFAULT_CONFIG_FILENAME | Constant | Default config filename |
Next.js Package (seox/next)
React components and utilities for Next.js.
import { SEOX, JsonLd } from 'seox/next';Exports
Quick Reference
Generate Metadata
import { SEOX } from 'seox/next';
import { config } from '@/seox.config';
export async function generateMetadata() {
return new SEOX(config).metadata({
title: 'Page Title',
description: 'Page description',
});
}Add Structured Data
import { JsonLd } from 'seox/next';
export default function Page() {
return (
<>
<JsonLd
data={{
'@context': 'https://schema.org',
'@type': 'Organization',
name: 'Acme Inc',
url: 'https://acme.com',
}}
/>
<main>Content</main>
</>
);
}