Member-only story

The right way to build a TypeScript SDK

Himanshu Singh
12 min readApr 5, 2025

--

Hello there 👋,
I am Himanshu Singh. I am an Engineer working in a Web3 organization.

A few weeks back, I was assigned the task of building a TypeScript SDK for the backend services we were working on. I was fully accountable for that task, so I wanted to do it the right way. To do it, I read many resources, checked existing open-source repositories for examples, and finally did it.

I made the SDK to support CommonJS and ES Modules. I wrote the examples, added the integration tests, and added the type docs. In the end, it looked good.

In this blog, I thought to write about that. So, I will write about how I did it. I can’t share the repo I worked for the organization as it’s private, so you will find an example repo, that I am building while writing this blog.

Let’s begin 🍻!

First Things First

Why do we even need an SDK?
Suppose you are building a backend service, and the service gonna expose a bunch of APIs for its end users to use the features provided by the service itself.

Now, one way to use your service is by using the raw APIs, but the issue with that is, that the API user will have to do all the heavy work of using the APIs the right way, if it needs…

--

--

Himanshu Singh
Himanshu Singh

Written by Himanshu Singh

I write blogs around React JS, JavaScript, Web Dev, and Programming. Follow to read blogs around them.

Responses (1)