Skip to content

Automatically create Integration

is there a “new” way to create integrations automatically?

Since my modul is gonna be tested in different environments/systems, creating integrations automatically is kind of crucial.

check my code below with minor changes from https://devdocs.magento.com/guides/v2.3/get-started/create-integration.html

<?php
namespace VendorModulSetup;

use MagentoFrameworkSetupModuleContextInterface;
use MagentoFrameworkSetupModuleDataSetupInterface;
use MagentoIntegrationModelConfigBasedIntegrationManager;
use MagentoFrameworkSetupInstallDataInterface;

class InstallData implements InstallDataInterface
{
    /**
     * @var ConfigBasedIntegrationManager
     */

    private ConfigBasedIntegrationManager $integrationManager;

    /**
     * @param ConfigBasedIntegrationManager $integrationManager
     */

    public function __construct(ConfigBasedIntegrationManager $integrationManager)
    {
        $this->integrationManager = $integrationManager;
    }

    /**
     * @inheritDoc
     */

    public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
    {
        $this->integrationManager->processIntegrationConfig(['IntegrationName']);
    }
}

inside install function processIntegrationConfigis marked as deprecated.

Thanks in advance for every suggestions

P.S: This code is tested in magento2.4.5-p1