# Installation Guide for API Select Field Plugin

## Quick Start

### 1. Install the Plugin

```bash
# In your Strapi project root
npm install api-select-field
```

### 2. Enable the Plugin

Create or update `config/plugins.js` in your Strapi project:

```javascript
module.exports = {
  'api-select-field': {
    enabled: true,
    config: {
      timeout: 10000, // 10 seconds
      maxResults: 1000,
      cacheDuration: 300000, // 5 minutes
    },
  },
};
```

### 3. Restart Strapi

```bash
# Stop your current Strapi server (Ctrl+C)
# Then restart it
npm run develop
# or
npm run start
```

### 4. Verify Installation

1. Go to **Content-Type Builder** in your Strapi admin panel
2. Create or edit a Content Type
3. Add a new field
4. You should see **"API Select Field"** in the field type dropdown

## Manual Installation (Development)

If you want to install from source:

```bash
# Clone into your plugins folder
cd plugins
git clone https://github.com/yourusername/api-select-field.git

# Install dependencies
cd api-select-field
npm install

# Build the plugin
npm run build

# Go back to your Strapi project root
cd ../..

# Enable in config/plugins.js (same as above)
# Restart Strapi
```

## Troubleshooting

### Plugin Not Appearing?

1. **Check if enabled**: Verify `config/plugins.js` exists and has the correct configuration
2. **Restart required**: Strapi must be restarted after configuration changes
3. **Check dependencies**: Ensure `api-select-field` is in your `package.json`
4. **Check console**: Look for error messages in your Strapi server console
5. **Version compatibility**: Ensure you're using Strapi v4+

### Common Error Messages

- **"Plugin not found"**: Check if the plugin is properly installed
- **"Custom field not registered"**: Ensure the plugin is enabled and server restarted
- **"Build errors"**: Run `npm install` and `npm run build` in the plugin directory

### Still Having Issues?

1. Check the Strapi server console for detailed error messages
2. Verify the plugin is listed in your Strapi admin panel under **Settings > Plugins**
3. Ensure you have the latest version of the plugin
4. Check if there are any conflicting plugins or configurations

## Support

If you continue to have issues:
1. Check the [main README.md](README.md) for detailed documentation
2. Review the [examples folder](examples/) for working configurations
3. Open an issue on the GitHub repository with your error details 