Node.js package

Use our Node.js package to interact with the LogBucket platform

We provide a simple Node.js package, that you can use to interact with the LogBucket platform. The package is open source and available on BitBucketarrow-up-right.

Introduction

The @logbucket/logbucket package is a lightweight wrapper on top of Node.js `https`, supporting features of the LogBucket cloud logging platform's webhook:

  • Initialization with API key;

  • Posting log entries to the LogBucket webhook;

  • Getting latest log entries from the LogBucket webhook.

Installation

npm install @logbucket/logbucket

Usage

The package must me initialized first by calling the `init()` function using your bucket's API key as the parameter. Afterwards, you can call the `log()` function to add log entries to the bucket.

Post log entry

const logbucket = require('@logbucket/logbucket');

logbucket.init({key});
logbucket.log({level},{message},{data},{timestamp});

Post log entry, handle results

Last updated