vonage/nexmo-bridge
Composer autoloader bridge that aliases legacy Nexmo (\Nexmo) classes, traits, and interfaces to their Vonage namespace equivalents. Use it to migrate existing code to vonage/client or vonage/client-core without refactoring everything at once.
vonage/nexmo-bridge package is a namespace compatibility layer for migrating legacy applications using the deprecated Nexmo namespace to the modern Vonage SDK. It is not a feature-rich library but a transitional tool to reduce refactoring effort.Nexmo\Client) and needing a low-risk migration path to the updated Vonage SDK (Vonage\Client).vonage/client) as a dependency.register() and bind() methods to alias Nexmo\Client to Vonage\Client transparently.Nexmo::message()), a custom facade can delegate to the bridge.composer require installation with no additional configuration needed.| Risk Area | Severity | Mitigation Strategy |
|---|---|---|
| Deprecated API Usage | High | Audit legacy code for unsupported Nexmo methods before migration. |
| Vonage SDK Breaking Changes | Medium | Test thoroughly; monitor Vonage SDK updates. |
| Performance Overhead | Low | Minimal—bridge is a thin wrapper. |
| Namespace Collisions | Medium | Ensure no other Nexmo libraries conflict. |
| Long-Term Maintenance | High | Plan to fully migrate off the bridge post-deprecation (e.g., in 1–2 years). |
Nexmo namespace?Nexmo-prefixed packages that might conflict?Nexmo\Client to Vonage\Client via the bridge.Nexmo) that delegates to the bridge.config/services.php to use the Vonage SDK config.composer require vonage/nexmo-bridge.composer why-not vonage/nexmo-bridge to check conflicts.Nexmo\ usage with grep -r "Nexmo\\".composer require vonage/client vonage/nexmo-bridge
config/services.php:
'nexmo' => [
'key' => env('VONAGE_KEY'),
'secret' => env('VONAGE_SECRET'),
'bridge' => true, // Flag to use the bridge
],
public function register()
{
$this->app->bind('Nexmo\Client', function ($app) {
return new Vonage\Client\Credentials\Basic(
$app['config']['services.nexmo.key'],
$app['config']['services.nexmo.secret']
);
});
}
// app/Facades/Nexmo.php
public static function message()
{
return app('Vonage\Client')->sms()->send(...);
}
Nexmo\ calls with Vonage\ in the codebase.vonage/client.php-curl for API calls).vonage/client and vonage/nexmo-bridge versions in composer.json to avoid surprises.use statements and autoloading are correct.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Vonage API Outage | High | Implement retries/circuit breakers. |
| Bridge Namespace Collision | Medium | Isolate legacy code in a module. |
| Deprecated Method Usage | Medium | Log warnings; replace proactively. |
| Composer Autoload Failure | Low | Verify composer dump-autoload. |
| PHP Version Incompatibility | Critical | Upgrade PHP to 7.4+. |
How can I help you explore Laravel packages today?