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

ActiveLibrary[API Development](/categories/api)

isa-sdk/sdk
===========

Unified PHP SDK for the ISA Platform (zyins, rapidsign, proxy). Bearer / License / Session factories, idempotent mutations, typed value objects, typed exception funnel. Companion to @software-automation-holdings-llc/sdk (JS), sah-sdk (Python), and github.com/Software-Automation-Holdings-LLC/sdk (Go).

1.0.9(4w ago)012↓88.9%Apache-2.0PHPPHP &gt;=8.2

Since Jun 1Pushed 4w agoCompare

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

READMEChangelogDependencies (24)Versions (11)Used By (0)

sah/sdk (PHP)
=============

[](#sahsdk-php)

Unified PHP SDK for the [Best Plan Pro API](https://docs.isaapi.com) — powered by the ZyINS engine. One Composer package, three product namespaces: `zyins` (underwriting), `rapidsign` (envelope and document workflows), `proxy` (`/v1/call` Algosure-HMAC bridge).

The canonical surface across SDK languages is the unified JS package at `packages/ts/src/` ([entry](../ts/src/index.ts)). This PHP package mirrors that surface in idiomatic PHP 8.2 — `readonly` classes, constructor promotion, named-args, PSR-18 transport.

Install
-------

[](#install)

```
composer require sah/sdk:^0.5.0
```

(Private Packagist; auto-update is wired to this repository. Tag pattern is `sdk/vX.Y.Z` on isa-platform — one tag, one publish per language. The flat `sdk-php` mirror is tagged `vX.Y.Z` for Packagist webhook discovery.)

Quick start — bearer mode
-------------------------

[](#quick-start--bearer-mode)

```
use Isa\Sdk\Isa;
use Isa\Sdk\Zyins\Applicant;
use Isa\Sdk\Zyins\Coverage;
use Isa\Sdk\Zyins\Height;
use Isa\Sdk\Zyins\NicotineUsage;
use Isa\Sdk\Zyins\Reference\PrequalifyRequest;
use Isa\Sdk\Zyins\Sex;
use Isa\Sdk\Zyins\Weight;
use Isa\Sdk\Catalog\Products;

$isa = Isa::withBearer();   // reads ISA_TOKEN from env

$request = new PrequalifyRequest(
    applicant: new Applicant(
        dob: '1962-04-18',
        sex: Sex::Male,
        height: Height::fromFeetInches(5, 10),
        weight: Weight::fromPounds(195),
        state: 'NC',
        nicotineUse: NicotineUsage::None,
    ),
    coverage: Coverage::faceValue(25_000),
    products: [Products::fex()->aetnaAccendo()],
);
$result = $isa->zyins->prequalify->run($request);
```

Factories
---------

[](#factories)

FactoryEnv vars consulted when unsetWire shape`Isa::withBearer($token = null)``ISA_TOKEN``Authorization: Bearer isa_*``Isa::withKeycode($keycode = null, $email = null)``ISA_LICENSE_KEYCODE`, `ISA_LICENSE_EMAIL``Authorization: License ``Isa::withLicense($keycode = null, $email = null)``ISA_LICENSE_KEYCODE`, `ISA_LICENSE_EMAIL``Authorization: License ` — deprecated alias for `withKeycode``Isa::withSession($id = null, $secret = null)``ISA_SESSION_ID`, `ISA_SESSION_SECRET``Authorization: Session ``withKeycode` is the canonical factory for agent-tool (BPP) integrations. `withLicense` is a deprecated alias that will be removed in a future major version. Use `withKeycode` in new code.

Missing env vars raise `Isa\Sdk\Zyins\Exception\IsaConfigException` with the exact variable name in the message.

Your first call
---------------

[](#your-first-call)

```
use Isa\Sdk\Isa;
use Isa\Sdk\Zyins\Applicant;
use Isa\Sdk\Zyins\Coverage;
use Isa\Sdk\Zyins\Height;
use Isa\Sdk\Zyins\NicotineUsage;
use Isa\Sdk\Zyins\Reference\PrequalifyRequest;
use Isa\Sdk\Zyins\Sex;
use Isa\Sdk\Zyins\Weight;
use Isa\Sdk\Catalog\Products;

$isa = Isa::withKeycode(
    keycode: 'SDV-HWH-WDD',
    email:   'john.doe@acme-agency.com',
);
$result = $isa->zyins->prequalify->run(new PrequalifyRequest(
    applicant: new Applicant(
        dob: '1962-04-18',
        sex: Sex::Male,
        height: Height::fromFeetInches(5, 10),
        weight: Weight::fromPounds(195),
        state: 'NC',
        nicotineUse: NicotineUsage::None,
    ),
    coverage:  Coverage::faceValue(25_000),
    products:  [Products::fex()->aetnaAccendo()],
));
echo $result->plans[0]->pricing[0]->premium?->amount->display;
```

Per-surface API versions
------------------------

[](#per-surface-api-versions)

The ISA API is a federation of independently versioned surfaces. Every SDK release exports a frozen `BundledApiVersions::MAP` recording which `/vN`each surface targets:

```
use Isa\Sdk\Zyins\Options\BundledApiVersions;

print_r(BundledApiVersions::MAP);
// [
//   'prequalify' => 'v2',
//   'quote'      => 'v2',
//   'datasets'   => 'v2',
//   'reference'  => 'v2',
//   'sessions'   => 'v1',
//   'branding'   => 'v1',
//   'cases'      => 'v1',
// ]
```

Pin individual surfaces with a per-surface `apiVersion` map. There is **no**`default` key and **no** string shorthand — resolution is `$apiVersion[$surface] ?? BundledApiVersions::MAP[$surface]`:

```
$isa = Isa::withKeycode(
    keycode:    'SDV-HWH-WDD',
    email:      'john.doe@acme-agency.com',
    apiVersion: ['quote' => 'v2'],   // pin only quote; everything else bundled
);
```

The release that retargets `prequalify` / `quote` / `datasets` / `reference`to `v3` will bump those entries. See [SDK syntax proposal §2.7](../../docs/sdk-syntax-proposal.md#27-versioning--per-surface-not-global).

Reference data — `->match()`
----------------------------

[](#reference-data---match)

The unversioned `$isa->zyins->reference` namespace canonicalizes free-text medication and condition input. Unknown text never rejects — it returns a structured concept with `isKnown === false`, so the final canonicalization fires server-side at `/vN/prequalify`:

```
$ds = $isa->zyins->datasets->get(include: ['conditions', 'medications']);

$insulin = $isa->zyins->medications->match('insulin');
echo $insulin->id, ' ', $insulin->name, ' ', var_export($insulin->isKnown, true);
// med_01KSR2WVAGC05ZGR6FA4QYEB12 INSULIN true

// Symmetric traversal — which conditions is insulin used for?
$usedFor = $insulin->conditions($isa->zyins->reference->sort::MostCommonFirst);
// frequency-ordered array; cond_01KSR2WVAGC05ZGR6FA4QYEA8X first

$novel = $isa->zyins->medications->match('NewExperimental XR 2026');
// $novel->isKnown === false; $novel->inputText === 'NewExperimental XR 2026'
```

`Sort::MostCommonFirst` and `Sort::Alphabetical` are the two supported orderings.

Case storage — bring your own
-----------------------------

[](#case-storage--bring-your-own)

`$isa->zyins->cases->*` routes through a `CaseStorage` adapter. The default is the zero-knowledge store — ISA's servers only hold ciphertext and an opaque ID. To plug a carrier-controlled store, pass your adapter at construction:

```
$isa = Isa::withKeycode(
    keycode: $keycode, email: $email,
    caseStorage: new CarrierCaseStorage(),  // optional; default = ZeroKnowledgeCaseStorage
);
```

See [cases guide](https://docs.isaapi.com/docs/cases) for the full bring-your-own pattern.

Product namespaces
------------------

[](#product-namespaces)

```
