Why you need a Package Manager for APIs - WunderGraph

State of GraphQL Federation 2026

Jens Neuse

CEO & Co-Founder at WunderGraph

April 14, 2021·min read
Last updated on July 18, 2026

This article is archived and no longer maintained. It describes an earlier version of WunderGraph built around the WunderNode and a "package manager for APIs" concept, which is no longer part of the current product. The examples and setup steps may not work as described. For current documentation and guidance, see current docs.

TL;DR

The post builds one example app, a weather API plus a jobs API in Next.js, and compares three ways to integrate them: client-side, server-side (the BFF pattern), and WunderGraph as a "package manager for APIs." Client-side integration is the easiest to start with but creates tight coupling, can't store secrets securely, and piles on boilerplate. A BFF removes the tight coupling and centralizes authentication and caching, but you pay for it in implementing, deploying, and maintaining the backend. The package-manager approach aims to give you the BFF pattern at lower cost: you declare your API dependencies in a config file, WunderGraph composes them into a virtual GraphQL schema, and it generates the BFF (hosted on the edge) plus a thin, typesafe client that handles login, caching, and invalidation, so you get authentication and edge caching by configuration with zero boilerplate.

Client-side integration

Client-side integration is one of the easiest approaches which also comes with some drawbacks. In this scenario, the application code sits side by side with the two clients, one for each API. It's clear that the client application talks directly to the APIs, creating a tight dependency between them.

Pros

Cons

Server-side integration

The second approach we'd like to look at is server-side integration. This pattern is also well known as "Backend for Frontend" (BFF). We're essentially moving the complexity of the integration to a secure server. This adds complexity but comes with a lot of benefits.

In this scenario, the client application only has a single API client which is talking to the BFF. The BFF consists of all the business logic, implements authentication & caching and contains API clients for both upstream APIs. The BFF secures access to the APIs and can apply general rules to both of them.

Pros

Cons

WunderGraph integration

As stated above, implementing a BFF is a very clean and easy to maintain architecture to solve a common problem. Our goal is to use the BFF pattern but reduce implementation and maintenance cost while increasing the developer experience. What is a package manager for APIs?

What is a Package Manager for APIs?

Throughout our careers, we had to solve many problems similar to the scenario described above. The problem is always the same: Get data from x different services that speak y different protocols. Compose all APIs together, secure the communication and make sure that content that can be cached will be cached to ensure good performance.

Getting data from different services and composing it together to form something new should sound very familiar to developers. Package managers help us bring all the dependencies into one place to build something new on top of them. We don't have to manually install code from others.

Yet, when it comes to APIs, we still live in a cave. If you're super lucky, someone pushed an OpenAPI specification somewhere. Or maybe you have to deal with a SOAP WSDL? What about GraphQL? When you deal with high class products like e.g. Stripe you're lucky because they offer an SDK, but does that really solve the problem?

All our Dependencies (APIs) are on the right. WunderGraph composes them into a virtual GraphQL schema. WunderGraph supports REST APIs (via OpenAPI Specification), GraphQL and Federation and can be extended for any other Protocol. The specifications of the origins will be automatically transformed into a virtual GraphQL schema. GraphQL has a very expressive type system and allows us to query exactly the data we need.

The WunderGraph client

The BFF alone wouldn't fully solve the problem. We still need a client in our frontend application. However, you also don't have to worry about the client. We're generating the client for you. The client is very thin but super smart. It knows how to log your users in and out. It knows how to cache data and when and how to invalidate it. Of course, the client also knows about all the operations, their inputs and how the responses will look like.

Pros of WunderGraph integration

Frequently Asked Questions (FAQ)

What are the drawbacks of client-side integration?

What is the "Backend for Frontend" (BFF) approach?

What is the downside of building a BFF?

What is a package manager for APIs?

What does WunderGraph generate?