PHPackages                             duphlux/duphlux - 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. duphlux/duphlux

ActiveLibrary[API Development](/categories/api)

duphlux/duphlux
===============

Duphlux API PHP Library

v1.0.0(9y ago)0181MITPHPPHP &gt;=5.4

Since Jun 16Pushed 9y ago1 watchersCompare

[ Source](https://github.com/Duphlux/duphlux-php-lib)[ Packagist](https://packagist.org/packages/duphlux/duphlux)[ RSS](/packages/duphlux-duphlux/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

Duphlux API PHP Library
=======================

[](#duphlux-api-php-library)

- [Installation](https://github.com/Duphlux/duphlux-php-lib#installation)
- [Usage](https://github.com/Duphlux/duphlux-php-lib#usage)

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

[](#installation)

The preferred way to install this extension is through composer.

Either run

```
composer require duphlux/duphlux
```

**or**

add '"duphlux/duphlux": "1.0.0"' to the require section of your composer.json file, then run:

```
composer install
```

Usage
-----

[](#usage)

First of all, create an account on [Duphlux](www.duphlux.com) - You will need your account token to use the service.

There are two operations that can be performed on the system:

- **authenticate:** Initialize a phone number verification request

    ```
      use duphlux/Duphlux;

      //duphlux account token
      $token = [your-duphlux-account-token];

      // Instantiate the duphlux class, requires your account token
      $duphlux = new Duphlux($token);

      //you can generate reference using the generateRef method (note that uniqueness is not guaranteed)
      //you may choose to generate your reference another way
      $reference = $duphlux->generateRef(32);

      //set up the request parameters for the authentication request
      $options = ['phone_number'=>[phone-number-to-verify],'transaction_reference'=>$reference,
                'timeout'=>60,'redirect_url'=>[my-redirect-url]];

      // Initializing an authentication request
      //you can chain this method with the redirect method to immediately redirect to the duphlux verification url
      $duphlux->authenticate($options);
    ```

    **or**

    ```
      //chained authenticate request with redirect method
      $duphlux->authenticate($options)->redirect();
    ```

    To check if the api call was successfull

    ```
      //checks if an error occurred during the operation
      if ($duphlux->hasError)
      {
          //gets the request error
          $error = $duphlux->getError();
      }
      else
      {
          //gets the request response returned from the request
          //you may specify a specific key to get the value from the response information
          $response = $duphlux->getResponse();

          //
      }
    ```
- **checkStatus:** Check the status of a previous request

    ```
      use duphlux/Duphlux;

      //duphlux account token
      $token = [your-duphlux-account-token];

      // Instantiate the duphlux class
      $duphlux = new Duphlux($token);

      //previous authentication request reference for which you want to inquire about the status
      $reference = getReferenceFromMyDb();

      // check the status of an authentication request
      // the previous authentication request reference is required, it is passed as a parameter
      $status = $duphlux->checkStatus($reference);
    ```

    you can chain the above method with the following:

    ```
    //checks the response gotten to see whether the phone number verification was successfull
    $verified = $status->isVerified();

    //checks the response gotten to see whether the phone number verification is still pending
    $pending = $status->isPending();

    //checks the response gotten to see whether the phone number verification failed
    $failed = $status->isFailed();
    ```

    Also, you can set the following properties - beforeSend and afterSend, which must be callbacks, before performing any operation. They are passed an instance of the Duphlux class and are called before and after an api request is made. See example below:

    ```
      use duphlux/Duphlux;

      //duphlux account token
      $token = [your-duphlux-account-token];

      //previous authentication request reference for which we want to inquire about the status
      $reference = getReferenceFromMyDb();

      // Instantiate the duphlux class
      $duphlux = new Duphlux($token);

      //this sets the beforeSend handler which is triggered before a any request is made
      //this can be any callable (anonymous function or class method)
      $duphlux->beforeSend = function($duphlux)
      {
          //here you can now perform any logic u want
          log($duphlux->getRequestOptions());
      };

      //this sets the afterSend handler which is triggered after a request is made
      //this can be any callable (anonymous function or class method)
      $duphlux->afterSend = function($duphlux)
      {
          //here you can now perform any logic u want
          log($duphlux->getResponse());
      };

      // verify the status of an authentication request
      // the previous authentication request reference is required, it is passed as a parameter
      $duphlux->checkStatus($reference);
    ```

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity58

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

3301d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6a403d0b80a28be7f6a4d1846d9a00b269a49046339bd1ac3b472f4d5310f6bc?d=identicon)[klipsedeville](/maintainers/klipsedeville)

---

Top Contributors

[![smladeoye](https://avatars.githubusercontent.com/u/12571220?v=4)](https://github.com/smladeoye "smladeoye (1 commits)")

---

Tags

phpapilibraryphone-numberphone number verificationsmladeoyeduphlux

### Embed Badge

![Health badge](/badges/duphlux-duphlux/health.svg)

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

###  Alternatives

[checkout/checkout-sdk-php

Checkout.com SDK for PHP

563.5M11](/packages/checkout-checkout-sdk-php)[getjump/vk

Library for work with API Vk.com

20048.5k](/packages/getjump-vk)[mikealmond/musicbrainz

A PHP library for accessing the MusicBrainz API

6387.3k1](/packages/mikealmond-musicbrainz)

PHPackages © 2026

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