Writing Your Own Req Plugin - Jacob Swanner | ElixirConf US 2025
This talk was recorded at ElixirConf US 2025. If you’re curious about our upcoming event, check https://elixirconf.com✨
You’ve probably used Req—Elixir’s friendly, batteries-included HTTP client—to make an API call or two. It’s simple, powerful, and gets out of your way. But what happens when you need to call the same API over and over, or deal with something a little quirky—like a non-standard authentication flow or some repetitive request setup? Do you copy-paste the same code? Wrap it in a helper? There’s a better way.
In this talk, you’ll learn how to teach Req to do exactly what you need it to do. We’ll walk step-by-step through customizing Req’s behavior so you can handle requests your way—without boilerplate or hacks. Whether you want to simplify how you talk to a specific API, automate headers, or transform responses, you’ll see how easy and rewarding it is to extend Req.
If you’re new to Elixir or just starting to explore how to build cleaner, more reusable code around APIs, this talk will show you how to level up your Req skills and make your HTTP code both smarter and simpler.
Comments welcome! View the elixirconf tag for more ElixirConf talks!
2 Likes
Anybody having written some useful plugins for Req? I haven’t come across any use case for this yet but then again I haven’t thought much about this.
Useful is subjective, so I guess you can be the judge of that…
I’ve had to integrate with many different APIs, and so have packaged up some of the ways I’ve extended Req and released them as plugins.
ReqSSE for handing text/event-stream (aka Server-Sent Events) responses, this plugin will be made obsolete by Req v0.8
ReqClientCredentials for APIs that use OAuth 2.0 client credentials flow authentication
ReqWebSocket for establishing WebSocket connections, using Mint.WebSocket
1 Like