Plugin

public protocol Plugin : CategoryTypeable, Resettable, Sendable

CategoryPlugins implement the behavior defined by the category. The Plugin protocol defines behavior common to all plugins, but each category will also define client API behavior and optionally, plugin API behavior to describe the contract to which the plugin must conform.

Note

Sendable because a plugin is registered once and then shared for the lifetime of the process, reached concurrently from any task that touches its category. Conformers are responsible for making their own state thread-safe.
  • key

    The key under which the plugin is registered in the Amplify configuration. Keys must be unique within the category configuration section.

    Declaration

    Swift

    var key: PluginKey { get }
  • Configures the category plugin using configuration

    Throws

    • PluginError.pluginConfigurationError: If the plugin encounters an error during configuration

    Declaration

    Swift

    func configure(using configuration: Any?) throws

    Parameters

    configuration

    The category plugin configuration for configuring the plugin. The plugin implementation is responsible for validating the incoming object, including required configurations, and handling potential conflicts with globally-specified options.