Insomnia+Resurface: API Usage Logger plugin
Tags: showdev, tooling, owasp, api
Published: 2021-08-24 20:51:11

## We have an Insomnia plugin!
It’s no surprise that API design platforms and clients like [Insomnia](https://insomnia.rest/) have become part of every developer's toolbox. Being able to create a collection of request templates for specific RESTful endpoints in a matter of seconds, and have them are ready for use with the click of a button is incredibly useful for testing, probing, designing, and even consuming APIs. We added API observability.

## We're Insomniacs
Insomnia’s GraphQL support in particular is superb. With integrated schema fetching, auto-complete and linting features, querying GraphQL endpoints has never been easier.

Another great aspect of Insomnia (and the folks at [Kong](https://konghq.com/)) is their support for Open Source Software, with initiatives such as plugins to extend Insomnia's functionality. With this, and as big fans of OSS ourselves, we decided that it was time Insomnia had yet another feature: A global API system of record.

## Design + API Observability
Not a lot of API design tools include observability features, and when they do it is usually part of an enterprise plan (often with a pay-per-request billing model). Currently, Insomnia offers a [somewhat hidden feature](https://github.com/kong/insomnia/issues/576), which shows past responses for a given request template. However, there is no place where you can quickly explore all the API calls that you've made, regardless of the endpoint. This could be very useful if you're trying to switch environments and compare results between servers. Furthermore, once a request template is deleted, this record is also gone. This can happen when either the individual request or the collection of requests are deleted, or even if any file in the workspace gets corrupted.

Enter **Resurface** for Insomnia: [Your very own API system of record](http://resurface.io). Resurface logs all the HTTP request-response pairs directly from Insomnia and shows them in a single place where you can explore each one, at any point in time. In addition, Resurface shows [hidden errors](https://www.youtube.com/watch?v=mRyP87SGCy0) that you might've missed the first time. Since Resurface works as an append-only database, there is no risk of overwriting or accidentally deleting any individual records. (BTW, OWASP recommends an [append-only database](https://owasp.org/www-project-top-ten/2017/A10_2017-Insufficient_Logging%2526Monitoring) for API security.) Resurface runs as a separate containerized solution, so if any Insomnia internal file gets corrupted or accidentally deleted, you will still be able to find all of your records safe and sound in Resurface. This also means that all of it runs locally, on your machine. No data is ever sent to Resurface Labs or anywhere else. The Resurface container is small and it doesn't consume a significant amount of resources.

We are very excited about this, so we've made a little get-started guide over at the Resurface GitHub repo for all the developers, testers, and API designers out there:

{% github resurfaceio/insomnia-plugin %}

Here's how-to video on installing the Insomnia plugin:

{% youtube OJQWt_FuPRk %}

You can also find the plugin on the Insomnia Plugin Hub: [API Usage Logger](https://insomnia.rest/plugins/insomnia-plugin-usage-logger)

Happy loggin'

Resurface Lumberjacks

P.S. If you are more on the server-side of things but still a Kong fan, [we also got you covered](https://github.com/resurfaceio/kong-plugin#readme)!

See original article [here](https://resurface.io/blog/resurface-insomnia-plugin).