SEO in Next.js v1.1.0 is here

In this release the focus was mainly on improving the configuration file experience (adding support for JavaScript expressions, for example) and on writing tests for the main functionalities of the library.

These are the most important changes.

The config file now supports full JavaScript expressions

Previously, the seo.config.ts or seo.config.js file didn't support JavaScript expressions: if you tried to process or transform a value before passing it to defineSeoConfig, everything would break.

Now you can write any JavaScript expression and pass the result directly to the configuration.

import { defineSeoConfig } from "seo-in-nextjs";

const manualRoutes = ["/users/1", "/users/2", "/users/3"];

export default defineSeoConfig({
  baseUrl: "https://example.com",
  siteName: "Example",
  defaultOgImg: "/og-default.png",
  manualRoutes,
});

Ignore routes in the sitemap.xml and llms.txt generation

In defineSeoConfig you can define the ignoreRoutes property to exclude specific routes when generating the sitemap.xml and llms.txt files.

import { defineSeoConfig } from "seo-in-nextjs";

export default defineSeoConfig({
  baseUrl: "https://example.com",
  siteName: "Example",
  ignoreRoutes: ["/users"],
});

defaultOgImg and manualRoutes are optional

The defaultOgImg and manualRoutes properties of defineSeoConfig are now optional.

If you don't define a default Open Graph image, and you don't define one when using genPageMetadata either, the Open Graph image metatags will not be generated.

Fully tested

All core functionalities of SEO in Next.js are now fully tested.

Terminal screenshot displaying Vitest results with 100% of SEO in Next.js tests passing.

Try it out and let me know what you think!

Sponsor me | Star on GitHub | Read the docs