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

stackpilot-sdk-satej

v1.2.1

Published

Browser error logging SDK for StackPilot.

Readme

StackPilot SDK

Browser error logging SDK for StackPilot.

Package: stackpilot-sdk-satej
Default endpoint: https://stackpilot-oiys.onrender.com/api/v1/logs

Install

npm install stackpilot-sdk-satej
pnpm add stackpilot-sdk-satej

Quick Start (one line)

import { init } from "stackpilot-sdk-satej";

init("YOUR_PROJECT_KEY");

That's it. The SDK automatically:

  • connects to the StackPilot API
  • captures uncaught browser errors (window.onerror)
  • captures unhandled promise rejections

Script Tag (zero JS code)

Drop this into any HTML page — no bundler needed:

<script
  src="https://unpkg.com/stackpilot-sdk-satej"
  data-project-key="YOUR_PROJECT_KEY"
></script>

Optional attributes: data-endpoint="...", data-debug="true".

Auto-Init (framework-friendly)

Add a meta tag or global variable, then import the auto module:

<meta name="stackpilot-key" content="YOUR_PROJECT_KEY" />
import "stackpilot-sdk-satej/auto";

Or set the global before importing:

window.__STACKPILOT_PROJECT_KEY__ = "YOUR_PROJECT_KEY";
import "stackpilot-sdk-satej/auto";

Next.js Setup

Add your project key to .env.local:

NEXT_PUBLIC_STACKPILOT_PROJECT_KEY=your_project_key

Create a small client component:

"use client";

import { useEffect } from "react";
import { init } from "stackpilot-sdk-satej";

export function StackPilotProvider() {
  useEffect(() => {
    return init(process.env.NEXT_PUBLIC_STACKPILOT_PROJECT_KEY!);
  }, []);

  return null;
}

Render <StackPilotProvider /> once near your app root.

Manual Logging

import { captureError, logError } from "stackpilot-sdk-satej";

try {
  // app code
} catch (error) {
  logError(error);
}

captureError(new Error("Checkout failed"));

Full Options

For advanced use, initLogger gives you full control:

import { initLogger } from "stackpilot-sdk-satej";

initLogger({
  projectKey: "YOUR_PROJECT_KEY",
  endpoint: "https://your-custom-endpoint.com/api/v1/logs",
  enabled: true,
  debug: true,
});

| Option | Type | Default | Description | | ------------ | --------- | --------------------------- | --------------------------------------------- | | projectKey | string | required | Project key from the StackPilot dashboard | | endpoint | string? | https://stackpilot-oiys.onrender.com/api/v1/logs | Log ingestion endpoint | | enabled | boolean?| true | Set false to disable without removing code | | debug | boolean?| false | Print SDK warnings in the browser console |

Cleanup

Both init and initLogger return a cleanup function:

const cleanup = init("YOUR_PROJECT_KEY");
cleanup();

Or call resetLogger() directly:

import { resetLogger } from "stackpilot-sdk-satej";
resetLogger();

Test It

After setup, trigger a test error in the browser:

throw new Error("StackPilot test error");

Then open your StackPilot dashboard and check the selected project.

Troubleshooting

If logs do not appear:

  • confirm the project key exists in your StackPilot dashboard
  • confirm your app runs the SDK in browser/client code
  • enable debug: true and check the browser console
  • if using a custom endpoint, confirm it matches your API