News KrakenD CE v2.7 released with better rate-limiting and security options

Improving The Developer Experience of Your APIs

by Matt Tanner

Jun 2, 2024

10 min read
post image
Contributor note
This is a guest post by Matt Tanner, Head of Developer Relations at Moesif, our advanced API Analytics, Governance, and Monetization partners. Matt utilizes his extensive experience to help developers and product managers optimize the Moesif platform.

As a modern organization, you’re likely building many APIs. Most are exposed internally and externally, allowing developers of varying backgrounds to leverage them. Building APIs developers love to use is the key to adoption, success, and growth. Suppose your business depends on APIs to drive functionality and revenue. In that case, an outstanding Developer Experience (DX) can be the difference between a thriving API ecosystem and one that struggles to get off the ground.

In this post, we’ll show you how to supercharge the DX of your APIs by combining the power of KrakenD Enterprise, a high-performance API gateway, with Moesif, an advanced API analytics, observability, and monetization platform. We’ll cover what DX means for APIs, how these tools work together, and how to use them to onboard, monitor usage, and create dashboards. We will also touch on opening up API monetization functionality that developers can easily use. By the end, you’ll have clear insights into what API consumers expect, how to measure DX against those expectations, and how to drive adoption. Let’s get started by looking closer at what Developer Experience consists of.

What is Developer Experience?

Developer Experience (DX) is the sum of all a developer’s interactions and perceptions when using a particular tool, platform, or service. It includes everything from the initial discovery and onboarding to ongoing usage, maintenance, and support. A good DX can be a powerful differentiator, making developers more likely to use your product, integrate it successfully, and recommend it to others.

The critical components of a good DX are:

  • Ease of Use: Intuitive interfaces, clear documentation, and helpful resources (such as tutorials) that reduce the learning curve.
  • Efficiency: Tools and processes that help to speed up development, debugging, and deployment so developers can be more productive.
  • Support: Fast and straightforward channels for help and communication when developers hit a snag or have a question.
  • Community: Opportunities for collaboration, knowledge sharing, and feedback from the developer community surrounding the product or platform.

A good DX is about empowering developers and making their lives easier. It’s about creating an environment where they can focus on building great products and services rather than fighting with complex tools or searching for information. The following section will explore what DX means for APIs and how it impacts your API projects.

How Does Developer Experience Apply to APIs?

Developer experience is only sometimes at the forefront of developers’ minds when creating APIs. We talk a lot about the most efficient ways to build APIs, and some of these methods do help with DX, but is it top-of-mind? When we think about APIs, DX is about making life easier for the developers who use those APIs. A good DX in the context of APIs means a frictionless journey for API consumers from the moment they discover your API to when they successfully onboard, integrate and begin using it in their applications.

Here’s how DX applies to APIs:

  • Discoverability: How easy is it for developers to find your API? Is it listed in directories and API marketplaces, in search engine results, and is it clearly described on your website and API docs?
  • Onboarding: Once a developer finds your API, how quickly can they start? Are there clear sign-up instructions, easy-to-follow documentation, and a sandbox to test?
  • Integration: How easy is it to integrate your API? Do you provide SDKs, libraries, or code samples in popular programming languages? Is the API documentation up to date?
  • Usage: How easy is the API to use? Does it follow common standards and best practices (e.g., RESTful principles)? Are error messages clear and helpful?
  • Maintenance: How do you handle changes to the API? Do you provide enough notice, transparent versioning, and migration guides?
  • Support: What resources are available to developers if they encounter a problem or question? Is there a support team, community forums, or comprehensive FAQ documentation?

When these things are done correctly, the benefits are wide-ranging. Developers using the APIs and the company building them see the following advantages:

  • Faster Time to Value: Developers can quickly get up and running with your API.
  • More Adoption: A good DX attracts more developers to your API and more usage.
  • Reduced Support Costs: Clear documentation and intuitive design mean fewer support requests and smoother integrations.
  • Happier Developers: Happy developers will continue to use your API, become advocates, and even provide feedback.

These benefits impact the technical and business aspects of operations. Reducing costs and increasing revenue are two metrics that many companies focus on as a critical measure of success. So how are you doing DX right? Metrics! By tracking key metrics, you can get a good idea of how well you are doing in all areas that DX touches. In the following sections, we’ll see how combining Moesif and KrakenD can help you benchmark and improve your API’s DX.

How Does Moesif Work With KrakenD to Track Developer Experience?

When creating a great developer experience, you need to be able to iterate. This typically requires a platform to publish, version, and secure your APIs and another platform to monitor key DX metrics. As critical metrics are monitored, improvements can be made to the APIs’ DK. KrakenD and Moesif are a powerful combination for understanding and improving your API’s DX. Let’s look closer at how they work together.

What is KrakenD?

KrakenD is a high-performance API gateway that sits between your API consumers and backend services. KrakenD’s platform offers API developers various features to help API developers, including:

What is Moesif?

Moesif is an API observability and analytics platform that captures, analyzes, and allows users to visualize API usage data. Moesif allows API developers and their businesses to unlock the following functionalities:

  • Deep API Insights: Track API call volume, latency, error rates, and usage patterns by user, company, or endpoint.
  • Custom Dashboards: Build dashboards to monitor the DX metrics that matter to you.
  • User Behavior Analysis: See how developers use your API and find pain points and opportunities for improvement.
  • Monetization: Create usage-based pricing models for your API.

