Define Plugin Settings
Learn how to define customizable settings for your Private Plugins, tailoring them to specific use cases and versions.
Private Plugins let you define customizable JSON settings that enable you and your users to configure plugin behavior during the code generation process. These settings can modify how your plugin behaves based on the JSON configurations you define, making them available for both developers and end users to customize.
Understanding Plugin Settings
Plugin settings are customizable JSON that you, as the plugin author, define. They allow users installing your plugin to adjust its behavior based on their specific needs. Think of them as configuration parameters for your plugin.
User-Specific Customization
Allow different teams or projects to tailor plugin behavior.
Version-Specific Configurations
Introduce setting changes with new plugin versions.
Defining Settings in JSON
Plugin settings are defined using JSON directly within the Amplication Platform Console when you create or update a plugin version.
Edit Plugin Version
Navigate to the Private Plugins section, select your plugin, and then choose the specific version you want to configure. Click the Edit button (pencil icon) next to the version.
Configure Settings in JSON
Within the “Edit Version” screen, you’ll find two key fields for JSON configuration: Settings and Configurations.
-
Settings (User-Facing): These settings are intended for users who install your plugin in services or templates. They are typically used for options users should be able to easily adjust, like API keys, feature flags, or resource names.
-
Configurations (Internal): These settings are designed for internal plugin logic and are not directly exposed to users. They are useful for things like required internal flags or configurations that control plugin behavior programmatically.
Both Settings and Configurations fields accept JSON objects. Ensure your JSON is valid to avoid errors during plugin usage.
Version-Specific Settings
Plugin settings are defined per version. This means that each version of your plugin can have its own unique set of settings. This is incredibly useful for:
- Introducing new settings in newer versions without affecting older ones.
- Changing default values for settings across versions.
- Deprecating or removing settings in later versions if needed.
Leverage version-specific settings to manage changes to your plugin’s configuration over time, ensuring backwards compatibility and controlled evolution of your plugin’s features.
Was this page helpful?