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

@nandansravesh/react-smart-seo

v0.1.1

Published

Framework-agnostic SEO orchestration for React with automatic metadata, Open Graph, and structured data.

Readme

🧠 react-smart-seo

Framework-agnostic SEO orchestration for React
Next.js-level SEO thinking — without needing Next.js.

react-smart-seo is an opinionated, zero-config SEO system for React applications.
It goes beyond basic <head> management and helps developers apply SEO best practices by default, without repetitive boilerplate or manual mistakes.


✨ Why react-smart-seo?

Most React SEO libraries only help you set meta tags.
They don’t help you avoid SEO mistakes, scale SEO across large apps, or enforce consistency.

react-smart-seo is different.

It acts as an SEO orchestration layer that sits between your React app and the document head.


🚀 Key Features

✅ Smart Defaults (Zero Config)

  • Automatic <title>, meta description, and canonical URL
  • Open Graph & Twitter cards auto-generated
  • Sensible SEO fallbacks for every page

✅ Centralized SEO Configuration

  • Global defaults using SeoProvider
  • Consistent titles, descriptions, and site metadata

✅ Built-in SEO Validation (Dev-Only)

  • Warns if:
    • Title is missing
    • Canonical URL is missing
    • Meta description is too long
  • Optional strict mode to throw errors

✅ Structured Data (JSON-LD)

  • Built-in support for:
    • Article
    • WebSite
    • Breadcrumb
  • No manual JSON writing

✅ Head Deduplication

  • Prevents duplicate <meta> and <title> tags
  • Safe across re-renders and route changes

✅ Framework-Agnostic

  • Works with:
    • Vite
    • CRA
    • Custom SSR
    • Any React setup
  • No Next.js dependency

🆚 How It’s Different from Other Libraries

| Feature | react-helmet | next-seo | react-smart-seo | | -------------------- | ------------ | -------- | --------------- | | Framework agnostic | ✅ | ❌ | ✅ | | SEO validation | ❌ | ❌ | ✅ | | Auto OG & Twitter | ❌ | ✅ | ✅ | | Structured data | ❌ | ✅ | ✅ | | Centralized config | ❌ | ✅ | ✅ | | Strict SEO mode | ❌ | ❌ | ✅ | | Opinionated defaults | ❌ | ❌ | ✅ |

react-smart-seo doesn’t just manage tags — it enforces SEO discipline.


📦 Installation

npm install @nandansravesh/react-smart-seo

🧩 Basic Usage

import { Seo } from "@nandansravesh/react-smart-seo";

function Home() {
  return <Seo title="Home" />;
}

This automatically generates:

  • <title>
  • <meta name="description"> (fallback)
  • Canonical URL
  • Open Graph metadata
  • Twitter cards

🌍 Global Configuration with SeoProvider

import { SeoProvider } from "@nandansravesh/react-smart-seo";

<SeoProvider
  config={{
    siteName: "XecureCode",
    siteUrl: "https://xecurecode.com",
    titleTemplate: "%s | XecureCode",
    defaultDescription: "We build scalable software",
    twitterHandle: "@xecurecode",
  }}
>
  <App />
</SeoProvider>;

All pages automatically inherit:

  • Title template
  • Default description
  • Site-wide metadata

🧠 Page-Level SEO

<Seo title="Pricing" description="Simple and transparent pricing" />

Generates:

  • Full title using template
  • Canonical URL
  • OG & Twitter metadata
  • Robots meta tag

🔗 Canonical URLs (Auto)

You don’t need to pass canonical manually.

<Seo title="Blog" />

Automatically resolves to:

https://yoursite.com/current-path

🧱 Structured Data (JSON-LD)

Article Schema Example

<Seo
  title="My Blog Post"
  schema={{
    type: "Article",
    headline: "My Blog Post",
    datePublished: "2024-01-01",
    author: "Sravesh Nandan",
  }}
/>

Automatically injects valid JSON-LD into the document head.


⚠️ SEO Warnings (Development Mode)

In development, you may see warnings like:

⚠️ [react-smart-seo] Missing <title> tag
⚠️ [react-smart-seo] Meta description too long (182 chars)

These warnings:

  • Help catch SEO issues early
  • Do not affect production builds

🔐 Strict Mode (Fail Fast)

Enable strict mode to enforce SEO rules:

<Seo strict />

In development:

  • Throws errors instead of warnings
  • Ideal for teams, CI, and large projects

🔄 SPA & Route Change Friendly

  • Works seamlessly with React Router
  • Metadata updates correctly on route navigation
  • No duplicated tags on re-render

⚠️ Notes & Limitations

  • Best SEO results with SSR or SSG

  • Client-side apps still benefit from:

    • Social sharing previews
    • Browser metadata
  • Requires React 17 or higher


🛣️ Roadmap

  • Sitemap generation
  • More structured data schemas
  • SEO linting rules
  • Framework adapters
  • Performance hints

📄 License

MIT © Nandan Sravesh


⭐ Final Tip

If you find this useful:

  • ⭐ Star the repository
  • 🧪 Use it in a real project
  • 🐛 Report issues or suggest features