putIntegration method

RudderOption putIntegration(
  1. String type,
  2. Object enabled
)

Configures whether a specific integration should receive this event.

Use this method to control which destinations/integrations receive specific events. The enabled parameter can be a boolean (true/false) or a configuration object.

type - The integration name (e.g., 'Google Analytics', 'Amplitude'). enabled - Boolean to enable/disable, or a configuration Map. Returns this RudderOption instance for method chaining.

Implementation

RudderOption putIntegration(String type, Object enabled) {
  if (!(enabled is Map<String, Object> || enabled is bool)) {
    RudderLogger.logError(
        "RudderOption: putIntegration: Invalid type for integration");
    return this;
  }
  integrations ??= {};
  integrations![type] = enabled;
  return this;
}