r/symfony • • 9d ago

I built IntegrationEngine, a Symfony bundle for consistent external API integrations

After working on multiple API integrations, I kept running into the same maintenance problem: each integration had its own way of building requests, attaching authentication and handling responses.

I built IntegrationEngine to give those integrations a consistent structure. Each operation follows three contracts:

\- \*\*Action:\*\* describes the request.

\- \*\*Mapper:\*\* converts the external response.

\- \*\*Response:\*\* exposes the result as a typed DTO.

The engine handles the shared pipeline: configuration, path resolution, authentication, HTTP transport and response mapping. The built-in transport uses Symfony HttpClient.

Static authentication and dynamic token authentication are supported, including token caching. There are also middleware hooks and lifecycle events for extending the pipeline.

A Maker command generates the integration skeleton and its first operation:

\`\`\`bash

composer require carlosgude/integration-engine

php bin/console make:integration MyApi GetEmployee

\`\`\`

The application can expose operations through a typed facade, such as \`getEmployee($id)\`. External DTOs stay behind the application's gateway or anti-corruption layer, keeping domain models independent of the integration.

The trade-off is more explicit classes and configuration per operation. That structure becomes useful when several integrations need to follow the same conventions and remain understandable as they grow.

I'm the author, and I'd be interested in feedback on that design decision: \*\*when does a shared Action/Mapper/Response structure become useful enough to justify the additional structure over individual API clients?\*\*

Repository, documentation and demo:

https://github.com/CarlosGude/integrationEngine

1 Upvotes

0 comments sorted by