Publishing My First NuGet Package! (And the mistake I made)

I've been playing a lot of Path of Exile 1 and 2 recently, and like any developer, my first thought was, "I should build an app for this!" To do that, I wanted a clean, reusable library to handle API calls. But I immediately hit a major snag: How do you build and test a library for an API you can't actually call?

For a few years now, I've messed around with projects using Blizzard's World of Warcraft API, and I always relied on a fantastic wrapper package that saved me from setting up HTTP clients and memorizing endpoints. It was easy and super helpful.

This is where I got the inspiration for "Wraeclib". A .NET wrapper for Grinding Gear Games' API for Path of Exile 1 and 2. I wanted to abstract away the boilerplate logic and make my future app's code cleaner. Originally, it was just for me, but I thought, "Why not?" and decided to publish it to NuGet. 😎

The Big Roadblock (and my "Dumb Mistake")

To interact with the GGG API, you have to get approval by emailing them with your app plan and required scopes. Only then can you create an OAuth token.

This was a problem. I wasn't building a full app yet; I was building a library. I needed to validate that my library worked against all their endpoints, but I didn't want to email GGG asking for a god-mode token.

Stuck, I sent them an email asking what I should do. Their response was simple: "Look at the developer docs."

I'd been reading the docs, but that's when I realized my dumb mistake. I was so focused on live testing that I'd completely missed the fact that GGG provides the exact expected return values and object compositions for every single endpoint! 🤦‍♂️🤦‍♂️🤦‍♂️🤦‍♂️

I didn't need a live token or a test playground. I could build out all my models and client logic based entirely on the "contract" provided in their documentation.

The Path Forward

Now that I have the docs, I've been building out the library, and it's been a pretty fun experience. It’s still a work in progress, as I’m working to support the remaining endpoints.

To make life easier, I also built a full CI/CD pipeline in GitHub. Whenever I feel I've made sufficient changes, I can create a new tag, and it automatically builds and publishes the new version to NuGet.

It's been a fun project, and a great lesson in how much good it does when you actually read the documentation. 😄

(A quick tech note: GGG doesn't split its API between games. PoE 1 has realms like "PC", "Sony", and "Xbox". PoE 2 is cross-platform, so its realm is simply "POE2". Most endpoints don't support POE2 just yet, but the structure is there.)