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

@dropzero/sdk

v0.3.0

Published

JavaScript/TypeScript client for the Dropzero API. Zero dependencies; works in Node 18+, Bun, Deno, Cloudflare Workers and browsers.

Readme

@dropzero/sdk

JavaScript / TypeScript client for the DropZero API. Zero dependencies. Node 18+, Bun, Deno, Cloudflare Workers and browsers (use a test key in a browser; never ship a live key to one).

npm install @dropzero/sdk

Partner platforms pass a dzp_ key and call dz.forMerchant(id) for merchant requests.

import { Dropzero } from '@dropzero/sdk'

const dz = new Dropzero({
  apiKey: process.env.DROPZERO_API_KEY!, // dz_test_... for the sandbox
  baseUrl: process.env.DROPZERO_API_URL!, // your API URL; there is no built-in default host
})

const { items } = await dz.products.list({ q: 'kettle' })
const order = await dz.orders.create({
  customer: { name: 'Rafi Ahmed', phone: '01712345678', address: 'House 4, Road 2, Dhanmondi', district: 'Dhaka' },
  items: [{ product_id: items[0].id, quantity: 1, unit_price_cents: 189000 }], // ৳1,890.00
  shipping_cents: 6000,
})
console.log(order.number, order.total_cents, order.margin_cents)

Money is always integer paisa (100 paisa = ৳1).

Test mode

A dz_test_ key uses the sandbox: orders are not real and use no stock. Move them through every status yourself:

for (const s of ['confirmed', 'packed', 'shipped', 'delivered'] as const) await dz.sandbox.advance(order.id, s)

Webhooks

import { constructEvent } from '@dropzero/sdk'

// Express: use express.text({ type: 'application/json' }) so you keep the RAW body
app.post('/dropzero-webhook', async (req, res) => {
  try {
    const event = await constructEvent(req.body, req.header('Dropzero-Signature'), process.env.DROPZERO_WEBHOOK_SECRET!)
    // event.id is unique: ignore ones you have already handled
    if (event.type === 'order.shipped') console.log(event.data.order.tracking_number)
    res.sendStatus(200)
  } catch {
    res.sendStatus(400)
  }
})

Events

| Events | event.data | |---|---| | order.created, .confirmed, .packed, .shipped, .delivered, .cancelled, .returned | order; partner endpoints also get merchant | | return.requested, .approved, .rejected, .received | return, order, merchant (live mode only; a return may cover part of an order) | | product.updated | product | | product.unavailable | product: id, sku, name | | ping | message |

An endpoint with no event list receives every event, including ones added later: check event.type and ignore what you do not handle. Stock changes caused by orders and returns do not send product.updated. There is no refund event.

Upgrading from 0.2: orders.cancel(id, reason?) and sandbox.advance(id, status) now call PATCH /api/v1/orders/{id} (status: "cancelled") and PATCH /api/v1/sandbox/orders/{id}; the old POST .../cancel and .../advance routes are gone, so upgrade together with the API. Products now carry packaging_cents (Dropzero's packaging fee per unit: your full cost is supplier_price_cents + packaging_cents) and, when a price rise is announced, upcoming_price_cents and upcoming_price_at (also on variants). Orders carry packaging_cents, and margin_cents is net of it.

Upgrading from 0.1: OrderEventPayload.type is now OrderEventType, and WebhookEvent includes return and product events, so check event.type before reading event.data.order.

Behaviour worth knowing

  • Errors: every non-2xx throws DropzeroError with status, code (stable, branch on this) and requestId. A request that never got an answer throws DropzeroConnectionError.
  • Retries: network errors, 429 (honouring Retry-After) and 5xx are retried twice by default, only for requests that are safe to repeat: reads, deletes, and orders.create (which always sends an Idempotency-Key, yours or a random one, and reuses it on retry, so a retry can never create a second order).
  • Pagination: for await (const p of dz.products.iterate()) { ... } walks every page.
  • Options: baseUrl (required, or DROPZERO_API_URL), timeoutMs (30s), maxRetries (2), fetch.

Full guides and the API reference are at https://docs.dropzero.bd (sign in with your DropZero account).