Kt. Academy

Blog with mission to simplify Kotlin learning

Follow publication

New features just dropped in Inspektify

Since the public release of Inspektify, our Kotlin Multiplatform (KMP) network inspection library, a lot has changed and improved with it. Today, I’m excited to announce a new update that introduces several new features, making network debugging and inspection easier for teams working with Kotlin Multiplatform projects.

In this article, I will walk you through the latest features in Inspektify version 1.0.0-beta03, including:

  • Support for Desktop Target
  • Retention Policy Settings
  • Enhanced Search with Suggestion Chips
  • Share Network Transactions Details
  • Generating cURL Commands for Network Transactions

Let’s dive in and explore what’s new!

1. Support for Desktop Target

One of the requested features was adding support for Desktop targets. With this new release, I am excited to announce that Inspektify now also works with Desktop targets!

What Developers Need to Know for Desktop Targets

With the addition of desktop support, developers now have an easy way to monitor and inspect network traffic directly within desktop applications. Inspektify implements its default behavior for opening the Inspektify window, making it easy to access the network inspection tool without extra configuration. On mobile devices, the debug window opens by shaking your phone, and the debug window is opened. However, for desktop apps, detecting a ‘shake’ event isn’t possible. That’s why we’ve implemented a default keyboard shortcut for the desktop environment.

By default, you can open the Inspektify window using the keyboard shortcut: Control + Shift + D. This shortcut works right out of the box, allowing quick access to the network inspector on desktop targets.

Customization Options:

If you prefer to customize how and when the Inspektify window opens, you can override this behavior for desktop targets. By changing the PresentationType configuration to Custom, you gain full control when and where the Inspektify window appears. Just make sure to include the following call to open the Inspektify window as part of your custom solution.

InspektifyKtor.startInspektify()

2. Retention Policy Settings

In the first version of the Inspektify library, the only way to remove cached network traffic data was by manually clicking the delete button. Now, Inspektify introduces Retention Policy Settings and gives you the flexibility to automatically remove network traffic that is no longer relevant.

Key features of the Retention Policy:

  • Session-based Retention: You can specify how many sessions to retain, with a limit of 1 to 20 sessions. For example, if you want to keep data from the last 5 sessions, Inspektify will automatically remove older sessions once the limit is reached. This ensures that only the most recent and relevant data is preserved.
  • Time-based Retention: Alternatively, you can set the retention period based on days, with the option to retain data from 1 to 14 days. Once the specified number of days has passed, older data is automatically deleted, keeping your database clean and focused on recent network traffic.

How to use it:

You can configure the retention policy in your setup code. Here’s an example of how to set the retention policy to keep data from the last 3 sessions:

install(InspektifyKtor) {
dataRetentionPolicy = DataRetentionPolicy.SessionCount(3)
}

And here’s an example of how to set it to retain data for 7 days:

install(InspektifyKtor) {
dataRetentionPolicy = DataRetentionPolicy.DayDuration(7)
}

3. Enhanced Search with Suggestion Chips

Navigating through a large list of network transactions can be time-consuming, but Inspektify makes it easier with a new search feature. On the network transaction list screen, you can quickly search for specific network requests using keywords.

To make searching even more efficient, Inspektify also provides suggestion chips. These suggestion chips are automatically generated based on the entire list of network transactions. The library scans the request method names (like GET, POST, etc.) and status responses (such as 200, 404, etc.), creating quick access buttons (chips) that you can tap or click to filter your transactions.

This allows you to instantly narrow down your search based on method types or response statuses, saving you time and helping you find the exact data you need.

Search with suggestion chips

4. Share Network Transactions Details

We know that sharing network insights with team members or reporting bugs is an essential part of the development process. With this update, Inspektify provides an easy way to share the details of a single network transaction.

How it works:

You can now share any recorded network transaction directly from the Network transaction details screen. This feature allows you to send detailed information about a specific transaction (including headers, response data, and more) to your team or a third-party service with just a few clicks.

5. Generate cURL Commands for Network Transactions

When debugging APIs, it’s often helpful to replicate network calls outside your app. To make this easier, Inspektify now provides the option to generate and share a cURL command for any network transaction.

What is cURL and why is it useful?

cURL is a command-line tool used to make HTTP requests. By generating a cURL command from Inspektify, you can quickly replicate network requests in the terminal, test your API endpoints, or share it with other developers for faster debugging.

How to use it:

In the network transaction details screen, simply select the button labeled cURL. Inspektify will automatically generate a ready-to-use cURL command, which you can share on mobile targets or paste directly into your terminal app if you use desktop targets.

Wrapping Up

These new features make Inspektify more powerful than ever before, expanding its reach to desktop platforms, giving you greater control over the tool, and making it easier to share and replicate network transactions.

Inspektify is constantly evolving, and your feedback is invaluable. If you have any suggestions for new features or enhancements, please feel free to leave a comment.

Github repo:

Learn @ Kt.Academy

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Written by Blaž Vantur

Experienced Mobile Developer with an 12-year long history of working in the computer software industry. Skilled in Kotlin, Java, Android, Swift, and iOS.

No responses yet

Write a response