Complete SEO for
React SSR Applications
Meta tags, Open Graph, Twitter Cards, JSON-LD structured data, canonical URLs, hreflang, and robots directives — all in one zero-dependency, fully-typed, SSR-safe package.
Everything You Need for SEO
One library to handle all your SEO requirements in server-rendered React applications.
Open Graph & Twitter Cards
Generate rich social sharing previews with full Open Graph and Twitter Card meta tag support. Control titles, descriptions, images, and card types.
JSON-LD Structured Data
Built-in schema generators for Organization, Website, Article, Product, FAQ, and Breadcrumb. Compose multiple schemas with @graph support.
React Components
Drop-in <SEOHead> and <JsonLd> components that render all SEO tags as React elements. No dangerouslySetInnerHTML needed for meta tags.
Canonical & Hreflang
Build canonical URLs, manage hreflang alternate links for multi-language sites, and control search engine crawling with fine-grained robots directives.
Fully Typed
Complete TypeScript definitions for all functions, components, and configuration objects. Autocomplete-friendly with detailed JSDoc comments.
Framework Agnostic
Works with Next.js (App & Pages Router), React Router 7, Express, Remix, Astro, Solid, and any SSR setup. No framework lock-in.
Quick Start
Get up and running in under 2 minutes.
Install the package
npm install react-ssr-seo
Create your site config
Define shared defaults once — title template, site name, Twitter handle, etc.
config/seo.tsTypeScriptimport { createSEOConfig } from "react-ssr-seo"; export const siteConfig = createSEOConfig({ titleTemplate: "%s | My Site", description: "My awesome website.", openGraph: { siteName: "My Site", type: "website", locale: "en_US", }, twitter: { card: "summary_large_image", site: "@mysite", }, }); export const SITE_URL = "https://mysite.com";Use it in your pages
Merge page-specific config with your base config, then render the SEOHead component.
pages/BlogPost.tsxTSXimport { mergeSEOConfig, SEOHead, JsonLd, createArticleSchema } from "react-ssr-seo"; import { siteConfig, SITE_URL } from "../config/seo"; export function BlogPost() { const seo = mergeSEOConfig(siteConfig, { title: "My First Post", description: "An introduction to react-ssr-seo.", canonical: SITE_URL + "/blog/my-first-post", }); const schema = createArticleSchema({ headline: "My First Post", url: SITE_URL + "/blog/my-first-post", datePublished: "2025-06-15", author: [{ name: "Your Name" }], }); return ( <html> <head> <SEOHead {...seo} /> <JsonLd data={schema} /> </head> <body> <h1>My First Post</h1> </body> </html> ); }
Works With Your Framework
Designed to integrate seamlessly into any React SSR setup.
Explore Live Demos
Each page below is a fully working example. View the page source to inspect the generated SEO tags.
Article Page
Article schema with multiple authors, breadcrumbs, OG article type, and Twitter creator card.
Product Page
Product schema with pricing, brand, availability, AggregateRating, and breadcrumbs.
FAQ Page
FAQPage schema with question/answer pairs that appear as rich results in Google Search.
No-Index Page
Robots noindex directive for internal pages that should not appear in search results.
Right-click on any page and select "View Page Source" to see all the SEO meta tags, Open Graph tags, Twitter Card tags, hreflang links, canonical URLs, robots directives, and JSON-LD structured data that this library generates. Every page in this demo is a real working example.