@logbun/js
v1.0.14
Published
Browser integration for Logbun
Downloads
5
Readme
Links
Usage
To integrate the Logbun SDK into your project, follow these steps:
Install the Logbun SDK using npm:
npm install @logbun/js
Import Logbun in your JavaScript file:
import Logbun from '@logbun/js';
Initialize Logbun by calling
Logbun.init(options)
as early as possible after loading the page. This initializes the SDK and hooks into the environment.Logbun.init({ apiKey: '{{API_KEY}}', // ... other options });
Manual Events
You can manually send events using the notify
function provided by @logbun/js
. Note that these functions will not perform any action until you have called Logbun.init()
:
import Logbun from '@logbun/js';
// Capture exceptions, messages, or manual events
Logbun.notify('Rick');
Logbun.notify(new Error('Roll'));
Make sure to replace {{API_KEY}}
with your actual Logbun API key.
For more details on configuration options and additional features, refer to the official documentation.