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
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.
{
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)