PHPackages                             banguncode/php-after - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. banguncode/php-after

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

banguncode/php-after
====================

A simple PHP library for BPJS Kesehatan fingerprint integration.

163PHP

Since Feb 11Pushed 3mo agoCompare

[ Source](https://github.com/banguncode/PHP-After)[ Packagist](https://packagist.org/packages/banguncode/php-after)[ RSS](/packages/banguncode-php-after/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

PHP After – BPJS Kesehatan Fingerprint Integration
==================================================

[](#php-after--bpjs-kesehatan-fingerprint-integration)

[![License](https://camo.githubusercontent.com/8bb50fd2278f18fc326bf71f6e88ca8f884f72f179d3e555e20ed30157190d0d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e2e737667)](LICENSE)

**PHP After** is a simple PHP library for **BPJS Kesehatan Fingerprint** integration.
It provides functions to **register, verify, and reset BPJS participants’ fingerprints** via the official BPJS Kesehatan API.

Features
--------

[](#features)

- **Authenticate** to BPJS Fingerprint server
- **Register** participant’s fingerprints (two fingers)
- **Verify** fingerprint using NIK or participant number
- **Reset** (delete) participant’s fingerprint

Important Information
---------------------

[](#important-information)

If you are using a web application with a DigitalPersona/HID device,
you **must** use the [HID Authentication Device Client SDK](https://digitalpersona.hidglobal.com/lite-client/)
and completely uninstall any currently installed SDK before installation.
If this is not done, the integration will **not** work.

For usage examples:

```
>

  vanilla

      Digitalpersona Fingerprint

        Captured Sample

    const api = new Fingerprint.WebApi();

    api.onSamplesAcquired = (event) => {
      const samples =
        typeof event.samples === "string" ?
        JSON.parse(event.samples) :
        event.samples;
      const sample = samples[0]?.Data || sample[0];

      const data = sample.replace(/-/g, '+').replace(/_/g, '/');

      document.getElementById("samples").innerHTML = data;

      // do your magic with data
    };

    api.onCommunicationFailed = (event) => {
      const errorEl = document.getElementById("error");
      errorEl.textContent = event.error?.message || "Communication failed";
      errorEl.classList.remove("d-none");
    };

    api.onDeviceDisconnected = (event) => {
      const errorEl = document.getElementById("error");
      errorEl.textContent = "Device disconnected";
      errorEl.classList.remove("d-none");
    };

    api.onErrorOccurred = (event) => {
      const errorEl = document.getElementById("error");
      errorEl.textContent = event.error?.message || "Error occurred";
      errorEl.classList.remove("d-none");
    };

    window.onload = async () => {
      try {
        /**
         * 1 = Raw = Input for feature extraction or conversion to WSQ/ISO templates.
         * 2 = Intermediate = Required for template generation (ANSI/ISO/FMR).
         * 3 = Compressed = Fingerprint image is compressed (lossy, FBI/NIST-approved).
         * 5 = PngImage = For display/preview in user interfaces.
         */

        await api.startAcquisition(Fingerprint.SampleFormat.Intermediate);
      } catch (error) {
        const errorEl = document.getElementById("error");
        errorEl.textContent = error.message || "Failed to start";
        errorEl.classList.remove("d-none");
      }
    };

```

Installation
------------

[](#installation)

Install the library via **Composer**:

```
composer require banguncode/php-after
```

Ensure PHP has the following extensions enabled:

- curl
- openssl

Requirements
------------

[](#requirements)

- PHP &gt;= 5.5
- Extensions: `ext-curl` and `ext-openssl`
- Valid BPJS Fingerprint account credentials

Usage
-----

[](#usage)

1. Initialization &amp; Authentication

```
