Skip to the content.

Getting Started

Install

dotnet add package SmsBridge

Register

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"];
    });

Send

public sealed class MyService(ISmsClient smsClient)
{
    public async Task NotifyAsync(string phone, string message) =>
        await smsClient.SendAsync(new SmsMessage { To = phone, Body = message });
}

Your application code depends only on ISmsClient. It never references a provider type.