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

@orderlyshop/core-client

v0.1.0-build.7068

Published

TypeScript client for the Orderly core gRPC API.

Readme

@orderlyshop/core-client

TypeScript client for the Orderly core gRPC API.

The package is generated from the protobuf contracts in ../../../../interface and supports:

  • binary gRPC in Node.js
  • gRPC-web in browsers
  • API key, bearer token, and browser cookie-backed authentication flows
  • memory-only token storage by default
  • non-secret browser identity hints in localStorage

Install

npm install @orderlyshop/core-client

Browser gRPC-web

import { createOrderlyWebClient } from "@orderlyshop/core-client/web";

const orderly = createOrderlyWebClient({
  baseUrl: "https://api.orderly.example"
});

await orderly.auth.authenticateWithSmsChallenge({
  phoneNumber: { CountryCode: "45", Number: "12345678" },
  code: "123456"
});

const login = await orderly.getCurrentLogin();

Browser clients use credentials: "include" by default. If the backend sets an HttpOnly; Secure; SameSite=None; Partitioned cookie in a gRPC-web auth response, the browser can persist the server session without exposing the cookie to JavaScript. The client library does not read or manage that cookie.

The cookie value should be an opaque server-side session key, not an OAuth token. A recommended server cookie shape is:

Set-Cookie: __Host-Http-orderly_session=<opaque-session-id>; Path=/; Secure; HttpOnly; SameSite=None; Partitioned; Max-Age=...

CHIPS cookie persistence depends on browser support. Recent Chrome, Edge, Firefox, and iOS Safari 26.2+ have strong support, but older browsers may fall back to page-lifetime bearer auth unless the application provides its own TokenStore.

Node binary gRPC

import { createOrderlyNodeClient } from "@orderlyshop/core-client/node";

const orderly = createOrderlyNodeClient({
  baseUrl: "https://api.orderly.example",
  auth: { type: "apiKey", apiKey: process.env.ORDERLY_API_KEY! }
});

const login = await orderly.getCurrentLogin();

Authentication Storage

The default TokenStore is memory-only. It does not persist access tokens, refresh tokens, API keys, or full OAuth responses to Web Storage, IndexedDB, cookies, files, or logs.

You can provide a custom token store when you intentionally accept the persistence tradeoff:

import type { TokenStore } from "@orderlyshop/core-client";

const tokenStore: TokenStore = {
  get: async () => undefined,
  set: async (token) => {
    // Store only in an application-owned secure location.
  },
  clear: async () => {}
};

Browser identity hints are separate from authentication. The default browser identity store may cache only:

  • userId
  • displayName
  • updatedAt

This cache is for UI only. It must not be used as proof of authentication; call getCurrentLogin() or another protected RPC to verify the server session.

clearAuth() clears the configured token store and identity store. It cannot clear server-managed HttpOnly cookies from JavaScript; use a server-side logout endpoint or RPC when that feature is available.

Updating Protobuf Contracts

Regenerate generated TypeScript and bump the package minor version:

npm run update:proto

Preview the update without mutating package metadata:

npm run update:proto -- --dry-run

For breaking contract releases:

npm run update:proto -- --major