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

@or-sdk/base

v0.45.2

Published

Shared HTTP client for OneReach SDK packages

Readme

@or-sdk/base

Shared HTTP transport for OneReach SDK packages. It has no SERVICE_KEY; subclasses provide the service key and API methods.

When to use

  • Extend Base when building an @or-sdk/* client for a OneReach service.

When not to use

  • For application calls to an existing service, use that service's dedicated SDK instead of extending Base.

Installation

npm install @or-sdk/base

Usage

Provide a token string or getter and a direct service URL when known. Use a discovery URL only when the service URL must be resolved.

import { Base } from '@or-sdk/base';

class ExampleClient extends Base {
  constructor(token: string, serviceUrl: string) {
    super({ token, serviceUrl, serviceKey: 'example' });
  }

  getItems() {
    return this.callApiV2({ route: '/items', method: 'GET' });
  }
}

const client = new ExampleClient(token, 'https://example.onereach.ai');
await client.getItems();

Alternatively, pass discoveryUrl in place of serviceUrl to resolve the service on first request.

Critical pitfalls

  • In Node.js, redirects are followed only to HTTPS on the exact same hostname, with a limit of five hops. HTTP-to-HTTPS upgrades and same-host HTTPS redirects work; HTTP targets, other hostnames, and URLs containing credentials are rejected. A rejected redirect fails the request. Resolve the correct service URL rather than relying on cross-host redirects.
  • An HTTP starting URL still sends the first request, including its Authorization header, over plaintext before the upgrade. Use an HTTPS starting URL for token-bearing requests.
  • This transport rule applies to requests made through Base. A subclass that uses another HTTP client must enforce its own redirect policy.

Method map

| Method | Purpose | |--------|---------| | init() | Resolve and prepare the service URL. | | callApiV2(params) | Send an authenticated request from a subclass. | | callApi(params) | Legacy authenticated request method; deprecated. |

See src/Base.ts and src/types.ts for the complete protected API and configuration types.

Auth

token is a string or getter returning the Authorization header value. Treat service URLs and discovery responses as security-sensitive because the SDK sends this token to the resolved destination.