Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

app-logs-javascript

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

app-logs-javascript

Javascript SDK for app-logs error tracker

  • 0.0.9
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

What is app-logs-javascript?

The app-logs-javascript package is a JavaScript client for the App-Logs error-tracking app. It provides a simple and easy-to-use API for logging errors and tracking their status.

Why use app-logs-javascript?

There are many benefits to using app-logs-javascript, including:

  • It is easy to use and integrate into your existing code.
  • It provides a comprehensive set of features for error tracking, including detailed error reports, custom error labels, and error grouping.
  • It is reliable and scalable, so you can be confident that it will be able to handle your error tracking needs, even as your application grows.

How to install app-logs-javascript

To install the app-logs-javascript package, run the following command:

npm install app-logs-javascript

or

yarn add app-logs-javascript

How to use app-logs-javascript

Once the package is installed, you can import the init function and initialize the client into your JavaScript code as follows:

import AppLogs from 'app-logs-javascript';

// initialization (calling this function one time is enough)
AppLogs.init({ drainUrl: 'YOUR_DRAIN_URL_FROM_THE_APP_SETTING' });

To log an error or any data, simply call the logEvent() method:

import AppLogs from 'app-logs-javascript';

// data
const transferData = { txId: 2023, label: 'test payment' }

// log the event
AppLogs.logEvent({
    level: "info",
    data: transferData
});

To catch an exception, simply call the captureException() method in the catch block as follows:

import AppLogs from 'app-logs-javascript';

try {
    // your logic here
} catch(error) {
    // log the exception
    AppLogs.captureException(error, {
        userId: 'usr2023',
        operation: 'registration process'
    });
}

Contributing

We welcome contributions to the app-logs-javascript package. If you find a bug or have a suggestion for improvement, please create an issue on GitHub.

License

The app-logs-javascript package is licensed under the MIT License.

Keywords

FAQs

Package last updated on 07 Dec 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc