Product Releases
April 24, 2024
4 min read

Introducing Insomnia 9.0 with Pre-request Scripting, Improved Offline Access, API Mocking, and 100+ Improvements

Marco Palladino
CTO and Co-Founder

Kong Insomnia 9.0 is now generally available for download. It ships with many new features and improvements — over one hundred improvements in total!

This new version of Kong Insomnia also makes it much easier to migrate from other products with a more reliable “import” experience, while improving the speed of using the product and making it more customizable. Let’s dive into all the notable features.

Pre-request scripting

Insomnia 9.0 ships with the much anticipated pre-request scripting capability, allowing you to write a custom script in JavaScript before testing a request in a collection.

The pre-request scripting capability allows you to be in full control of a request lifecycle by programmatically building more complex behavior. This includes the ability to make other HTTP requests to retrieve an authentication token from a third party before submitting the original request, or orchestrating multiple requests together. It also allows users to modify the current requests programmatically in a variety of ways by accessing parameters and environment variables directly.

Insomnia’s pre-request scripts are compatible with Postman. This means that, in most scenarios, you’ll be able to copy-paste your existing pre-request scripts from Postman into Insomnia, and they'll work seamlessly.

Improved offline access

In this new 9.0 release, we’ve significantly improved the offline usage of Insomnia for those users who are working in restricted environments or have an unreliable internet connection:

  • Users are not required to log in every time the application starts. Instead, we’ll remember the user session for 30 days in the desktop application and avoid requesting they log in again during that time frame.
  • We’ve also improved the experience when starting the application while being offline, by removing an application error that used to pop up when starting the application.

We've resolved an issue when starting Insomnia while offline.

Of course, the Scratch Pad is available for usage offline as well and without an account, and whether you decide to log in to your account or not, the data can be still stored fully locally based on your project settings. Data can be stored in the following backends on a per-project basis:

  • In the cloud via Cloud Sync for ease of collaboration and fully encrypted
  • Fully locally via Local Vault to keep data entirely local even after logging in
  • On a third-party Git repository via Git Sync that doesn’t require cloud access

ℹ️ Your data can be local even after logging in to Insomnia.

With Insomnia, you’re in full control of where your data — like collections and test and design documents — are stored.

Additionally, Insomnia organization owners can also fully mandate top-down storage backends for all an organization’s projects using Storage Control. By doing so, the collaborators of an organization are forced to store their data in the desired storage type.

API mocking

Insomnia's capabilities just got better with the release of our built-in API mocking feature that can be used in the cloud or locally. This means that you can now use Insomnia to:

  1. Design APIs
  2. Debug APIs
  3. Test APIs
  4. Mock APIs
  5. Implement CI/CD automation with the Insomnia CLI to run tests and linting for QA.

With API mocking, teams can reduce the coordination required between the backend and frontend by creating API mock routes with a predefined response and status code — on a custom route that we can configure — so that you can start building on top of an agreed-upon API interface even before the underlying API implementation is complete.

API mocks can be seamlessly hosted in the cloud by Insomnia for ease of sharing and collaboration, or they can run on a self-hosted mock server locally for full control.

When working across several different projects and organizations, it can be challenging to search for what you're looking for. To make it easier to find your collections, tests, design specs (and now API mocks too) we have introduced a new global search function that will search for your files across every Insomnia organization.

This capability will improve your productivity and make it even easier to immediately find what you're looking for.

Improved collaboration and more

When collaborating with either Cloud Sync or Git Sync, you can now better visualize what changes are being committed and pushed using the new in-app diff viewer.

Also, we're now automatically pulling files like collections, documents, mocks, and tests in the dashboard without the need to manually pull them yourself. These files will show as “Unsynced” and will be fully downloaded simply by clicking on them.

You can now also hide the “Organizations” sidebar by using the new toggle in the footer of Insomnia, and show it again by pressing the button again. This allows you to have more screen space to debug your collections.

The future of Insomnia

We have doubled down on the shipping velocity of Insomnia, and in the following months, you will see even more capabilities like:

🔮 Post-request scripting (shipping very soon)

🔮 Multiple tabs

🔮 Folder-level authentication and settings

🔮 Git Sync on a per-project basis

🔮 Global environment variables

🔮 A new YAML format for collaborating better in Insomnia

🔮 A more advanced RBAC for collaboration

🔮 A revamped plugin ecosystem

🔮 And more!

This wouldn’t have been possible without the changes made last year to drive the product to a path of sustainable development and growth, and we're driving the roadmap based on the feedback received on GitHub issues and discussions. So please send your feedback and suggestions, since there's a high likelihood that they will be built for the upcoming releases.

Get started for free with Kong Insomnia 9.0 today.