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

strapi-plugin-seo-gemini

v1.1.7

Published

Automate SEO metadata generation with Google Gemini 2.0 Flash

Readme

Strapi SEO Gemini Plugin

An enterprise-grade Strapi 5 plugin that leverages Google's Gemini Flash AI models to automate SEO metadata generation. This project demonstrates high-quality software engineering practices, including strict TypeScript typing, deep Strapi admin integration, and optimized architectural patterns.

Technical Highlights

  • Native Strapi 5 Integration: Deeply integrated into the Strapi Content Manager using the editView.right-links injection zone, providing a seamless sidebar workflow.
  • Strict TypeScript Architecture: 100% type-safe codebase. Zero usage of any. Implements specific interfaces for Strapi application contexts, Koa request/response cycles, and AI data schemas.
  • Architectural Patterns: Adheres to the Controller-Service pattern, ensuring a clean separation of concerns between API endpoints and business logic/AI orchestration.
  • AI Orchestration & Fallbacks: Features a robust Multi-Model Fallback mechanism (gemini-2.5-flash -> 2.0 -> 1.5) to ensure high availability and resistance to API rate-limiting or outages.
  • Intelligent Schema-Agnostic Extraction: Implements a robust content analysis utility that detects and prioritizes common fields (title, body, category, tags, etc.) across diverse Strapi schemas. It gracefully falls back to a global field scan if specific matches are not found, ensuring functionality regardless of the Content-Type structure.
  • Strapi 5 Blocks Support: Native handling of the new 'Blocks' JSON format alongside legacy rich text and plain string fields.
  • One-Way Form Population: Uses Strapi's internal useForm hook to programmatically populate form fields across various naming conventions (SEO, seo, Seo) using dynamic prefix detection.

Requirements

  • Strapi v5.x (Standard and Enterprise)
  • Node.js >= 18.x
  • Google Gemini API Key

Features

  • Automated Metadata Generation: Analyzes content to generate Meta Titles (conforming to 60-char limits), Meta Descriptions (conforming to 160-char limits), Keywords, Meta Robots, and JSON-LD Structured Data.
  • Zero-Click Workflow: Clicking "Generate with AI" automatically synchronizes the generated data with the entry's SEO component.
  • Optimized UI: Built with the official @strapi/design-system, featuring responsive layouts, consistent typography, and native Strapi styling (filterShadow).

Installation

npm install strapi-plugin-seo-gemini
# or
yarn add strapi-plugin-seo-gemini

After installation, rebuild the Strapi admin panel:

npm run build
npm run develop

Configuration

The plugin must be enabled in the Strapi configuration.

1. Update config/plugins.ts (or .js)

Add the following configuration. If you already have other plugins, simply add strapi-plugin-seo-gemini to the object:

export default ({ env }) => ({
  // ... other plugins
  'strapi-plugin-seo-gemini': {
    enabled: true,
    config: {
      apiKey: env('GEMINI_API_KEY'),
    },
  },
});

2. Update .env

Add your Google Gemini API key to your environment variables:

GEMINI_API_KEY=your_api_key_here

Usage

1. Create the SEO Component

The plugin expects a component named SEO (or seo/Seo) with specific fields. Create a file at src/components/shared/seo.json:

{
  "collectionName": "components_shared_seos",
  "info": {
    "displayName": "SEO",
    "icon": "search",
    "description": "SEO fields for articles and pages"
  },
  "options": {},
  "attributes": {
    "metaTitle": {
      "type": "string",
      "maxLength": 60
    },
    "metaDescription": {
      "type": "text",
      "maxLength": 160
    },
    "keywords": {
      "type": "text"
    },
    "metaRobots": {
      "type": "string",
      "default": "index, follow"
    },
    "structuredData": {
      "type": "json"
    }
  }
}

2. Add to Content-Type

In the Content-Type Builder, add the SEO component to your Content-Types. Use seo as the field name.

3. Generate Metadata

  1. Open an entry in the Content Manager.
  2. Click "Generate with AI" in the sidebar.
  3. Review and Save.

Troubleshooting

  • Widget not appearing? Rebuild the admin panel (npm run build).
  • Generation failing? Check GEMINI_API_KEY and field names.

Developer & Architectural Notes

This plugin was built with a focus on maintainability and performance:

  • Scalability: The modular service architecture allows for easy swapping of AI providers or generation logic.
  • Performance: Minimized re-renders in the Admin UI via efficient hook usage and optimized state management.
  • Quality Assurance: Scanned and verified for Clean Code principles, ensuring semantically meaningful naming and logical object structures.

Developed as a demonstration of technical proficiency in Strapi Plugin Development and AI Integration.

Support

If this plugin saved your time, please give it a ⭐ on GitHub! It helps me stay motivated to add more AI features.