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

@dloizides/bff-web-client

v1.0.1

Published

Product-agnostic RN-web BFF HTTP layer for the dloizides.com portfolio: an axios instance factory plus an interceptor chain (logging, success-toast normalizer, error classifier) with app-supplied ports for the CSRF strategy, session-expiry handling, toast

Readme

@dloizides/bff-web-client

Product-agnostic RN-web BFF HTTP layer for the dloizides.com portfolio.

It owns the axios instance factory and the interceptor chain (logging, success toast normalizer, error classifier) that erevna-web and katalogos-web shared byte-for-byte. Every app-specific concern is a port the consuming app supplies — its logger, its toast emitter, its CSRF strategy, and its session-expiry handler. The package never imports a product, realm, or hardcoded URL, and pairs with @dloizides/api-client-base by composition.

Install

npm install @dloizides/bff-web-client

Peer deps: axios, @dloizides/api-client-base, @dloizides/utils.

Usage

import {
  createBffAxiosClient,
  registerInterceptors,
} from '@dloizides/bff-web-client';

import { apiEventBus } from '@dloizides/api-client-base';
import { logger } from './my-logger';
import { registerCsrfInterceptor } from './csrfInterceptor'; // app-owned
import { registerSessionExpiryInterceptor } from './sessionExpiry'; // app-owned

export const apiClient = createBffAxiosClient({ timeoutMs: 30_000 });

registerInterceptors(apiClient, {
  logger,
  emitToast: (message, severity) =>
    apiEventBus.emit({ type: 'toast', severity, message }),
  csrf: registerCsrfInterceptor,
  onSessionExpiry: registerSessionExpiryInterceptor,
});

API

createBffAxiosClient(options)

| option | type | description | | ----------- | -------------------------- | ---------------------------------------------------- | | timeoutMs | number | Request timeout in milliseconds. | | baseURL | string (optional) | Omit for same-origin (relative) BFF requests. | | headers | Record<string,string> | Extra default headers merged over the BFF defaults. |

Returns a credentialed AxiosInstance with no interceptors registered.

registerInterceptors(instance, ports)

| port | type | required | description | | ---------------- | -------------------------------------- | -------- | -------------------------------------------------------------------- | | logger | BffLogger | yes | Structured logger the package logs through. | | emitToast | (message, severity) => void | yes | Called when a mutating request succeeds. | | csrf | (instance) => void | no | App CSRF registrar. Defaults to X-BFF-Csrf: 1 on mutations. | | onSessionExpiry| (instance) => void | no | App session-expiry registrar (app owns its session store). |

Chain order (matches the pre-extraction behaviour):

  • Request (reverse execution): logging is registered first (runs last), CSRF registered second (runs first).
  • Response (execution order): logging → normalizer → session expiry → error classifier.

Individual registrars

registerLoggingInterceptor, registerResponseNormalizer, registerErrorClassifier, registerDefaultCsrfInterceptor — exported for custom chains.

License

MIT