You’re probably making an API client
summary
An API client for Algolia exposes one-line wrappers over fetch, handles credentials via a client object, and uses objects-as-named-arguments so adding options stays backward compatible. It separates a single request function (injectable per environment) from higher-level methods, avoids CORS preflight by minimizing headers and methods, and provides an escape hatch as request options. Usage is measured with a tiny usage beacon image endpoint, tests mock the network layer and reserve a few functional tests against the real public API.
AI-written summary · about
chapters (17)
- 0:00Intro
- 1:59What is an API?
- 6:34Minimum Viable Product
- 7:31What I've learned
- 8:18Handle credentials
- 9:42Use "named" arguments
- 10:22Use the same names as your API
- 11:25Fill the gaps in the API
- 13:10Allow overriding
- 15:00Separate request from wrappers
- 16:51Everything is async
- 17:48Know one layer of abstraction lower
- 19:05SimpleRequests
- 20:28Removing code!
- 25:28Testing
- 27:55You can cheat
- 28:15Overview
related talks
35mDeveloping a Go API client: the do's and don'ts
23mOBJECT ALGEBRAS AND WHY YOU WON'T TOUCH HTTP LIBRARY EVER AGAIN
47mAPI Tips from the Frontline
35mBuilding Your API for Longevity
20mPotential of API integrations, common traps and advices
27mBuilding Great Web APIs
31mGraphQL: how to make clients enjoy using your API
21mHow to empower developers to build a greater user experience
