zkteco-js

Zkteco Logo

Warning

⚠️ This repository is not recommended for use in production. ⚠️

This repository is currently in development and may contain bugs or incomplete features. Use at your own risk and do not deploy to a production environment.

About zkteco-js

The zkteco-js library provides a robust solution for Node.js developers to interface with ZK BioMetric Fingerprint Attendance Devices. Its user-friendly API allows seamless extraction of data, such as registered users, logs, and device versions. Developers can also add users, retrieve real-time logs, and clear attendance records. Using a socket connection, the library ensures fast and reliable data exchange. Whether creating an attendance system or a time-and-attendance management application, zkteco-js is the essential tool for integrating biometric devices efficiently.

Installation

npm i zkteco-js

Or, if you prefer Yarn:

yarn add zkteco-js

Usage Example

const Zkteco = require("zkteco-js");

const manageZktecoDevice = async () => {
    const device = new Zkteco("192.168.1.106", 4370, 5200, 5000);

    try {
        // Create socket connection to the device
        await device.createSocket();

        // Retrieve and log all attendance records
        const attendanceLogs = await device.getAttendances();
        console.log(attendanceLogs);

        // Listen for real-time logs
        await device.getRealTimeLogs((realTimeLog) => {
            console.log(realTimeLog);
        });

        // Manually disconnect after using real-time logs
        await device.disconnect();
    } catch (error) {
        console.error("Error:", error);
    }
};

manageZktecoDevice();

API Reference :

Contributing

Please see CONTRIBUTING for details.

Security

If you’ve found a bug regarding security please mail codinglibs4u@gmail.com instead of using the issue tracker.

Alternatives

License

The MIT License (MIT). Please see License File for more information.