PHPackages                             ding-live/ding-php - 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. ding-live/ding-php

ActiveLibrary

ding-live/ding-php
==================

v0.12.0(1y ago)12172[1 issues](https://github.com/ding-live/ding-php/issues)[2 PRs](https://github.com/ding-live/ding-php/pulls)MITPHPPHP ^8.2

Since Nov 8Pushed 1y ago1 watchersCompare

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

READMEChangelog (10)Dependencies (10)Versions (113)Used By (0)

Ding PHP SDK
============

[](#ding-php-sdk)

The Ding PHP library provides convenient access to the Ding API from applications written in the PHP language.

SDK Installation
================

[](#sdk-installation)

Composer
--------

[](#composer)

```
composer require "ding/sdk"
```

SDK Example Usage
-----------------

[](#sdk-example-usage)

SDK Example Usage
-----------------

[](#sdk-example-usage-1)

### Send a code

[](#send-a-code)

Send an OTP code to a user's phone number.

```
declare(strict_types=1);

require 'vendor/autoload.php';

use Ding\DingSDK;
use Ding\DingSDK\Models\Shared;

$security = 'YOUR_API_KEY';

$sdk = DingSDK\Ding::builder()->setSecurity($security)->build();

$request = new Shared\CreateAuthenticationRequest(
    customerUuid: 'cf2edc1c-7fc6-48fb-86da-b7508c6b7b71',
    phoneNumber: '+1234567890',
    locale: 'fr-FR',
);

$response = $sdk->otp->createAuthentication(
    request: $request
);

if ($response->createAuthenticationResponse !== null) {
    // handle response
}
```

### Check a code

[](#check-a-code)

Check that a code entered by a user is valid.

```
declare(strict_types=1);

require 'vendor/autoload.php';

use Ding\DingSDK;
use Ding\DingSDK\Models\Shared;

$security = 'YOUR_API_KEY';

$sdk = DingSDK\Ding::builder()->setSecurity($security)->build();

$request = new Shared\CreateCheckRequest(
    authenticationUuid: 'eebe792b-2fcc-44a0-87f1-650e79259e02',
    checkCode: '123456',
    customerUuid: '64f66a7c-4b2c-4131-a8ff-d5b954cca05f',
);

$response = $sdk->otp->check(
    request: $request
);

if ($response->createCheckResponse !== null) {
    // handle response
}
```

### Perform a retry

[](#perform-a-retry)

Perform a retry if a user has not received the code.

```
declare(strict_types=1);

require 'vendor/autoload.php';

use Ding\DingSDK;
use Ding\DingSDK\Models\Shared;

$security = 'YOUR_API_KEY';

$sdk = DingSDK\Ding::builder()->setSecurity($security)->build();

$request = new Shared\RetryAuthenticationRequest(
    authenticationUuid: 'a4e4548a-1f7b-451a-81cb-a68ed5aff3b0',
    customerUuid: '28532118-1b33-420a-b57b-648c9bf85fee',
);

$response = $sdk->otp->retry(
    request: $request
);

if ($response->retryAuthenticationResponse !== null) {
    // handle response
}
```

### Send feedback

[](#send-feedback)

Send feedback about the authentication process.

```
declare(strict_types=1);

require 'vendor/autoload.php';

use Ding\DingSDK;
use Ding\DingSDK\Models\Shared;

$security = 'YOUR_API_KEY';

$sdk = DingSDK\Ding::builder()->setSecurity($security)->build();

$request = new Shared\FeedbackRequest(
    customerUuid: 'cc0f6c04-40de-448f-8301-3cb0e6565dff',
    phoneNumber: '+1234567890',
    status: Shared\FeedbackRequestStatus::Onboarded,
);

$response = $sdk->otp->feedback(
    request: $request
);

if ($response->feedbackResponse !== null) {
    // handle response
}
```

### Get authentication status

[](#get-authentication-status)

Get the status of an authentication.

```
declare(strict_types=1);

require 'vendor/autoload.php';

use Ding\DingSDK;

$security = 'YOUR_API_KEY';

$sdk = DingSDK\Ding::builder()->setSecurity($security)->build();

$response = $sdk->otp->getAuthenticationStatus(
    authUuid: 'd8446450-f2fa-4dd9-806b-df5b8c661f23'
);

if ($response->authenticationStatusResponse !== null) {
    // handle response
}
```

### Look up for phone number

[](#look-up-for-phone-number)

Perform a phone number lookup.

```
declare(strict_types=1);

require 'vendor/autoload.php';

use Ding\DingSDK;

$security = 'YOUR_API_KEY';

$sdk = DingSDK\Ding::builder()->setSecurity($security)->build();

$response = $sdk->lookup->lookup(
    customerUuid: '69a197d9-356c-45d1-a807-41874e16b555',
    phoneNumber: ''

);

if ($response->lookupResponse !== null) {
    // handle response
}
```

Available Resources and Operations
----------------------------------

[](#available-resources-and-operations)

Available methods### [lookup](docs/sdks/lookup/README.md)

[](#lookup)

- [lookup](docs/sdks/lookup/README.md#lookup) - Look up for phone number

### [otp](docs/sdks/otp/README.md)

[](#otp)

- [check](docs/sdks/otp/README.md#check) - Check a code
- [createAuthentication](docs/sdks/otp/README.md#createauthentication) - Send a code
- [feedback](docs/sdks/otp/README.md#feedback) - Send feedback
- [getAuthenticationStatus](docs/sdks/otp/README.md#getauthenticationstatus) - Get authentication status
- [retry](docs/sdks/otp/README.md#retry) - Perform a retry

Summary
-------

[](#summary)

Ding: The OTP API allows you to send authentication codes to your users using their phone numbers.

Table of Contents
-----------------

[](#table-of-contents)

- [SDK Installation](#sdk-installation)
- [SDK Example Usage](#sdk-example-usage)
- [Available Resources and Operations](#available-resources-and-operations)
- [Error Handling](#error-handling)
- [Server Selection](#server-selection)

SDK Installation
----------------

[](#sdk-installation-1)

The SDK relies on [Composer](https://getcomposer.org/) to manage its dependencies.

To install the SDK and add it as a dependency to an existing `composer.json` file:

```
composer require "ding-live/ding-php"
```

Error Handling
--------------

[](#error-handling)

Handling errors in this SDK should largely match your expectations. All operations return a response object or throw an exception.

By default an API error will raise a `Errors\SDKException` exception, which has the following properties:

PropertyTypeDescription`$message`*string*The error message`$statusCode`*int*The HTTP status code`$rawResponse`*?\\Psr\\Http\\Message\\ResponseInterface*The raw HTTP response`$body`*string*The response contentWhen custom error responses are specified for an operation, the SDK may also throw their associated exception. You can refer to respective *Errors* tables in SDK docs for more details on possible exception types for each operation. For example, the `check` method throws the following exceptions:

Error TypeStatus CodeContent TypeErrors\\SDKException4XX, 5XX\*/\*### Example

[](#example)

```
declare(strict_types=1);

require 'vendor/autoload.php';

use Ding\DingSDK;
use Ding\DingSDK\Models\Shared;

$security = 'YOUR_API_KEY';

$sdk = DingSDK\Ding::builder()->setSecurity($security)->build();

try {
    $request = new Shared\CreateCheckRequest(
        authenticationUuid: 'eebe792b-2fcc-44a0-87f1-650e79259e02',
        checkCode: '123456',
        customerUuid: '64f66a7c-4b2c-4131-a8ff-d5b954cca05f',
    );

    $response = $sdk->otp->check(
        request: $request
    );

    if ($response->createCheckResponse !== null) {
        // handle response
    }
} catch (Errors\SDKException $e) {
    // handle default exception
    throw $e;
}
```

Server Selection
----------------

[](#server-selection)

Server Selection
----------------

[](#server-selection-1)

### Select Server by Index

[](#select-server-by-index)

You can override the default server globally by passing a server index to the `server_idx: int` optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the indexes associated with the available servers:

\#ServerVariables0`https://api.ding.live/v1`None### Override Server URL Per-Client

[](#override-server-url-per-client)

The default server can also be overridden globally by passing a URL to the `server_url: str` optional parameter when initializing the SDK client instance. For example:

Development
===========

[](#development)

Maturity
--------

[](#maturity)

This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally looking for the latest version.

Contributions
-------------

[](#contributions)

While we value open-source contributions to this SDK, this library is generated programmatically. Feel free to open a PR or a Github issue as a proof of concept and we'll do our best to include it in a future release!

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 93.4% 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

Every ~10 days

Recently: every ~24 days

Total

37

Last Release

564d ago

PHP version history (3 changes)v0.1.0PHP &gt;=8.1.0

v0.8.2PHP ^8.1

v0.12.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/1004274a7214305e8efe81a112658c8740a93a89829d30af8d7bb35573d78171?d=identicon)[ding-live](/maintainers/ding-live)

---

Top Contributors

[![speakeasybot](https://avatars.githubusercontent.com/u/108416695?v=4)](https://github.com/speakeasybot "speakeasybot (71 commits)")[![aym-v](https://avatars.githubusercontent.com/u/18191750?v=4)](https://github.com/aym-v "aym-v (4 commits)")[![vbatoufflet](https://avatars.githubusercontent.com/u/598433?v=4)](https://github.com/vbatoufflet "vbatoufflet (1 commits)")

---

Tags

dingding-sdk

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/ding-live-ding-php/health.svg)

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

###  Alternatives

[clerkinc/backend-php

2755.0k](/packages/clerkinc-backend-php)[polar-sh/sdk

4014.5k4](/packages/polar-sh-sdk)[dnsimple/dnsimple

The DNSimple API client for PHP.

11190.9k1](/packages/dnsimple-dnsimple)

PHPackages © 2026

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