nathan-activity-logging
v1.0.15
Published
Logs database activities for the apps
Downloads
9
Maintainers
Readme
Activity-log
How to install
npm install nathan-activity-logging
How to use
In index.js import and initialize the ActivityLog instance
const ActivityLogs = require("nathan-activity-logging")
...
// initialization
const activity_logs = new ActivityLogs()
// then export it
module.exports = activity_logs
In Models files
// Import the instance from index
const ActivityLogs = require("../index")
...
// Add this snippet after the schema
// Parameters ( schema_from_above)
ActivityLogs.logging(modelSchema)
Fetch from activity logs
query = {
"performed_on": "users"
}
pagination = 10
ActivityLogs.fetchActivities(query, pagination)
In Models files
// Define the following
ACTIVITY_LOG_KEY = "ACCESS_KEY_N4TH4N"
ACTIVITY_LOG_NAME = "etapon"
ACTIVITY_LOG_API_URL = "https://activitylog-api-staging.devnhr.com/v1/activities"