PHPackages                             vernesoft/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. vernesoft/sdk

ActiveLibrary

vernesoft/sdk
=============

Official PHP SDK for the Verne Nautilus platform

1.1.0(3d ago)10MITPHPPHP &gt;=8.1

Since Jul 21Pushed 3d agoCompare

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

READMEChangelogDependencies (3)Versions (2)Used By (0)

Verne Software PHP SDK
======================

[](#verne-software-php-sdk)

[![Packagist Version](https://camo.githubusercontent.com/60650cd4c03c013b8bdc6777622e31a90e4eac6b92d84b0e5daa8a058d3153eb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7665726e65736f66742f73646b2e737667)](https://packagist.org/packages/vernesoft/sdk)[![PHP](https://camo.githubusercontent.com/7535257ca228724c93658bd52583d4e47a9bab02c356abf6e54c1d575f2151e6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e312532422d626c75652e737667)](#)[![License](https://camo.githubusercontent.com/8bb50fd2278f18fc326bf71f6e88ca8f884f72f179d3e555e20ed30157190d0d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e2e737667)](LICENSE)

The official PHP library for the [Verne Nautilus](https://vernesoft.com) platform.

> **Server-side only.** API keys carry full service access and must never be used in browser or client-side code.

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

[](#requirements)

PHP 8.1 or later.

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

[](#installation)

```
composer require vernesoft/sdk
```

Quick Start
-----------

[](#quick-start)

```
use Vernesoft\Verne;

$verne = new Verne(
    relay: $_ENV['VERNE_RELAY_KEY'],
    gate: $_ENV['VERNE_GATE_KEY'],
);
```

You can also instantiate services independently if you only need one:

```
use Vernesoft\Relay;
use Vernesoft\Gate;

$relay = new Relay(apiKey: $_ENV['VERNE_RELAY_KEY']);
$gate  = new Gate(apiKey: $_ENV['VERNE_GATE_KEY']);
```

Relay — Webhooks-as-a-Service
-----------------------------

[](#relay--webhooks-as-a-service)

Send events to all subscribed endpoints:

```
$message = $verne->relay()->messages()->send(
    eventType: 'user.created',
    payload: ['id' => 'usr_123'],
);
```

Optional parameters:

```
$message = $verne->relay()->messages()->send(
    eventType: 'order.placed',
    payload: ['order_id' => '999'],
    idempotencyKey: 'evt_abc', // prevent duplicate delivery within 24h
    channels: ['team-a'],      // restrict to specific endpoint channels
);
```

List previously sent events:

```
$page = $verne->relay()->messages()->list(limit: 20, eventType: 'user.created');

$page->data;       // Message[]
$page->hasMore;    // bool
$page->nextCursor; // pass to the next call to paginate
```

Gate — Auth-as-a-Service
------------------------

[](#gate--auth-as-a-service)

### Identity Management

[](#identity-management)

Manage your end-users. The `tenant_id` is automatically scoped to your API key.

```
// Create a user
$identity = $verne->gate()->identities()->create(
    schemaId: 'user',
    traits: [
        'email' => 'user@example.com',
        'custom_data' => ['role' => 'editor'],
    ],
    credentials: [
        'password' => ['config' => ['password' => 'StrongPassword123!']],
    ],
    state: 'active',
);

// Get a user
$verne->gate()->identities()->get($identity->id);

// Update a user (JSON Patch — RFC 6902)
$verne->gate()->identities()->patch($identity->id, [
    ['op' => 'replace', 'path' => '/traits/custom_data/role', 'value' => 'admin'],
]);

// Delete a user
$verne->gate()->identities()->delete($identity->id);

// Activate / deactivate a user (an inactive user cannot log in)
$verne->gate()->identities()->deactivate($identity->id);
$verne->gate()->identities()->activate($identity->id);
// …or set the state explicitly:
$verne->gate()->identities()->setState($identity->id, 'inactive');

// Resend the email verification link
$verne->gate()->identities()->resendVerification($identity->id);
```

### Security Settings

[](#security-settings)

Read or replace the tenant's security settings (passwordless login, TOTP MFA):

```
$security = $verne->gate()->settings()->getSecurity();
// $security->passwordlessEnabled, $security->mfaEnabled

// Both fields are required — the update is a full replacement, not a merge.
$verne->gate()->settings()->updateSecurity(
    passwordlessEnabled: true,
    mfaEnabled: false,
);
```

### Access Tokens

[](#access-tokens)

Exchange your long-lived API key for a short-lived access token:

```
$token = $verne->gate()->tokens()->create(
    subject: 'usr_123',
    scopes: ['gate.tokens.read'], // optional
    ttlSeconds: 3600,             // optional, default 3600, max 86400
);

// $token->accessToken — attach to downstream requests
// $token->expiresAt  — ISO 8601 expiry
```

Validate a token:

```
$info = $verne->gate()->tokens()->introspect($token->accessToken);

if (! $info->active) {
    // token is expired or invalid
}
```

### Authorization

[](#authorization)

Check whether a subject is allowed to perform an action:

```
$decision = $verne->gate()->authorize(
    subject: 'usr_123',
    action: 'relay.messages.read',
    resource: 'tenant:ten_001',
);

if (! $decision->allowed) {
    throw new \RuntimeException('Forbidden');
}
```

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

[](#error-handling)

All API errors throw a `VerneApiException` with structured fields:

```
use Vernesoft\Core\Errors\VerneApiException;
use Vernesoft\Core\Errors\VerneException;

try {
    $verne->relay()->messages()->send(eventType: 'ping', payload: []);
} catch (VerneApiException $e) {
    $e->getErrorCode(); // e.g. 'invalid_payload', 'unauthorized'
    $e->getCode();      // HTTP status code
    $e->getRequestId(); // include in support requests
    $e->getMessage();   // human-readable message
} catch (VerneException $e) {
    // network error or timeout
}
```

Configuration
-------------

[](#configuration)

Both `Verne` and the per-service clients accept an optional `timeoutSeconds` (default `30`):

```
$verne = new Verne(
    relay: $_ENV['VERNE_RELAY_KEY'],
    timeoutSeconds: 10,
);
```

License
-------

[](#license)

MIT

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance99

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity42

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

3d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4023397?v=4)[Max 🐞 Zhuk](/maintainers/ZhukMax)[@ZhukMax](https://github.com/ZhukMax)

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

---

Top Contributors

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

---

Tags

phpphp-libraryphp8saassdk

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

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

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

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.2k543.5M2.7k](/packages/aws-aws-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k656.1k46](/packages/neuron-core-neuron-ai)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M47](/packages/tencentcloud-tencentcloud-sdk-php)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

293.1k](/packages/eslazarev-wildberries-sdk)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k16](/packages/tempest-framework)[files.com/files-php-sdk

Files.com PHP SDK

2481.1k](/packages/filescom-files-php-sdk)

PHPackages © 2026

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