@better-seo/next
v0.0.2
Published
Next.js integration for @better-seo/core on the App Router (and documented Pages Router patterns): turn your SEO model into Metadata and generateMetadata, use shorthand helpers like seo() and prepareNextSeo, merge layout and page SEO without duplicating l
Readme
@better-seo/next
Next.js integration for @better-seo/core: App Router Metadata, generateMetadata patterns, shorthand seo(), prepareNextSeo, layout merge via withSEO, and NextJsonLd so JSON-LD uses the same serializeJSONLD path as the rest of the stack.
Peers: next >= 14.2, react >= 18.2 (see package.json).
Docs: Monorepo README · Recipes · CONTRIBUTING
Install
npm install @better-seo/core @better-seo/nextEntry points
| Import | Role |
| ------------------------------ | --------------------------------------------------------------------------------------- |
| @better-seo/next | seo, prepareNextSeo, withSEO, toNextMetadata, adapter registration for "next" |
| @better-seo/next/json-ld | NextJsonLd — renders <script type="application/ld+json"> from a SEO |
Scripts (monorepo)
From packages/next:
npm run build
npm run test
npm run test:coverage
npm run lint
npm run typecheckE2E: Playwright tests in examples/nextjs-app exercise real HTML head output (runs in root npm run ci).
Coverage
vitest.config.ts scopes coverage to src/to-next-metadata.ts (mapping logic); wiring in surface / register is covered by E2E.
| Metric | Minimum | | -------------- | ------- | | Lines | 82% | | Statements | 82% | | Functions | 80% | | Branches | 72% |
LCov: coverage/lcov.info (uploaded from CI when present).
License
MIT — see LICENSE.
