strapi-plugin-ai-generated-field
v5.0.2
Published
A Strapi plugin that provides an AI-generated field allowing automatic content generation using AI models. Ideal for filling text fields like titles, descriptions, or summaries with context-aware suggestions.
Downloads
13
Readme
Strapi AI Generated Field Plugin
This plugin adds AI-generated text suggestions to Strapi content management using Google's Gemini API.
Features
- AI-powered text suggestions for content fields
- Integration with Google's Gemini API
- Custom settings page to configure API tokens
- Dynamic prompt field that appears only when a token is configured
Installation
Version Compatibility
For Strapi 5:
# Latest version works with Strapi 5 npm i strapi-plugin-ai-generated-field # or using yarn yarn add strapi-plugin-ai-generated-fieldFor Strapi 4:
# Specific version for Strapi 4 compatibility npm install [email protected] # or using yarn yarn add [email protected]
Important: Make sure to use version 4.0.0 if you're running Strapi 4. Users on Strapi 5 can use the latest version.
Configuration
- After installing the plugin, access the plugin settings through the main menu
- Add your Google Gemini API token
- Test the connection using the test field
How to Get a Gemini API Token
- Visit Google AI Studio
- Log in with your Google account
- Create a new API key
- Copy the key and paste it in the plugin settings
Usage
- Add the "Ai Generated Field" field type to your content types
- When editing content, click on the field to activate the AI prompt
- Enter a descriptive prompt about what content you need
- Click "Generate" to get AI suggestions
- Click on a suggestion to use it in your content
Field Configuration
The Ai Generated Field field works as a standard text field with additional AI capabilities.
// Example content-type configuration
{
attributes: {
description: {
type: 'ai-text',
options: {
description: 'Enter product description or use AI to generate one'
}
}
}
}Security Notes
- API tokens are stored in Strapi's secure configuration storage
- Tokens are never exposed to frontend users
- All API requests are made server-side for security
Troubleshooting
- If the AI prompt field doesn't appear, check that you've configured a valid API token
- If generation fails, verify your token is correct and has not expired
- Check your network connection if requests time out
- Make sure you're using the correct plugin version for your Strapi version (4.0.0 for Strapi 4, latest for Strapi 5)
