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

@xenonhq/ghost

v1.0.7

Published

Error monitoring SDK for Node.js, browser, and modern web frameworks

Downloads

74

Readme

@xenonhq/ghost

What is Ghost?

Ghost is an error monitoring SDK that automatically captures errors from your application and sends them to your Ghost dashboard in real time. It covers Node.js, browser, React, Vue, Angular, Express, NestJS, and Next.js.

Installation

npm install @xenonhq/ghost

Quick Start

import ghost from "@xenonhq/ghost";

ghost.init({
  apiKey: "your-api-key",
  host: "https://api.your-ghost-domain.com",
  environment: "production",
});

Node.js

The SDK automatically captures uncaught exceptions and unhandled rejections in Node.js environments.

import ghost from "@xenonhq/ghost";

ghost.init({
  apiKey: "your-api-key",
  host: "https://api.your-ghost-domain.com",
});

// Manual capture example
try {
  throw new Error("Something went wrong");
} catch (error) {
  ghost.capture(error);
}

Express

The Express adapter provides middleware for handling errors. It must be added last, after all other routes and middleware.

import express from "express";
import ghost from "@xenonhq/ghost";
import { expressHandler } from "@xenonhq/ghost/adapters/express";

ghost.init({
  apiKey: "your-api-key",
  host: "https://api.your-ghost-domain.com",
});

const app = express();

app.get("/", (req, res) => {
  throw new Error("Broken route");
});

// Must be added last
app.use(expressHandler());

NestJS

Use the GhostExceptionFilter to catch and report errors in your NestJS application.

import { UseFilters, Controller, Get } from "@nestjs/common";
import { GhostExceptionFilter } from "@xenonhq/ghost/adapters/nestjs";

@Controller()
@UseFilters(new GhostExceptionFilter())
export class AppController {
  @Get()
  getHello(): string {
    throw new Error("NestJS error");
  }
}

Next.js

Wrap your Pages Router API routes with nextJsHandler.

import { nextJsHandler } from "@xenonhq/ghost/adapters/nextjs";

async function handler(req, res) {
  throw new Error("Next.js API error");
  res.status(200).json({ name: "John Doe" });
}

export default nextJsHandler(handler);

React

Wrap your component tree with GhostErrorBoundary.

import React from "react";
import { GhostErrorBoundary } from "@xenonhq/ghost/adapters/react";

function App() {
  return (
    <GhostErrorBoundary fallback={<div>Something went wrong.</div>}>
      <MyComponent />
    </GhostErrorBoundary>
  );
}

Vue

Register the Ghost plugin in your Vue application.

import { createApp } from "vue";
import { GhostVuePlugin } from "@xenonhq/ghost/adapters/vue";
import App from "./App.vue";

const app = createApp(App);
app.use(GhostVuePlugin);
app.mount("#app");

Angular

Register the Angular error handler in your application providers.

import { NgModule, ErrorHandler } from "@angular/core";
import { GhostAngularErrorHandler } from "@xenonhq/ghost/adapters/angular";

@NgModule({
  providers: [{ provide: ErrorHandler, useClass: GhostAngularErrorHandler }],
})
export class AppModule {}

Browser (Vanilla JS)

Initialize Ghost directly in your browser.

<script type="module">
  import ghost from "https://unpkg.com/@xenonhq/ghost";

  ghost.init({
    apiKey: "your-api-key",
    host: "https://api.your-ghost-domain.com",
    environment: "production",
  });
</script>

Configuration Options

| Option | Type | Required | Default | Description | | :---------- | :--------------------- | :------- | :----------- | :------------------------------------------------------------ | | apiKey | string | Yes | undefined | Your Ghost project API key. | | host | string | Yes | undefined | The base URL of your Ghost server instance. | | environment | string | No | 'production' | The deployment environment (e.g., production, staging). | | debug | boolean | No | false | Enables console logging for transport layer debugging. | | tags | Record<string, string> | No | {} | Custom key-value pairs added to all error payloads' metadata. |