PHPackages                             amsi/bank-id - 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. [API Development](/categories/api)
4. /
5. amsi/bank-id

ActiveLibrary[API Development](/categories/api)

amsi/bank-id
============

Library for BankID NBU api

1(4y ago)07PHPPHP &gt;=8.0.0

Since Dec 16Pushed 4y ago1 watchersCompare

[ Source](https://github.com/AmsiVolv/bankid-api)[ Packagist](https://packagist.org/packages/amsi/bank-id)[ RSS](/packages/amsi-bank-id/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (1)Dependencies (4)Versions (2)Used By (0)

BankID API for UA.
==================

[](#bankid-api-for-ua)

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

[](#requirements)

You need to download and install PHP extension [EUSPHPE](https://iit.com.ua/download/EUSPHPE-20211206.zip). Instalation manual is located in

- root
    - EUSPHPE
        - EUSignPHPDescription.doc

### Short manual for PHP-FPM (PHP v. 8.0)

[](#short-manual-for-php-fpm-php-v-80)

1. Create a directory - **/usr/lib/php/8.0/eusphpe\_extension**
2. Unpack [downloaded archive](https://iit.com.ua/download/EUSPHPE-20211206.zip) to **/usr/lib/php/8.0/eusphpe\_extension** directory | *Pick only needed file (archive/Modules/Linux/64/eusphpei.64.8.0.3.tar)*
3. Add to **/usr/lib/systemd/system/php8.0-fpm.service** this line of code
    **`export LD_LIBRARY_PATH=/usr/lib/php/8.0/eusphpe_extension`**
4. Create a new file **/etc/php/8.0/fpm/conf.d/eusphpe.ini**, to this file add
    **`extension=/usr/lib/php/8.0/eusphpe_extension/eusphpe.so`**
5. Create a new directory for certificates (for example */data/certificates*)
6. Open **`  /usr/lib/php/8.0/eusphpe_extension/osplm.ini`** and edit **Path** parameter (for example */data/certificates (directory from previous step)*).
7. Open certificate directory (for example */data/certificates*) and unpack [this archive](https://drive.google.com/file/d/1vkN_RdXapHp0n0gHU52v6i6yN90c01f5/view?usp=sharing) inside it. 8.Restart FPM **`service php8.0-fpm restart`**

### Optional:

[](#optional)

Install [EUSPHPE stubs](https://github.com/andrew-svirin/phpstorm-stubs) for IDE

### Second step:

[](#second-step)

`composer require amsi/bankid-api`

Usage example
-------------

[](#usage-example)

Example file is **authenticate.php**. Create a new BankIdProvider

```
$bankIdProvider = new BankID(
  new Client(
     CLIENT_ID,       // -> Client ID reciveved from NBU
     CLIENT_SECRET,  // -> Client SECRET reciveved from NBU
     REDIRECT_URL,  // -> Redirect URL, defiened for NBU
     $cert,        // -> file_get_contents('certificate.cer')
     $key,        // -> file_get_contents('key.day')
     CERT_PASS,  // -> Certificate password
  new Config(Config::ENV_TEST) // -> For prod end -> new Config
 ));

```

1. Obtain authorization code

```
if (!isset($_GET['code'])) {
    $authUrl = $bankIdProvider->getAuthorizationUrl();
    $_SESSION['oauth2state'] = $bankIdProvider->getState();
    header(sprintf('Location: %s', $authUrl));
    exit;
}

```

2. Obtain access token

```
$token = $bankIdProvider->getAccessToken('authorization_code', [
    'code' => $_GET['code']
]);

```

3. Obtain user data

```
    /** @var ExpandedResourceOwnerInterface $user */ -> anotation is used to beeter code orientation
    $user = $bankIdProvider->getResourceOwner($token);

```

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1652d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ac634ce47cd83e7ad93c6fe38a7b4fac66a65719273feb97f4fb856802c6cada?d=identicon)[AmsiVolv](/maintainers/AmsiVolv)

---

Top Contributors

[![AmsiVolv](https://avatars.githubusercontent.com/u/44711189?v=4)](https://github.com/AmsiVolv "AmsiVolv (2 commits)")

---

Tags

Bankuabank-idbankidnbuNational Bank of Ukraine

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/amsi-bank-id/health.svg)

```
[![Health](https://phpackages.com/badges/amsi-bank-id/health.svg)](https://phpackages.com/packages/amsi-bank-id)
```

###  Alternatives

[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k12](/packages/tempest-framework)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3661.2M46](/packages/tencentcloud-tencentcloud-sdk-php)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

749284.3k35](/packages/civicrm-civicrm-core)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

252.5k](/packages/eslazarev-wildberries-sdk)[files.com/files-php-sdk

Files.com PHP SDK

2478.1k](/packages/filescom-files-php-sdk)[aimeos/prisma

A powerful PHP package for integrating media related Large Language Models (LLMs) into your applications

1772.4k4](/packages/aimeos-prisma)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
