SmsBridge 0.2.0
dotnet add package SmsBridge --version 0.2.0
NuGet\Install-Package SmsBridge -Version 0.2.0
<PackageReference Include="SmsBridge" Version="0.2.0" />
<PackageVersion Include="SmsBridge" Version="0.2.0" />
<PackageReference Include="SmsBridge" />
paket add SmsBridge --version 0.2.0
#r "nuget: SmsBridge, 0.2.0"
#:package SmsBridge@0.2.0
#addin nuget:?package=SmsBridge&version=0.2.0
#tool nuget:?package=SmsBridge&version=0.2.0
SMSBridge
Install one SDK. Send SMS through multiple providers. Switch anytime.
SMSBridge is a provider-agnostic .NET SDK for sending SMS messages through multiple providers using one clean API.
SMSBridge is not a messaging platform. It is a developer SDK that gives .NET applications one clean interface for sending SMS through multiple providers.
Why SMSBridge?
Every SMS provider has a different SDK, a different API shape, and different error codes.
If you use Twilio today and need to switch to Vonage tomorrow, you rewrite your SMS code.
SMSBridge solves this. You install one package. You write to one interface. You switch providers by changing one configuration value.
Installation
dotnet add package SmsBridge
Quick Start
1. Register SMSBridge
builder.Services.AddSmsBridge(opts =>
{
opts.DefaultProvider = "twilio";
opts.Providers["twilio"] = new SmsProviderOptions { Type = SmsProviderType.Twilio };
})
.UseTwilio("twilio", o =>
{
o.AccountSid = builder.Configuration["SmsBridge:Providers:twilio:AccountSid"];
o.AuthToken = builder.Configuration["SmsBridge:Providers:twilio:AuthToken"];
o.From = builder.Configuration["SmsBridge:Providers:twilio:From"];
});
Or bind entirely from configuration:
builder.Services.AddSmsBridge(
builder.Configuration.GetSection("SmsBridge"));
2. Inject and send
public sealed class NotificationService(ISmsClient smsClient)
{
public async Task SendOtpAsync(string phoneNumber, string code, CancellationToken ct = default) =>
await smsClient.SendAsync(new SmsMessage
{
To = phoneNumber,
Body = $"Your verification code is {code}"
}, ct);
}
Your application code depends only on ISmsClient. It never imports a provider namespace.
Configuration-Based Provider Switching
Configure both providers, then switch by changing one value:
{
"SmsBridge": {
"DefaultProvider": "twilio",
"Providers": {
"twilio": {
"Type": "Twilio",
"AccountSid": "...",
"AuthToken": "...",
"From": "+447700900000"
},
"vonage": {
"Type": "Vonage",
"ApiKey": "...",
"ApiSecret": "...",
"From": "MyApp"
}
}
}
}
To switch from Twilio to Vonage, change:
"DefaultProvider": "vonage"
No application code changes.
Per-Message Provider Override
await smsClient.SendAsync(new SmsMessage
{
To = "+447700900000",
Body = "Hello",
Provider = "vonage" // override for this message only
});
Failover
builder.Services.AddSmsBridge(opts =>
{
opts.DefaultProvider = "twilio";
opts.EnableFailover = true;
opts.FailoverProvider = "vonage";
opts.Providers["twilio"] = new SmsProviderOptions { Type = SmsProviderType.Twilio };
opts.Providers["vonage"] = new SmsProviderOptions { Type = SmsProviderType.Vonage };
})
.UseTwilio("twilio", o => { ... })
.UseVonage("vonage", o => { ... });
When the primary provider returns a transient failure (5xx, throttling, network error), SMSBridge automatically retries via the failover provider. Application code is unchanged.
Supported Providers
| Provider | Status |
|---|---|
| Twilio | Supported |
| Vonage | Supported |
| MessageBird | Planned |
| AWS SNS | Planned |
| Infobip | Planned |
| Termii | Planned |
| Unifonic | Planned |
Roadmap
- MessageBird provider
- AWS SNS provider
- Infobip provider
- Termii provider
- Unifonic provider
- OpenTelemetry metrics
- Delivery receipt normalisation
- Webhook signature verification
- Database outbox pattern
- Advanced retry policies
- Background processing
Target Frameworks
- .NET 8
- .NET 9
Contributing
Contributions are welcome. See CONTRIBUTING.md for guidance.
Licence
MIT. See LICENSE.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- Microsoft.Extensions.Configuration.Abstractions (>= 9.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.0)
- Microsoft.Extensions.Http (>= 9.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.0)
- Microsoft.Extensions.Options (>= 9.0.0)
- Microsoft.Extensions.Options.DataAnnotations (>= 9.0.0)
- OpenTelemetry.Api (>= 1.16.0)
- System.Text.Json (>= 9.0.0)
-
net9.0
- Microsoft.Extensions.Configuration.Abstractions (>= 9.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.0)
- Microsoft.Extensions.Http (>= 9.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.0)
- Microsoft.Extensions.Options (>= 9.0.0)
- Microsoft.Extensions.Options.DataAnnotations (>= 9.0.0)
- OpenTelemetry.Api (>= 1.16.0)
- System.Text.Json (>= 9.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.