Skip to content

Introduction

What is Okapi?

Okapi (a reference to the animal also known as the forest or zebra giraffe) is a library that makes handling API and HTTP errors easy. It converts errors into a generic format that can be used in any way you like.

Why should I use Okapi?

Every request has several stages. It can be successful if everything goes right, or unsuccessful if problems occur along the way. In the latter case, it is necessary to understand why the request failed and inform your users. As a project grows, silent or less informative errors can cause major problems — developers don't have enough information to resolve issues properly, and users don't understand what has happened or what they should do. In the worst-case scenario, you or your company could even lose money. No one wants that, right? This is where Okapi comes into play.

It has many features that will make API and HTTP errors handling easy:

  • Framework agnostic: Use Vue, React, Angular or any kind of framework you like.
  • Type safe: Strong types give you enough info how to use a library in a better way.
  • i18n support: ¿Ha surgido algún problema? Users will know about errors in their language.
  • Fetch adapters: Go ahead and handle errors with a fetching approach you like the most. Didn't find yours? Just create it!
  • Customizable: Not enough built-in error kinds? Have a special errors validation case? Don't worry! This library was build to help you to follow your own way.