Combining The Platforms

By integrating Moesif with your APIs running through KrakenD, you can quickly unveil the current state of your APIs DX. As KrakenD sends API traffic data to Moesif, organizations can start to stitch together crucial technical and business insights that contribute to DX. These include the ability to:

  • Track Onboarding: See how many developers sign up, make their first API call, and reach critical milestones in their integration journey.
  • Monitor API Usage: See how developers use your API, which endpoints are popular, and where potential issues (errors, high latency) are.
  • Find Pain Points: Identify areas where developers struggle (e.g., confusing docs, complex auth flow, unclear error messages).
  • Personalize: Create custom dashboards or reports for specific users or companies to provide tailored insights.
  • Measure DX Improvements: Track the impact of changes you make to your API or docs on key DX metrics (onboarding time, API usage, developer satisfaction).

By using the two platforms together, KrakenD provides the data, and Moesif provides the insights to identify DX wins and areas for improvement. By measuring and monitoring key metrics, organizations can make data-informed decisions about their APIs.

Adding Moesif to KrakenD

Integrating Moesif with your KrakenD API gateway is a straightforward process that quickly unlocks API analytics and DX insights. To combine the two platforms, here’s what’s required:

  1. Obtain Your Moesif Credentials:
  • Sign up for a Moesif account if you don’t already have one.
  • Retrieve your Moesif Application Id from the Moesif Dashboard
  1. Enable Moesif in KrakenD:
  • Ensure you’re using KrakenD Enterprise Edition, as the Moesif integration is an enterprise feature.
  • In your krakend.json configuration file, add the Moesif module under the extra_config section. Here is an example of what that would look like:
    {
       "version": 3,
       "extra_config": {
          "telemetry/moesif": {
          "@comment": "Push user activity to Moesif based on the information contained in JWT,
                       every second, in batches of 1000 events",
          "application_id": "yourapplicationid",
          "user_id_headers": [
             "Authorization"
          ],
          "user_id_jwt_claim": "sub",
          "identify_company": {
             "jwt_claim": "company_id"
          },
          "debug": false,
          "log_body": false,
          "event_queue_size": 1000000,
          "batch_size": 1000,
          "timer_wake_up_seconds": 1
          }
       }
    }
    Note that you’ll need to replace the yourapplicationid entry with the Application Id from your Moesif instance.
  1. Start Collecting Data:
  • Once the configuration is updated with Moesif and you restart KrakenD, it automatically sends API traffic data to Moesif in real time. Moesif will then process and analyze this data, making it available for you to explore in the Moesif platform.

Next, let’s examine some key DX reports that developers and API product owners can create in Moesif.

Building Out Reports To Track Developer Experience

Looking at DX requires assessing API traffic and interactions from multiple angles. This includes considering factors in onboarding, such as how long it takes for users to successfully make their first API call (TTFHW or Time to First Hello World), as well as longer-term metrics, such as how usage is growing or how users are being retained.

Luckily, by bringing data from your KrakenD-based APIs into Moesif, you can quickly build out reports and analyze API traffic that can help identify areas of potential improvement for your API DX. Below are a few critical reports that API developers can focus on to ensure that their API DX is dialed in.

Onboarding

In Moesif, using a User Funnel report, developers can examine various stages in their onboarding flow. For instance, below is an example of an E-signature API funnel, where we can see the number of users who move through sign-up and complete their 10th E-sign API call.

User funnel analytics

The chart shows that 43.06% of users who sign up make their first API call, and on average, it takes 3 days + 3 hours to do so. From a DX perspective, this can help you establish a baseline for your conversions and see if any changes you make in the onboarding flow have impacted conversion rates. It also allows you to take a high-level look at how easy your APIs are to use. For instance, the chart above shows that going from sign-up to the first API call takes quite a while. This is a potential signal of poor DX and can give a starting point for investigation.

Usage

Great DX also generally leads to an uptick in API usage. You can use a Time Series chart to check each user or company’s API usage trends. Below is an example of a chart showing API usage grouped by company.

API Usage Monitoring

User/Company Dashboards

If a user or company should be honed in on, either because of increased or decreased usage, you can inspect their profile as a whole through their user or company dashboard. These dashboards give a holistic view of everything from their API call volume to error rates, growth rates, and much more.

User / Company dashboards

Monetization

API developers also want to grow their revenue as they grow their user base. Using Moesif to monetize APIs, you can see how the metrics above and DX are impacting your organization’s bottom line. In the chart below, we can see the particulars around a company’s usage when it comes to revenue.

API Monetization Analytics

Of course, these charts and analyses are just the tip of the iceberg when investigating and refining the DX strategy for your APIs. By bringing your API traffic data from KrakenD into Moesif, you can quickly explore and improve your API DX’s current state.

Conclusion

In this blog, we covered how to use KrakenD and Moesif to improve the Developer Experience of your APIs. By taking a deep look into DX, you can enhance the experience of developers using your APIs, reduce customer success and support costs, bump up your revenue, and so much more. It shows you how DX, mainly when applied to APIs, is a crucial area for organizations to pay attention to and strive to improve.

Want to supercharge your API DX? Request a demo to see KrakenD Enterprise and Moesif in action together. Our seamless integration will have you up and running in minutes, providing you with the advanced tools you need to elevate your API strategy.

Scarf
 Stay up to date with KrakenD releases and important updates