PHPackages                             lessotp/sdk - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. lessotp/sdk

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

lessotp/sdk
===========

LessOTP Inbound WhatsApp Authentication client SDK for PHP.

00PHP

Since Jun 20Pushed todayCompare

[ Source](https://github.com/lessotp/sdk-php)[ Packagist](https://packagist.org/packages/lessotp/sdk)[ RSS](/packages/lessotp-sdk/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

LessOTP PHP SDK
===============

[](#lessotp-php-sdk)

Client for the **LessOTP Inbound WhatsApp Authentication API** (PHP 7.4+).

Install
-------

[](#install)

```
composer require lessotp/sdk
```

Usage
-----

[](#usage)

```
use LessOTP\Sdk\Client;
use LessOTP\Sdk\VerifyWebhookSignature;

// production (default)
$client = new Client(getenv('LESSOTP_API_KEY'), 'https://api.lessotp.com');

// staging
$staging = new Client(
    getenv('LESSOTP_STAGING_API_KEY'),
    'https://api.lessotp.com',
    null,
    10,
    'staging'
);

// strict
$result = $client->authRequest('6281234567890');
echo $result->getRequestId(), PHP_EOL;

// frictionless
$result = $client->authRequest();

// per-call override
$result = $client->authRequest('6281234567890', 'staging');

// webhook verification
$raw = file_get_contents('php://input');
$sig = $_SERVER['HTTP_X_SIGNATURE'] ?? '';

if (!VerifyWebhookSignature::hmac($raw, $sig, getenv('LESSOTP_WEBHOOK_SECRET'))) {
    http_response_code(403);
    exit;
}
```

API
---

[](#api)

### `new Client($apiKey, $baseUrl = 'https://api.lessotp.com', $http = null, $timeoutSeconds = 10, $environment = 'production')`

[](#new-clientapikey-baseurl--httpsapilessotpcom-http--null-timeoutseconds--10-environment--production)

ParameterDefaultDescription`$apiKey`requiredApp API key.`$baseUrl``https://api.lessotp.com`API host.`$http``null`Optional `GuzzleHttp\Client`.`$timeoutSeconds``10`HTTP timeout.`$environment``'production'``'production'` or `'staging'`.### `$client->authRequest($phoneNumber = null, $environment = null): AuthRequestResult`

[](#client-authrequestphonenumber--null-environment--null-authrequestresult)

Calls the endpoint selected by `$environment`. The per-call `$environment` overrides the client environment.

### `VerifyWebhookSignature::hmac($rawBody, $signatureHeader, $secret): bool`

[](#verifywebhooksignaturehmacrawbody-signatureheader-secret-bool)

Constant-time HMAC-SHA256 verification. Accepts raw hex and `sha256=` prefixed values.

Errors
------

[](#errors)

Throws `LessOTP\Sdk\LessOTPException` on transport, auth, or payload problems.

Tests
-----

[](#tests)

```
composer install
composer test
```

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance65

Regular maintenance activity

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/295308648?v=4)[lessotp](/maintainers/lessotp)[@lessotp](https://github.com/lessotp)

---

Top Contributors

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

### Embed Badge

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

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

###  Alternatives

[kartik-v/yii2-password

Useful password strength validation utilities for Yii Framework 2.0

761.2M17](/packages/kartik-v-yii2-password)[better-futures-studio/filament-local-logins

This is my package filament-local-logins

1334.6k](/packages/better-futures-studio-filament-local-logins)

PHPackages © 2026

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