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

@lerix-dev/lerix-core

v1.3.0

Published

Framework-agnostic core for the Lerix SDK — error tracking and Web Push notifications, backed by the Lerix platform.

Readme

lerix-core

Framework-agnostic core for the Lerix SDK — error tracking and Web Push notifications, backed by the Lerix platform. This package has no framework dependency; it's the shared engine behind lerix-angular and lerix-react, and can also be used directly in plain TypeScript/JavaScript, Vue, or any other web app.

Install

npm install lerix-core

Use it

import { Lerix } from "lerix-core";

await Lerix.initialize({
  apiKey: "your-api-key",
  projectId: "your-project-id",
  debugMode: true,
});

Lerix.throwError("Test error");

Lerix.notifications.setOnNotificationReceived((payload) => {
  console.log(payload.title, payload.body);
});

const subscribed = await Lerix.notifications.subscribe();

Filtering errors

Two optional initialize() options decide, on the client, which errors are sent. ignoreErrors runs first; beforeSend sees only what's left. Both apply to every report — global handlers, throwError(), reportCaughtError() and the framework wrappers' error boundaries/handlers.

await Lerix.initialize({
  apiKey: "your-api-key",
  projectId: "your-project-id",
  // A string drops any error whose message contains it (case-insensitive);
  // a RegExp drops any message it matches. Empty strings are ignored.
  ignoreErrors: ["ResizeObserver loop", /^ChunkLoadError/],
  // Return the event (optionally modified) to send it, or null to drop it.
  beforeSend: (event) => {
    if (event.message.includes("extension://")) return null;
    return { ...event, message: event.message.replace(/token=\S+/g, "token=[redacted]") };
  },
});

The event is a LerixErrorEvent: { message, stack, type, severity, metadata? }. If beforeSend throws, the original event is sent unchanged and the exception never reaches your app. There are no built-in ignore patterns in the SDK — common browser noise is filtered on the Lerix server.

Features

  • Init/registration — Lerix.initialize() registers the app/user with the backend. Safe to call more than once (concurrent and idempotent — a second call in flight returns the same in-progress result rather than racing).
  • Error tracking — Lerix.throwError(), with automatic stack capture from the call site if you don't pass one, automatic resolution of compiled/bundled stack frames back to original source locations (using the build's own source map, when reachable), and automatic capture of uncaught errors/promise rejections via installGlobalCrashHandlers().
  • Push notifications — Lerix.notifications.*, using standard Web Push (VAPID) — no Firebase, no OneSignal. Ships its own service worker at sw/lerix-sw.js; copy it to your app's public root. It is registered on its own /lerix/ scope, so it coexists with an app's own service worker.
  • Users — Lerix.setUser(externalId, { identityHash? }) after login links this install to your own user id, so your server can send to externalUserIds and reach every device of that user; Lerix.clearUser() on logout unlinks it. The id is stored locally and re-sent automatically when the install is re-registered. identityHash is hex(HMAC-SHA256(identity secret, externalId)), computed by your backend (required only when the project turns on identity verification).

Framework wrappers

If you're building a plain TS/JS app (or a framework without a dedicated Lerix package), use this package directly. If you're using Angular, React, or Next.js, use lerix-angular/lerix-react/lerix-nextjs instead — thin wrappers over this same core, with idiomatic integration (provideLerix()/LerixService for Angular; LerixProvider/hooks/ LerixErrorBoundary for React; LerixNextProvider plus the same React hooks/error boundary, pre-configured for the App Router and Pages Router, for Next.js).