{"id":21602386,"url":"https://github.com/a-patel/litexsms","last_synced_at":"2025-07-16T01:17:03.937Z","repository":{"id":109325715,"uuid":"132504313","full_name":"a-patel/LiteXSms","owner":"a-patel","description":"LiteXSms is simple yet powerful and very high-performance sms mechanism and incorporating both synchronous and asynchronous usage with some advanced usages which can help us to handle sending sms more easier!","archived":false,"fork":false,"pushed_at":"2022-05-17T16:19:43.000Z","size":106,"stargazers_count":4,"open_issues_count":4,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-06-12T15:51:36.884Z","etag":null,"topics":["asp-net-core","aspnet-core","aspnetcore","csharp","message","netcore","nexmo","nexmo-sms","nuget","plivo","plivo-sms","sinch","sinchsms","sms","sms-api","sms-gateway","smshelper","smsutility","twilio","twilio-sms"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/a-patel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-05-07T19:01:08.000Z","updated_at":"2020-12-08T20:13:00.000Z","dependencies_parsed_at":"2023-04-22T16:00:53.358Z","dependency_job_id":null,"html_url":"https://github.com/a-patel/LiteXSms","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/a-patel/LiteXSms","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a-patel%2FLiteXSms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a-patel%2FLiteXSms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a-patel%2FLiteXSms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a-patel%2FLiteXSms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/a-patel","download_url":"https://codeload.github.com/a-patel/LiteXSms/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a-patel%2FLiteXSms/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265281064,"owners_count":23739860,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["asp-net-core","aspnet-core","aspnetcore","csharp","message","netcore","nexmo","nexmo-sms","nuget","plivo","plivo-sms","sinch","sinchsms","sms","sms-api","sms-gateway","smshelper","smsutility","twilio","twilio-sms"],"created_at":"2024-11-24T19:13:15.147Z","updated_at":"2025-07-16T01:17:03.882Z","avatar_url":"https://github.com/a-patel.png","language":null,"funding_links":["https://www.paypal.me/iamaashishpatel","https://www.buymeacoffee.com/iamaashishpatel","https://www.patreon.com/iamaashishpatel"],"categories":[],"sub_categories":[],"readme":"# LiteXSms\n\n\u003e LiteXSms is simple yet powerful and very high-performance sms sending mechanism and incorporating both synchronous and asynchronous usage with some advanced usages which can help us to handle sending sms more easier!\n\n\n\nProvide sms service for ASP.NET Core (2.0 and later) applications.\n\nSmall library to abstract sms functionalities. Quick setup for any sms provider and very simple wrapper for the widely used sms providers. LiteXSms uses the least common denominator of functionality between the supported providers to send sms solution. Abstract interface to implement any kind of basic sms services. Having a default/generic implementation to wrap the Twilio, Plivo, Nexmo, Sinch. A sms abstraction.\n\nVery simple configuration in advanced ways. Purpose of this package is to bring a new level of ease to the developers who deal with different sms provider integration with their system and implements many advanced features. You can also write your own and extend it also extend existing providers. Easily migrate or switch between one to another provider with no code breaking changes.\n\nLiteXSms is an interface to unify the programming model for various sms providers. The Core library contains all base interfaces and tools. One should install at least one other LiteXSms package to get sms implementation.\n\n\n\n\n\n## Cache Providers :books:\n\n- [Twilio](docs/Twilio.md) [![](https://img.shields.io/nuget/dt/LiteX.Sms.Twilio.svg)](https://www.nuget.org/packages/LiteX.Sms.Twilio/) [![](https://img.shields.io/nuget/v/LiteX.Sms.Twilio.svg)](https://www.nuget.org/packages/LiteX.Sms.Twilio/)\n- [Plivo](docs/Plivo.md) [![](https://img.shields.io/nuget/dt/LiteX.Sms.Plivo.svg)](https://www.nuget.org/packages/LiteX.Sms.Plivo/) [![](https://img.shields.io/nuget/v/LiteX.Sms.Plivo.svg)](https://www.nuget.org/packages/LiteX.Sms.Plivo/)\n- [Nexmo](docs/Nexmo.md) [![](https://img.shields.io/nuget/dt/LiteX.Sms.Nexmo.svg)](https://www.nuget.org/packages/LiteX.Sms.Nexmo/) [![](https://img.shields.io/nuget/v/LiteX.Sms.Nexmo.svg)](https://www.nuget.org/packages/LiteX.Sms.Nexmo/)\n- [Sinch](docs/Sinch.md) [![](https://img.shields.io/nuget/dt/LiteX.Sms.Sinch.svg)](https://www.nuget.org/packages/LiteX.Sms.Sinch/) [![](https://img.shields.io/nuget/v/LiteX.Sms.Sinch.svg)](https://www.nuget.org/packages/LiteX.Sms.Sinch/)\n\n\n\n## Features :pager:\n\n- Async compatible\n- Thread safe, concurrency ready\n- Multiple provider support (using provider factory)\n- Obsolete sync methods\n- Interface based API to support the test driven development and dependency injection\n- Leverages a provider model on top of ILiteXSmsSender under the hood and can be extended with your own implementation\n- Voice Sms\n\n\n\n## Basic Usage :page_facing_up:\n\n### Step 1 : Install the package :package:\n\n\u003e Choose one kinds of sms provider type that you needs and install it via [Nuget](https://www.nuget.org/profiles/iamaashishpatel).\n\u003e To install LiteXSms, run the following command in the [Package Manager Console](http://docs.nuget.org/docs/start-here/using-the-package-manager-console)\n\n```Powershell\nPM\u003e Install-Package LiteX.Sms.Twilio\nPM\u003e Install-Package LiteX.Sms.Plivo\nPM\u003e Install-Package LiteX.Sms.Nexmo\nPM\u003e Install-Package LiteX.Sms.Sinch\n```\n\n### Step 2 : Configuration 🔨\n\n\u003e Different types of sms provider have their own way to config.\n\u003e Here are samples that show you how to config.\n\n##### 2.1 : AppSettings\n\n```js\n{\n  //LiteX Twilio Sms settings\n  \"TwilioConfig\": {\n    \"AccountSid\": \"--- REPLACE WITH YOUR Twilio SID ---\",\n    \"AuthToken\": \"--- REPLACE WITH YOUR Twilio Auth Token ---\",\n    \"FromNumber\": \"--- REPLACE WITH Twilio From Number ---\",\n    \"EnableLogging\": true\n  },\n\n  //LiteX Plivo Sms settings\n  \"PlivoConfig\": {\n    \"AuthId\": \"--- REPLACE WITH YOUR Plivo Account SID ---\",\n    \"AuthToken\": \"--- REPLACE WITH YOUR Plivo Auth Token ---\",\n    \"FromNumber\": \"--- REPLACE WITH Plivo From Number ---\",\n    \"EnableLogging\": true\n  },\n\n  //LiteX Nexmo Sms settings\n  \"NexmoConfig\": {\n    \"ApiKey\": \"--- REPLACE WITH YOUR Nexmo ApiKey ---\",\n    \"ApiSecret\": \"--- REPLACE WITH YOUR Nexmo ApiSecret ---\",\n    \"ApplicationId\": \"--- REPLACE WITH YOUR Nexmo ApplicationId ---\",\n    \"ApplicationKey\": \"--- REPLACE WITH YOUR Nexmo ApplicationKey ---\",\n    \"FromNumber\": \"--- REPLACE WITH Nexmo From Number ---\",\n    \"EnableLogging\": true\n  },\n\n  //LiteX Sinch Sms settings\n  \"SinchConfig\": {\n    \"ApiKey\": \"--- REPLACE WITH YOUR Sinch ApiKey ---\",\n    \"ApiSecret\": \"--- REPLACE WITH YOUR Sinch ApiSecret ---\",\n    \"FromNumber\": \"--- REPLACE WITH Sinch From Number ---\",\n    \"EnableLogging\": true\n  }\n}\n```\n\n\n##### 2.2 : Configure Startup Class\n\n```cs\npublic class Startup\n{\n    public void ConfigureServices(IServiceCollection services)\n    {\n        #region LiteX Sms (Twilio)\n\n        // 1. Use default configuration from appsettings.json's 'TwilioConfig'\n        services.AddLiteXTwilioSms();\n\n        //OR\n        // 2. Load configuration settings using options.\n        services.AddLiteXTwilioSms(option =\u003e\n        {\n            option.AccountSid = \"\";\n            option.AuthToken = \"\";\n            option.FromNumber = \"\";\n            option.EnableLogging = true;\n        });\n\n        //OR\n        // 3. Load configuration settings on your own.\n        // (e.g. appsettings, database, hardcoded)\n        var twilioConfig = new TwilioConfig()\n        {\n            AccountSid = \"\",\n            AuthToken = \"\",\n            FromNumber = \"\",\n            EnableLogging = true\n        };\n        services.AddLiteXTwilioSms(twilioConfig);\n\n        #endregion\n\n        #region LiteX Sms (Plivo)\n\n        // 1. Use default configuration from appsettings.json's 'PlivoConfig'\n        services.AddLiteXPlivoSms();\n\n        //OR\n        // 2. Load configuration settings using options.\n        services.AddLiteXPlivoSms(option =\u003e\n        {\n            option.AuthId = \"\";\n            option.AuthToken = \"\";\n            option.FromNumber = \"\";\n            option.EnableLogging = true;\n        });\n\n        //OR\n        // 3. Load configuration settings on your own.\n        // (e.g. appsettings, database, hardcoded)\n        var plivoConfig = new PlivoConfig()\n        {\n            AuthId = \"\",\n            AuthToken = \"\",\n            FromNumber = \"\",\n            EnableLogging = true\n        };\n        services.AddLiteXPlivoSms(plivoConfig);\n\n        #endregion\n\n        #region LiteX Sms (Nexmo)\n\n        // 1. Use default configuration from appsettings.json's 'NexmoConfig'\n        services.AddLiteXNexmoSms();\n\n        //OR\n        // 2. Load configuration settings using options.\n        services.AddLiteXNexmoSms(option =\u003e\n        {\n            option.ApiKey = \"\";\n            option.ApiSecret = \"\";\n            option.ApplicationId = \"\";\n            option.ApplicationKey = \"\";\n            option.FromNumber = \"\";\n            option.EnableLogging = true;\n        });\n\n        //OR\n        // 3. Load configuration settings on your own.\n        // (e.g. appsettings, database, hardcoded)\n        var nexmoConfig = new NexmoConfig()\n        {\n            ApiKey = \"\",\n            ApiSecret = \"\",\n            ApplicationId = \"\",\n            ApplicationKey = \"\",\n            FromNumber = \"\",\n            EnableLogging = true\n        };\n        services.AddLiteXNexmoSms(nexmoConfig);\n\n        #endregion\n\n        #region LiteX Sms (Sinch)\n\n        // 1. Use default configuration from appsettings.json's 'SinchConfig'\n        services.AddLiteXSinchSms();\n\n        //OR\n        // 2. Load configuration settings using options.\n        services.AddLiteXSinchSms(option =\u003e\n        {\n            option.ApiKey = \"\";\n            option.ApiSecret = \"\";\n            option.FromNumber = \"\";\n            option.EnableLogging = true;\n        });\n\n        //OR\n        // 3. Load configuration settings on your own.\n        // (e.g. appsettings, database, hardcoded)\n        var sinchConfig = new SinchConfig()\n        {\n            ApiKey = \"\",\n            ApiSecret = \"\",\n            FromNumber = \"\",\n            EnableLogging = true\n        };\n        services.AddLiteXSinchSms(sinchConfig);\n\n        #endregion\n\n\n        // add logging (optional)\n        services.AddLiteXLogging();\n    }\n}\n```\n\n\n### Step 3 : Use in Controller or Business layer :memo:\n\n```cs\n/// \u003csummary\u003e\n/// Customer controller\n/// \u003c/summary\u003e\n[Route(\"api/[controller]\")]\npublic class CustomerController : Controller\n{\n    #region Fields\n\n    private readonly ILiteXSmsSender _smsSender;\n\n    #endregion\n\n    #region Ctor\n\n    /// \u003csummary\u003e\n    /// Ctor\n    /// \u003c/summary\u003e\n    /// \u003cparam name=\"smsSender\"\u003e\u003c/param\u003e\n    public CustomerController(ILiteXSmsSender smsSender)\n    {\n        _smsSender = smsSender;\n    }\n\n    #endregion\n\n    #region Methods\n\n    /// \u003csummary\u003e\n    /// Get Sms Provider Type\n    /// \u003c/summary\u003e\n    /// \u003creturns\u003e\u003c/returns\u003e\n    [HttpGet]\n    [Route(\"get-sms-provider-type\")]\n    public IActionResult GetSmsProviderType()\n    {\n        return Ok(_smsSender.SmsProviderType.ToString());\n    }\n\n    /// \u003csummary\u003e\n    /// Send sms\n    /// \u003c/summary\u003e\n    /// \u003cparam name=\"toPhoneNumber\"\u003eTo phone number\u003c/param\u003e\n    /// \u003cparam name=\"messageText\"\u003emessage text\u003c/param\u003e\n    /// \u003creturns\u003e\u003c/returns\u003e\n    [HttpPost]\n    [Route(\"send-sms\")]\n    public async Task\u003cIActionResult\u003e SendSms(string toPhoneNumber, string messageText)\n    {\n        toPhoneNumber = toPhoneNumber ?? \"+919426432254\";\n        messageText = messageText ?? \"I am LiteX Sms!\";\n\n        // async\n        var result = await _smsSender.SendSmsAsync(toPhoneNumber, messageText);\n\n        // sync\n        //var result = _smsSender.SendSms(toPhoneNumber, messageText);\n\n        return Ok(result);\n    }\n\n    #endregion\n}\n```\n\n\n\n## Todo List :clipboard:\n\n#### Sms Providers\n\n- [x] Twilio\n- [x] Plivo\n- [x] Nexmo\n- [x] Sinch\n\n\n#### Basic Sms API\n\n- [x] Send Sms\n- [] Voice Sms\n- [] Send Bulk Sms\n\n\n#### Coming soon\n\n- .NET Standard 2.1 support\n- .NET 5.0 support\n- Remove sync methods\n- Bulk Sms\n\n\n\n\n\n---\n\n\n\n\n\n## Give a Star! :star:\n\nFeel free to request an issue on github if you find bugs or request a new feature. Your valuable feedback is much appreciated to better improve this project. If you find this useful, please give it a star to show your support for this project.\n\n\n\n## Support :telephone:\n\n\u003e Reach out to me at one of the following places!\n\n- Email :envelope: at \u003ca href=\"mailto:toaashishpatel@gmail.com\" target=\"_blank\"\u003e`toaashishpatel@gmail.com`\u003c/a\u003e\n- NuGet :package: at \u003ca href=\"https://www.nuget.org/profiles/iamaashishpatel\" target=\"_blank\"\u003e`@iamaashishpatel`\u003c/a\u003e\n\n\n\n## Author :boy:\n\n* **Ashish Patel** - [A-Patel](https://github.com/a-patel)\n\n\n##### Connect with me\n\n| Linkedin | Website | Medium | NuGet | GitHub | Microsoft | Facebook | Twitter | Instagram | Tumblr |\n|----------|----------|----------|----------|----------|----------|----------|----------|----------|----------|\n| [![linkedin](https://img.icons8.com/ios-filled/96/000000/linkedin.png)](https://www.linkedin.com/in/iamaashishpatel) | [![website](https://img.icons8.com/wired/96/000000/domain.png)](https://aashishpatel.netlify.app/) | [![medium](https://img.icons8.com/ios-filled/96/000000/medium-monogram.png)](https://medium.com/@iamaashishpatel) | [![nuget](https://img.icons8.com/windows/96/000000/nuget.png)](https://nuget.org/profiles/iamaashishpatel) | [![github](https://img.icons8.com/ios-glyphs/96/000000/github.png)](https://github.com/a-patel) | [![microsoft](https://img.icons8.com/ios-filled/90/000000/microsoft.png)](https://docs.microsoft.com/en-us/users/iamaashishpatel) | [![facebook](https://img.icons8.com/ios-filled/90/000000/facebook.png)](https://www.facebook.com/aashish.mrcool) | [![twitter](https://img.icons8.com/ios-filled/96/000000/twitter.png)](https://twitter.com/aashish_mrcool) | [![instagram](https://img.icons8.com/ios-filled/90/000000/instagram-new.png)](https://www.instagram.com/iamaashishpatel/) | [![tumblr](https://img.icons8.com/ios-filled/96/000000/tumblr--v1.png)](https://iamaashishpatel.tumblr.com/) |\n\n\n\n## Donate :dollar:\n\nIf you find this project useful — or just feeling generous, consider buying me a beer or a coffee. Cheers! :beers: :coffee:\n\n| PayPal | BMC | Patreon |\n| ------------- | ------------- | ------------- |\n| [![PayPal](https://www.paypalobjects.com/webstatic/en_US/btn/btn_donate_pp_142x27.png)](https://www.paypal.me/iamaashishpatel) | [![Buy Me A Coffee](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/iamaashishpatel) | [![Patreon](https://c5.patreon.com/external/logo/become_a_patron_button.png)](https://www.patreon.com/iamaashishpatel) |\n\n\n\n## License :lock:\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa-patel%2Flitexsms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fa-patel%2Flitexsms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa-patel%2Flitexsms/lists"}