logger-analytics-ch

1.0.5 • Public • Published

#Analytics Logger

#Installation npm install logger-analytics-ch

#Usage Import the functions you need from the package:

-> import { logAnalytics } from "logger-analytics-ch";

#Log analytics data like this:

logAnalytics({ page_id: {service_id}, module_id: {service_perivlage_id}, user_id: {user_id}, channel_id: {channel_id}, session_id: {session_id}, }).then((result) => { if (result.status === "success") { console.log("Log sent successfully"); } else { console.warn("Log failed:", result.error); } });

#API Reference -> logAnalytics({ page_id, module_id, user_id, channel_id, session_id }) -> Logs analytics data to the remote server.

*page_id (required): number — The page identifier.

*module_id (required): number — The module identifier.

*user_id: number — User ID.

*channel_id: string — Channel ID.

*session_id: string — Session ID.

-> Returns a promise resolving to:

  • { status: "success", data: ... } if logging succeeds.

  • { status: "error", error: "Error message" } if it fails.

Package Sidebar

Install

npm i logger-analytics-ch

Weekly Downloads

7

Version

1.0.5

License

Unpacked Size

2.71 kB

Total Files

3

Last publish

Collaborators

  • tharunkumargk