fp-beacon-lib-beta
v1.0.86
Published
FenixPyre Beacon service logging library for tracking SIEM events
Readme
fp-beacon-lib
A cross-platform TypeScript library for logging events to the beacon service. This library provides a standardized way to track and log SIEM events for security and compliance purposes.
Installation
npm install fp-beacon-lib
# or
yarn add fp-beacon-libFeatures
- Standardized event logging across applications
- Multiple specialized event builders for different use cases
- Network and geolocation information collection
- Rich metadata support for events
- TypeScript support with full type definitions
Usage
Basic Usage
import { AdminEventBuilder } from "fp-beacon-lib";
// Create a new event
const event = new AdminEventBuilder();
// Configure the event with builder pattern
event
.setOrgId(orgId)
.setEventSource("my-service")
.setNetworkAndGeoLocation(request)
.setMethod("create")
.setAction("user_management.lifecycle.create")
.setActor({
actor_type: "admin",
id: adminId,
email: adminEmail,
});
// Add target information
event.addTarget({
email: userEmail,
id: userId,
type: "user",
metadata: {
firstName: firstName,
lastName: lastName,
},
});
// Set status and send the event
event.setStatus("success");
event.send();Available Event Builders
The library provides several specialized event builders:
AdminEventBuilder- For admin actions and operationsUserEventBuilder- For user-initiated eventsFileAccessEventBuilder- For tracking file access operationsBaseEventBuilder- Base class with common functionality
Common Methods
All event builders share these common methods:
setOrgId(orgId)- Set the organization IDsetEventSource(source)- Set the source of the eventsetAction(action)- Set the action being performedsetActor(actor)- Set details about who performed the actionaddTarget(target)- Add a target affected by the actionsetStatus(status)- Set the event status (success, failure, etc.)setClientInfo(request)- Set network, geo, and device info automaticallysend()- Send the event to the beacon service
License
Copyright © FenixPyre. All rights reserved.
