metafy-seo
Version:
Lightweight, SSR-safe React components and utilities for managing SEO metadata. Supports Next.js App Router, Vite, and any React environment.
28 lines (27 loc) • 822 B
TypeScript
import React from 'react';
import { SeoConfig } from './types';
/**
* React component that injects SEO tags into the document <head>.
*
* It handles:
* - title, meta[name*], link[rel=canonical]
* - Open Graph and Twitter Card tags
* - custom extraMeta and extraLinks entries
*
* @remarks
* Uses a cleanup effect to remove tags when this component unmounts.
* SSR-safe: does nothing on server, only runs on client.
*
* @example
* <SeoTags
* title="My Page"
* description="Page description"
* canonical="/my-page"
* openGraph={{ url: '/my-page', title: 'My Page' }}
* twitter={{ card: 'summary', site: '@mysite' }}
* />
*
* @param config - SEO configuration object (see SeoConfig).
* @returns `null` (manipulates <head> as side effect).
*/
export declare const SeoTags: React.FC<SeoConfig>;