Skip to content

Built-in Extensions

APIful ships three handler extensions. Each one gives the client a different call signature, so the choice comes down to how you want to write a request:

ExtensionA request looks likeReach for it when
ofetchclient('users/1', { method: 'GET' })You want fetch with less ceremony, or you are just starting out
OpenAPIclient('/user/{username}', { path: { username: 'ada' } })Your API publishes an OpenAPI schema and you want paths, bodies, and responses typed
API Routerclient.users(1).posts.get()Your API has deep, predictable REST paths

All three wrap ofetch, so they share its options, its error behavior, and its hooks.

A client takes one handler extension. To combine one of these with methods of your own, chain a methods extension after it – see how extensions work.