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

@thomas-adam-leigh/elenjical-electron

v0.3.0

Published

Elenjical error tracking, logs, session replay and native crash reports for Electron apps.

Readme

@elenjical/electron

Error tracking, logs, session replay and native crash reports for Electron apps, reported to Elenjical. One package for every process: the main process, preload scripts, renderers and utility processes.

Install

npm install @elenjical/electron@npm:@thomas-adam-leigh/elenjical-electron@^0.3.0

Set up

Main process first, before app.whenReady(). The DSN is public and ships inside the app:

// src/main.ts
import * as Elenjical from "@elenjical/electron/main";

Elenjical.init({
  dsn: "https://<key>@<your elenjical host>/<project id>",
  enableLogs: true,
});

The preload bridge connects renderers to the main process; it works with contextIsolation and the sandbox on:

// src/preload.ts
import "@elenjical/electron/preload";

Then every renderer, before the UI mounts. No DSN here: it arrives from the main process over IPC, with the release and environment.

// src/renderer.tsx
import * as Elenjical from "@elenjical/electron/renderer";

Elenjical.init({
  enableLogs: true,
  integrations: [Elenjical.replayIntegration()],
  replaysSessionSampleRate: 0.1,
  replaysOnErrorSampleRate: 1.0,
});

With a React renderer, combine the two SDKs: Elenjical.init({ dsn: undefined, ... }, reactInit) with import { init as reactInit } from "@elenjical/react" (the React package's options need dsn: undefined). import "@elenjical/electron" resolves to the main side on Node and to the renderer side in a browser bundle.

Report handled errors with Elenjical.captureException(error), write logs with Elenjical.logger.info("..."), identify people with Elenjical.setUser({ id, email }) in the main process (a renderer's scope is forwarded there). Replay privacy markers are data-elenjical-mask, -unmask, -block, -unblock and -ignore.

Native crashes of the main process, renderers and GPU process are sent as minidumps and arrive as issues with the crash reason and a stack walked from the dump. Upload the symbols of your Electron version (electron-v<version>-<platform>-<arch>-symbols.zip from Electron's release) and of your own native modules with npx elenjical debug-files upload <dir> so the frames have names.

Utility processes (utilityProcess.fork) start the SDK with init from @elenjical/electron/utility; @elenjical/electron/native has the event loop block detection; @elenjical/electron/preload-namespaced exposes hookupIpc(namespace) for a custom IPC namespace.

| Variable (main and utility processes) | Meaning | | ------------------------------------- | ----------------------------------------------- | | ELENJICAL_DSN | where to report, when not passed to init | | ELENJICAL_ENVIRONMENT | development, production, ... | | ELENJICAL_RELEASE | the version, default <app name>@<app version> | | ELENJICAL_TRACES_SAMPLE_RATE | tracing sample rate (default 0) | | ELENJICAL_DEBUG | true logs what the SDK does |

Source maps: upload the main, preload and renderer bundles with the same release (@elenjical/vite-plugin in each Vite config, or npx elenjical sourcemaps inject and upload per bundle).

See NOTICE for the open-source software this package is built on.

Feature flags

In the main process, read by your user's id:

if (await Elenjical.isFeatureEnabled("new-checkout", user.id)) {
  // ...
}

getFeatureFlagPayload(key, distinctId) reads a flag's payload and getAllFlags(distinctId) every flag. Each person's flags are kept for 30 seconds; when they cannot be read, every flag is off. In a renderer, name the DSN to read them from (its own client has none: its events go through the main process), then read them for the person setUser names:

Elenjical.init({ flags: { dsn: "<public DSN>" } });

if (Elenjical.isFeatureEnabled("new-checkout")) {
  // ...
}

Flags load the first time one is read; onFeatureFlags(callback) runs once they have. In both processes, the next error reports the flags read before it.