@upendra.manike/seo-boost
v0.1.2
Published
SEO optimization package for JavaScript/React/Next.js/Vue apps. Automatic meta tags, JSON-LD schema, OpenGraph, Twitter cards, sitemap generation, and SEO analysis. Perfect for AI code generation.
Downloads
209
Maintainers
Readme
SEO Boost
Complete SEO optimization package for JavaScript/React/Next.js/Vue apps. Automatic meta tags, JSON-LD schema, OpenGraph, Twitter cards, sitemap generation, and SEO analysis.
🤖 Optimized for AI Agents: SEO Boost is fully documented and structured for AI code generation. All functions, hooks, and utilities are documented in api.json for easy discovery by AI coding assistants.
✨ Features
- 🏷️ Meta Tag Manager - Easily set title, description, canonical, and custom meta tags
- 🔗 Open Graph & Twitter Cards - Social sharing optimized tags
- 📦 JSON-LD Structured Data - Add schema for products, blogs, articles, and more
- 🗺️ Sitemap Generator - Automatically generate sitemap.xml
- 📈 SEO Score Analyzer - Analyze page SEO quality and get recommendations
- ⚡ SSR + SPA Support - Works in both React/Next.js & plain JS apps
- 🕵️♂️ Robots.txt Helper - Generate robots.txt dynamically
- 🌍 Multi-language Support - Support for hreflang tags
- ⚛️ React Hooks - Easy-to-use hooks for React applications
📦 Installation
npm install @upendra.manike/seo-boost
# or
yarn add @upendra.manike/seo-boost
# or
pnpm add @upendra.manike/seo-boost🚀 Quick Start
React/Next.js
import { useSEO } from '@upendra.manike/seo-boost';
function HomePage() {
useSEO({
title: "Home | My Awesome App",
description: "Best platform for SEO automation.",
keywords: ["SEO", "Automation", "React SEO"],
canonical: "https://myapp.com/",
openGraph: {
image: "https://myapp.com/og-image.jpg",
type: "website",
},
twitter: {
card: "summary_large_image",
creator: "@myhandle",
},
jsonLd: {
'@type': 'WebSite',
name: 'My Awesome App',
url: 'https://myapp.com/',
},
});
return <h1>Welcome to My SEO Boosted App 🚀</h1>;
}Vanilla JavaScript
import { applyMetaConfig, applyOpenGraph, addJSONLD } from '@upendra.manike/seo-boost';
// Set meta tags
applyMetaConfig({
title: "Home | My Awesome App",
description: "Best platform for SEO automation.",
canonical: "https://myapp.com/",
});
// Set Open Graph
applyOpenGraph({
title: "My Awesome App",
description: "Best platform for SEO automation.",
image: "https://myapp.com/og-image.jpg",
type: "website",
});
// Add structured data
addJSONLD({
'@type': 'WebSite',
name: 'My Awesome App',
url: 'https://myapp.com/',
});📚 Documentation
Meta Tags
import { useSEO } from '@upendra.manike/seo-boost';
useSEO({
title: "Page Title",
description: "Page description",
keywords: ["keyword1", "keyword2"],
author: "Author Name",
canonical: "https://example.com/page",
robots: "index, follow",
themeColor: "#000000",
});Open Graph
useSEO({
openGraph: {
title: "Page Title",
description: "Page description",
image: "https://example.com/image.jpg",
url: "https://example.com/page",
type: "website", // website, article, product, etc.
siteName: "My Site",
locale: "en_US",
},
});Twitter Cards
useSEO({
twitter: {
card: "summary_large_image",
title: "Page Title",
description: "Page description",
image: "https://example.com/image.jpg",
creator: "@username",
site: "@sitename",
},
});JSON-LD Structured Data
import { createArticleSchema, createProductSchema } from '@upendra.manike/seo-boost';
// Article schema
useSEO({
jsonLd: createArticleSchema({
headline: "Article Title",
description: "Article description",
image: "https://example.com/article-image.jpg",
datePublished: "2024-01-01",
author: {
'@type': 'Person',
name: 'Author Name',
},
publisher: {
'@type': 'Organization',
name: 'Publisher Name',
},
}),
});
// Product schema
useSEO({
jsonLd: createProductSchema({
name: "Product Name",
description: "Product description",
image: "https://example.com/product.jpg",
brand: "Brand Name",
offers: {
'@type': 'Offer',
price: "99.99",
priceCurrency: "USD",
},
}),
});Sitemap Generation
import { generateSitemap, formatSitemapDate } from '@upendra.manike/seo-boost';
const sitemap = generateSitemap({
urls: [
{
loc: "https://example.com/",
lastmod: formatSitemapDate(),
changefreq: "daily",
priority: 1.0,
},
{
loc: "https://example.com/about",
lastmod: formatSitemapDate(),
changefreq: "monthly",
priority: 0.8,
},
],
});
// Save to file or serve as route
console.log(sitemap);Robots.txt Generation
import { generateRobotsTxt } from '@upendra.manike/seo-boost';
const robotsTxt = generateRobotsTxt({
userAgents: [
{
agent: "*",
allow: ["/"],
disallow: ["/admin", "/private"],
},
],
sitemap: "https://example.com/sitemap.xml",
});
console.log(robotsTxt);SEO Analysis
import { analyzeSEO } from '@upendra.manike/seo-boost';
const analysis = analyzeSEO({
checkTitle: true,
checkDescription: true,
checkOpenGraph: true,
checkTwitter: true,
checkCanonical: true,
checkStructuredData: true,
checkImages: true,
checkHeadings: true,
});
console.log(`SEO Score: ${analysis.score}/100`);
console.log('Issues:', analysis.issues);
console.log('Recommendations:', analysis.recommendations);🎯 Use Cases
- Modern React/Next.js applications
- Single Page Applications (SPAs)
- Static site generators
- E-commerce sites
- Blog platforms
- Marketing websites
- SaaS products
- Portfolio sites
🔧 API Reference
See api.json for complete API documentation optimized for AI agents.
📖 Examples
Check EXAMPLES.md for comprehensive examples and use cases.
🤝 Contributing
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
📄 License
MIT © Upendra Manike
