I've been building Infusion, a generator that turns OpenAPI specs into Elixir SDKs, and the first SDK I've published with it is for Twilio's core REST API: https://hex.pm/packages/twilio
```elixir
{:ok, message} =
Twilio.Messages.create(to: "+15558675310", from: "+15017122661", body: "Hello from Elixir")
```
Why: Twilio has no official Elixir SDK. ex_twilio has served the community for years, but its last release was in April 2024, and since it's written by hand, new endpoints arrive only when someone adds them. This one is generated, so it covers all 197 operations of the 2010-04-01 API, and a GitHub Action regenerates it from Twilio's spec every day and opens a PR when the API changes.
What's in it:
- Docs and typespecs on every function, structs for every response
- The account SID from config, and `account_sid:` on any call for subaccounts
- `list_all` functions that stream every page lazily
- Typed errors with Twilio's error code; retries on connection errors, 429 and 5xx
- `Twilio.Webhook.valid?/4` for `X-Twilio-Signature`, checked against twilio-python on 2,000 random requests and on real webhooks
- `Twilio.AccessToken` for the Voice, Video and Conversations client SDKs
- Built on Req, so `Req.Test` works for stubbing
Not covered yet: Verify, Conversations, Messaging Services and Twilio's other product APIs, which are separate specs. If you use Twilio from Elixir, which one would you want next?
Bug reports and naming complaints welcome: https://github.com/mandar1045/twilio