npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

dhl-ts

v1.1.9

Published

Type-safe TypeScript SDK for DHL Shipment Tracking API

Readme


The Three DHL Clients

DHL is not one API.

So we didn’t build one client.

We built three.

Each one does one thing. Cleanly. Completely. Without surprises.


1. DHLExpress

Shipping lives here.

Rates. Shipments. Pickups. Duties.

This client talks only to MyDHL Express. It knows exactly how to authenticate. You don’t have to think about it.

You give it two things:

  • API Key
  • API Secret

Nothing else.

import { DHLExpress } from 'dhl-ts';

const express = new DHLExpress({
  apiKey: process.env.DHL_EXPRESS_KEY,
  apiSecret: process.env.DHL_EXPRESS_SECRET,
  environment: 'production'
});

Now do the work:

const landedCost = await express.getLandedCost({...});

That’s it.


2. DHLGlobalForwarding

Freight lives here.

Heavy shipments. Deep tracking. Logistics flows.

This client speaks directly to DHL Global Forwarding.

It needs one thing:

  • API Key
import { DHLGlobalForwarding } from 'dhl-ts';

const forwarding = new DHLGlobalForwarding({
  apiKey: process.env.DHL_FORWARDING_KEY,
  environment: 'production'
});

Ask for what you need:

const tracking = await forwarding.getShipment({
  searchType: 'shipmentID',
  value: '777333555'
});

Done.


3. DHLUnifiedTracking

Tracking lives here.

Simple. Fast. Reliable.

One key. One call.

import { DHLUnifiedTracking } from 'dhl-ts';

const tracking = new DHLUnifiedTracking({
  apiKey: process.env.DHL_UNIFIED_TRACKING_KEY
});

Check status:

const status = await tracking.trackShipment('1234567890');

No ceremony.


Why This Exists

Most SDKs try to hide DHL.

That’s where they break.

They mix:

  • Basic Auth
  • OAuth2
  • API keys

into one “smart” wrapper.

It feels clever.

Until it fails.


We did the opposite.

We made the boundaries obvious.

Each client mirrors a real DHL system.

So:

  • No hidden rules
  • No leaking auth
  • No silent failures

What You Get

  • The right auth, every time
  • Methods that belong where they should
  • Autocomplete that makes sense

You don’t guess.

You call the method.

It works.


Install

npm install dhl-ts

Errors (That Actually Help)

When something breaks, it tells you why.

import { DHLError } from 'dhl-ts';

try {
  await express.createShipment({...});
} catch (error) {
  if (error instanceof DHLError) {
    console.error(error.code);
    console.error(error.message);
  }
}

No mysteries.


Extend It

Need a new endpoint?

Open the client. Add the method.

That’s it.

No wrappers. No magic.

The client already knows:

  • where to send the request
  • how to authenticate

You just describe the call.


The Idea

Don’t fight DHL.

Respect its shape.

Pick the client.

Ship the code.


License

MIT