UNPKG

dev-credit

Version:

Add essential developer credits (4 meta tags) to Next.js projects - Published by Softq Web Solutions

182 lines (127 loc) 5.21 kB
# dev-credit 🎨 > Add essential developer credits to your Next.js projects via 4 clean HTML meta tags [![npm version](https://badge.fury.io/js/dev-credit.svg)](https://www.npmjs.com/package/dev-credit) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Next.js](https://img.shields.io/badge/Next.js-13%2B-black)](https://nextjs.org/) > **Published by Softq Web Solutions** - [softq.live](https://softq.live) ## ✨ Features - 🏷️ **Minimal Meta Tags**: Only 4 essential meta tags - no spam - 🚀 **Zero Config Option**: Import and forget - works automatically - 📦 **ESM Compatible**: Full ES Module support with Tree Shaking - 🔧 **Fully Customizable**: Use default credits or provide your own - 🎯 **Next.js Optimized**: Works seamlessly with Next.js 13+ App Router - 👤 **SEO Friendly**: Clean meta tags for search engines - 🔇 **Clean Console**: No console output - only meta tag attribution ## 📦 Installation ```bash npm install dev-credit ``` ## 🚀 Quick Start ### Option 1: Zero-Config Meta Tags (Instant Setup) Add this to your root layout file (`app/layout.js` or `app/layout.tsx`): ```javascript import "dev-credit/auto"; import { withDevMeta } from "dev-credit"; export const metadata = withDevMeta(); export default function RootLayout({ children }) { return ( <html lang="en"> <body>{children}</body> </html> ); } ``` **That's it!** 🎉 Your site will now have 4 essential developer credit meta tags. ### Option 2: Add Custom Developer Credits ```javascript import { withDevMeta } from "dev-credit"; import type { Metadata } from "next"; export const metadata: Metadata = withDevMeta(undefined, { title: "My Awesome Next.js App", description: "An amazing application built with Next.js", icons: { icon: "/favicon.ico", }, }); ``` This adds exactly **4 clean meta tags** to your HTML `<head>` section: ```html <meta name="developer" content="Himangshu Mishra" /> <meta name="developer-website" content="https://mishra.codes" /> <meta name="built-by" content="Himangshu Mishra" /> <meta name="publisher" content="Softq Web Solutions" /> ``` ### Option 3: Custom Developer Credits Use your own developer information: ```javascript import { withDevMeta } from "dev-credit"; import type { Metadata } from "next"; export const metadata: Metadata = withDevMeta({ developer: "Your Name", website: "https://yourwebsite.com", email: "you@example.com" }, { title: "My App", description: "My awesome app", icons: { icon: "/favicon.ico", }, }); ``` ## 🛠️ API Reference ### `withDevMeta(creditData?, existingMetadata?)` Merges developer credit information into Next.js metadata object with only 4 essential meta tags. **Parameters:** - `creditData` (Object, optional): Developer information - `developer` (string): Developer name (default: "Himangshu Mishra") - `website` (string): Developer website (default: "https://mishra.codes") - `email` (string): Developer email (default: "contact@mishra.codes") - `existingMetadata` (Object, optional): Your existing Next.js metadata **Returns:** Complete metadata object with 4 essential developer credits ### `getDevMeta(existingMetadata?)` Generates metadata using default developer credit (Himangshu Mishra). ### `createDevMeta(creditData?)` Creates custom meta tags specifically for developer attribution. ### `import "dev-credit/auto"` Zero-config import for compatibility (no console output). ## 📋 What Gets Added? ### Only 4 Essential Meta Tags ```html <!-- Clean, minimal developer attribution --> <meta name="developer" content="Himangshu Mishra" /> <meta name="developer-website" content="https://mishra.codes" /> <meta name="built-by" content="Himangshu Mishra" /> <meta name="publisher" content="Softq Web Solutions" /> ``` ### ✅ No More Spam - **No Twitter Card metadata** - **No excess meta tags** - **No console output** - **Clean and professional** ## 📋 Requirements - **Next.js**: 13.0.0 or higher - **Node.js**: 16.0.0 or higher - **TypeScript**: Full support included ## 🌟 Default Developer Credit This package defaults to crediting: **Himangshu Mishra** - Website: [mishra.codes](https://mishra.codes) - Email: contact@mishra.codes **Published by Softq Web Solutions** - [softq.live](https://softq.live) ## 🔧 Backward Compatibility Old function names still work: ```javascript // Old (still works) import { withDevCredit } from "dev-credit"; // New (recommended) import { withDevMeta } from "dev-credit"; ``` ## 📄 License MIT © [Himangshu Mishra](https://mishra.codes) Published by **Softq Web Solutions** - [softq.live](https://softq.live) ## 📞 Support - 📧 **Email**: contact@mishra.codes - 💼 **Website**: [mishra.codes](https://mishra.codes) - 🏢 **Publisher**: [Softq Web Solutions](https://softq.live) --- **Made with ❤️ by [Himangshu Mishra](https://mishra.codes) | Published by [Softq Web Solutions](https://softq.live)**