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

@netcom/search-sdk

v0.1.20260901-ci.3

Published

Headless SDK for the NetCom Search API — typed clients for parts search, catalog, pricing, cart and orders.

Readme

netcom.search.sdk.js

Framework-agnostic JS/TS SDK for NetCom's search/catalog/pricing API (@netcom/search-sdk). Call a method, get a typed object back — no React, no UI dependency.

Install

Published publicly on npm — no registry config or credentials needed to install.

npm install @netcom/search-sdk

Quick start

import { createSearchSdk } from "@netcom/search-sdk";

const sdk = createSearchSdk({
  baseUrl: "https://your-tenant.netcomcanada.com", // no trailing slash
});

const makes = await sdk.makes.getFilteredMakes(undefined, 2015);
const info = await sdk.parts.getProductInfo("Akebono", "Disc Brake Pad Set", "ACT1878");

That's it for anonymous/public browsing — omit getAccessToken entirely and the SDK sends no Authorization header. Whether the API actually allows anonymous access is a per-tenant backend setting (AllowAnonymous, unrelated to this SDK) — some tenants will 401 until you authenticate.

Authentication

The SDK is agnostic of the identity provider — it never imports Keycloak or any IdP client itself. You supply how to get a token:

const sdk = createSearchSdk({
  baseUrl: "https://your-tenant.netcomcanada.com",
  getAccessToken: async () => keycloak.token, // your own IdP client, called lazily as needed
});

getAccessToken is a fallback — it's only called when no token has been explicitly injected. Two more escape hatches sit on top of it:

// Push a freshly refreshed token yourself (e.g. after your own IdP's refresh flow) — overrides the
// fallback for every subsequent REST call *and* the live SignalR pricing connection, until cleared.
sdk.setAccessToken(newToken);

// Get told when a token stops working (401 on REST, or the pricing hub's handshake rejected for
// auth reasons) — the SDK never retries on its own, it just signals so you can react (refresh + retry,
// redirect to login, etc). Returns an unsubscribe function.
const unsubscribe = sdk.onAuthError(({ source, status }) => {
  console.warn(`auth failed on ${source}`, status);
});

Data APIs

Each group mirrors a domain of the backend API, same requests/responses as netcom.search.client used directly (no behavior change from the port):

| Group | Examples | |---|---| | sdk.parts | searchPartsByKeywords, searchPartsByApplication, searchPartsByPartNumber, getProductInfo, getBuyerGuide, getAutocompleteSuggestions | | sdk.cart | addCartItem, getCartItems, makeOrder | | sdk.orders | getOrders, getOrder | | sdk.categories | getAllCategories, getCategoriesByMakeModelYear | | sdk.makes / sdk.models / sdk.years | getFiltered*, search* | | sdk.searchScope | getSearchScope — informational: what this caller's token restricts them to | | sdk.tenantSettings | getMySettings, getMyBranding, putMySettings | | sdk.ai | .client (a configured axios instance for the separate AI API) + .isAiEnabled() |

All fully typed — import any DTO you need directly from the package root, e.g. import type { PartDto, CartLineDto } from "@netcom/search-sdk".

Pricing (live updates over SignalR)

Pricing isn't request/response — the backend can push results asynchronously, sometimes more than once per search as different connectors respond. sdk.pricing is a PricingClient for this:

await sdk.pricing.connect(); // once, e.g. at app startup

const { priceRequestId, parts } = await sdk.parts.searchPartsByKeywords("brake pad");

// Option A: event-style — get every batch as it arrives
const unsubscribe = sdk.pricing.subscribe(priceRequestId, (results) => {
  // results: PriceAndAvailabilityResultDto[]
});

// Option B: just want one object, no events
const results = await sdk.pricing.waitForFirst(priceRequestId, { timeoutMs: 5000 });

sdk.pricing.onConnectionStateChange((state) => ...) reports { isConnected, isReady } if you want to show connection status or gate UI on it. isReady becomes true once the handshake resolves or a 3-second fallback elapses — searches are never blocked waiting on a slow/unreachable hub; pricing then falls back to whatever the backend resolves synchronously per-request.

sdk.setAccessToken/sdk.onAuthError cover the pricing connection too — one call updates both REST and SignalR auth.

What this SDK does not do

  • No retry logic hidden anywhere (auth failures, pricing timeouts) — you decide the strategy.
  • No UI, no React, no framework assumptions. netcom.search.client consumes this SDK the same way any other caller would.
  • No bundler needed to consume it — plain tsc output, works directly under Node or any bundler.