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

@ongkir-sdk/komerce

v1.1.2

Published

Unofficial RajaOngkir (by Komerce) adapter for ongkir-sdk — cek ongkir & tracking pengiriman Indonesia. Not affiliated with Komerce.

Readme

@ongkir-sdk/komerce

Unofficial RajaOngkir (by Komerce) adapter for ongkir-sdk. Not affiliated with, endorsed by, or officially connected to Komerce or RajaOngkir.

Adapter ini memakai RajaOngkir API V2 (produk API pengiriman milik Komerce, base URL https://rajaongkir.komerce.id/api/v1/). API key-nya di-generate dari dashboard Collaborator Komerce (menu Developer → Settings → Api Key).

Installation

bun add @ongkir-sdk/komerce

Usage

import { KomerceProvider } from '@ongkir-sdk/komerce'

const provider = new KomerceProvider({
  apiKey: process.env.RAJAONGKIR_API_KEY!,
})

// Get shipping rates
const rates = await provider.getRates({
  origin: { postalCode: '12440' },
  destination: { postalCode: '12240' },
  items: [{ weightGrams: 1000, value: 50000 }],
})

// Track shipment — RajaOngkir requires a courier code alongside the AWB number
const tracking = await provider.trackShipment('JNE001234567890', { courier: 'jne' })

Configuration

| Option | Type | Default | Description | |---|---|---|---| | apiKey | string | — | RajaOngkir Shipping Cost API key (required) | | baseUrl | string | https://rajaongkir.komerce.id/api/v1 | API base URL | | httpClient | function | fetch | Custom HTTP client for testing |

Supported features

  • getRates() — via postal code. Adapter me-resolve postal code → RajaOngkir location id lewat endpoint pencarian destination, lalu menghitung biaya. Hasil lookup di-cache per instance.
  • trackShipment(trackingId, { courier }) — wajib menyertakan kode kurir (contoh jne, sicepat, jnt). Tanpa courier, adapter melempar error dengan pesan yang jelas.
  • parseWebhook()tidak didukung. Tier Shipping Cost (termasuk paket Starter gratis dan Pro) tidak menyediakan webhook; notifikasi status hanya ada di API Shipping Delivery (tier Enterprise). Memanggil parseWebhook() melempar error WEBHOOK_NOT_SUPPORTED.
  • createShipment()tidak didukung pada tier ini. Order pengiriman hanya ada di API Shipping Delivery (tier Enterprise) yang merupakan produk terpisah dengan base URL dan mekanisme auth (x-api-key) berbeda. Memanggil createShipment() melempar error CREATE_SHIPMENT_NOT_SUPPORTED.

Keterbatasan yang perlu diketahui

  • getRates() butuh postal code di origin/destination. RegionRef tanpa postalCode tidak bisa di-resolve ke id RajaOngkir (error INVALID_ORIGIN/INVALID_DESTINATION).
  • Harga selalu dalam IDR (respons domestic cost tidak menyediakan field mata uang).
  • Tier Starter dibatasi 100 hit cek ongkir per hari; upgrade ke Pro untuk kuota lebih besar.
  • Daftar kurir yang dicek mengikuti daftar 3PL yang tersedia di dokumentasi RajaOngkir (JNE, SiCepat, IDExpress, SAP, Ninja, J&T, TIKI, Wahana, POS, Sentral, Lion, REX).

FAQ

Apakah ini SDK resmi dari RajaOngkir atau Komerce? Tidak. Ini adapter unofficial untuk SDK open source ongkir-sdk, tidak berafiliasi dengan Komerce maupun RajaOngkir.

Butuh API key? Ya. Pakai key milikmu sendiri dari dashboard Collaborator Komerce (menu Developer → Settings → Api Key).

Kenapa trackShipment butuh courier? API RajaOngkir mewajibkan kode kurir bersama nomor resi (misal jne). Tanpa courier, adapter melempar error dengan pesan yang jelas.

Runtime apa yang didukung? Node ≥18, Bun, Deno, dan Cloudflare Workers.

Dokumentasi

Panduan lengkap dan API reference: ongkir-sdk docs (halaman @ongkir-sdk/komerce).

License

MIT