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

rn-debug-trail

v1.9.11

Published

Log monitoring SDK for debug trail.

Readme

SDK for react native debug trail log monitoring

Installation

yarn add rn-debug-trail

Install dependencies

yarn add @react-native-async-storage/async-storage axios react-native-device-info react-native-uuid

Usage

import RNDebugTrail from "rn-debug-trail";

To use the same code both on Android and iOS use init() to initialize debug trail.

RNDebugTrail.init({
  uri: "<Websocket_url>",
  api_key: "<API KEY>",
});

Parameters

| Parameter | Description | | ------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | uri | WebSocket URL used for connecting to the Debug Trail server. | | api_key | Secret key generated from the Debug Trail portal. This key is used to authenticate your device with the server. | | secret_words | Array of strings that denote sensitive data contained in logs. If any of the specified words are found in the log, that log entry will be prevented from being sent. | | setexception | A boolean flag that determines whether device exception handling is required. It is recommended to set this to false in development and true in production for robust error handling. | | api_monitoring | (optional, boolean) Indicates whether API monitoring is required. Set to true to enable monitoring of API interactions. | | app_state_monitoring | (optional, boolean) Indicates whether monitoring of the application state data is necessary. Set to true to track and log application state changes. | | log_monitoring | (optional, boolean) Indicates whether console log monitoring is required. It monitors the use of console.log() in your application. |

Exported Functions

init

Description: Initializes the DebugTrail logging and monitoring process.

DebugTrail.init({
  uri: "<Websocket_url>",
  api_key: "<API KEY>",
  secret_words: ["password", "token"],
  setexception: true,
  api_monitoring: true,
  app_state_monitoring: true,
  log_monitoring: true,
});
  • Parameters: InitParams
  • Returns: Promise<void>

sendLog

Description: Sends logs through WebSocket to the DebugTrail server.

DebugTrail.sendLog({ message: "Log message", level: "info" });
  • Parameters: DebugTrailLog (e.g., { message: string, level: string })
  • Returns: void

closeConnection

Description: Closes the WebSocket connection to the DebugTrail server.

DebugTrail.closeConnection();
  • Parameters: None
  • Returns: void

storeLogs

Description: Stores logs in the browser's localStorage under the key "logs".

DebugTrail.storeLogs();
  • Parameters: None
  • Returns: void

hibernate

Description: Suspends the log sending process. Logs will be held in the log_stack and not sent until activate is called.

DebugTrail.hibernate();
  • Parameters: None
  • Returns: void

activate

Description: Resumes the log sending process and sends any pending logs stored in log_stack.

DebugTrail.activate();
  • Parameters: None
  • Returns: void

setUser

Description: Sets the user for the logs. All subsequent logs will include this user data.

DebugTrail.setUser("john_doe");
  • Parameters: name: string (The name of the user)
  • Returns: void

setTenant

Description: Sets the tenant name for the logs. All subsequent logs will include this tenant data.

DebugTrail.setTenant("tenant_123");
  • Parameters: name: string (The name of the tenant)
  • Returns: void

setJSExceptionHandler

Description: Sets a custom JavaScript exception handler for logging errors.

DebugTrail.setJSExceptionHandler((error, isFatal) => {
  console.error(error, isFatal);
});
  • Parameters:
    • customHandler: (error: Error, isFatal: boolean) => void (The custom error handler)
    • allowedInDevMode: boolean (Optional flag to allow in development mode)
  • Returns: void

Additional Notes

  • WebSocket Management: All log data is sent via a WebSocket connection to the specified uri. The connection is automatically managed, and logs are sent when the WebSocket is open.
  • Exception Handling: You can configure custom handlers for JavaScript exceptions using setJSExceptionHandler. In production, this ensures that errors are logged automatically.
  • Log Monitoring: Log data is captured in real-time via console.log(). If enabled (log_monitoring: true), console logs are sent automatically.
  • API & App State Monitoring: Enable monitoring for API interactions and app state changes by setting api_monitoring and app_state_monitoring to true.