npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

next-super-meta

v1.0.5

Published

AI-powered SEO metadata generator for Next.js App Router.

Readme

🚀 next-super-meta

AI-powered SEO metadata generator for Next.js App Router

next-super-meta is a lightweight, powerful SEO utility for Next.js App Router.
It automates modern SEO:

  • ✓ Title & Description
  • ✓ Open Graph (OG) metadata
  • ✓ Twitter Cards
  • ✓ Canonical URLs
  • ✓ JSON-LD Structured Data
  • ✓ Multilingual hreflang (NEW)
  • ✓ Global SEO Config with initSuperMeta (NEW)
  • ✓ Optional AI-powered metadata creation

Perfect for blogs, e-commerce stores, SaaS products, and multilingual applications.


📦 Installation

npm install next-super-meta

⚙️ NEW — Global Config (initSuperMeta)

You can now set global defaults once in your app/layout.tsx:

// app/layout.tsx
import { initSuperMeta } from "next-super-meta";

initSuperMeta({
  siteUrl: "https://your-site.com",
  defaultLang: "en-IN",
  defaultType: "website",
  defaultImage: "https://your-site.com/default-og.png",
});

This reduces repetition and ensures consistent SEO across your app.


🌍 NEW — Multilingual SEO (hreflang Support)

You can now add language alternates:

return superMeta({
  title: "Home",
  description: "Welcome to our site",
  url: "/",
  lang: "en-IN",
  languages: {
    "en-IN": "/",
    "hi-IN": "/hi",
  }
});

This generates:

{
  "alternates": {
    "canonical": "https://your-site.com/",
    "languages": {
      "en-IN": "https://your-site.com/",
      "hi-IN": "https://your-site.com/hi"
    }
  }
}

Google uses this to improve multilingual ranking.


⚡ Basic Usage

import { superMeta } from "next-super-meta";

export async function generateMetadata() {
  return superMeta({
    title: "About Us",
    description: "Learn more about our company",
    url: "/about",
  });
}

🧵 Dynamic Route Example (/blog/[slug])

import { superMeta } from "next-super-meta";
import { getPostBySlug } from "@/lib/db";

export async function generateMetadata({ params }) {
  const post = await getPostBySlug(params.slug);

  return superMeta({
    title: post.title,
    description: post.excerpt,
    url: `/blog/${params.slug}`,
    image: post.coverImage,
    type: "article",
    content: post.content,
  });
}

🤖 AI Metadata Generation (Optional)

Automatically generate SEO title & description:

export async function generateMetadata() {
  return superMeta({
    url: "/ai-demo",
    content: `
      Next.js 14 introduces Partial Prerendering for better performance...
    `,
    ai: true,
  });
}

Optional AI Environment Variables

NEXT_SUPERMETA_AI_KEY=your-openai-or-mistral-key
NEXT_SUPERMETA_AI_ENDPOINT=https://api.openai.com/v1/chat/completions
NEXT_SUPERMETA_MODEL=gpt-4o-mini

If no key is provided → AI is skipped safely.


🛍️ E-Commerce Product Example

export async function generateMetadata({ params }) {
  const product = await getProduct(params.id);

  return superMeta({
    title: product.name,
    description: product.shortDescription,
    url: `/products/${params.id}`,
    image: product.images[0],
    type: "product",
    content: product.fullDescription,
  });
}

📄 Add Custom JSON-LD Schema

const base = await superMeta({
  title: "FAQ",
  description: "Frequently asked questions",
  url: "/faq",
});

return {
  ...base,
  other: {
    ...base.other,
    "script:ld+json": JSON.stringify({
      "@context": "https://schema.org",
      "@type": "FAQPage",
      "mainEntity": [
        {
          "@type": "Question",
          name: "Does this support App Router?",
          acceptedAnswer: {
            "@type": "Answer",
            text: "Yes! It fully supports generateMetadata()."
          }
        }
      ]
    })
  }
};

📁 Package Structure

src/
 ├── index.ts
 ├── superMeta.ts
 ├── config.ts          <-- NEW
 ├── ai.ts
 ├── schema.ts
 ├── utils.ts
 └── types.ts

dist/ (build output)

🛠 API Reference

| Option | Type | Description | | ----------- | --------------------------------- | ----------------------------- | | title | string | SEO title | | description | string | Meta description | | url | string | Route URL (required) | | image | string | OG image | | type | "website" / "article" / "product" | Open Graph type | | content | string | AI training content | | lang | string | Page locale | | ai | boolean | Enable AI fallback | | languages | Record<string,string> | Multilingual alternates (NEW) |


🧪 Testing Metadata

Chrome DevTools

  • Elements → <head>
  • Application → Manifest
  • Lighthouse → SEO

🤝 Contributing

Pull requests welcome!

  1. Fork the repo
  2. Create a new branch
  3. Commit your changes
  4. Push to GitHub
  5. Open a Pull Request

📜 License

MIT License

⭐ Support

If you find this useful:

  • ⭐ Star the GitHub repo
  • 📦 Use it in your Next.js project
  • 🧡 Share feedback

Enjoy automated SEO for Next.js! 🎉