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

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

heroshots/sdk
=============

Official PHP SDK for the HeroShots / StudioHero platform (JWT/API key auth).

v0.2.3(1mo ago)10MITPHPPHP &gt;=8.1CI passing

Since Jun 24Pushed 1mo agoCompare

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

READMEChangelog (2)Dependencies (4)Versions (6)Used By (0)

heroshots/sdk (PHP SDK)
=======================

[](#heroshotssdk-php-sdk)

High-level PHP client for the HeroShots / StudioHero platform, authenticated with a **portal JWT or API key**. PSR-4 namespace `HeroShots\`.

Scope: image generation (incl. still-life), short video, long video, still-life video, the full Studio Hero storyboard flow, avatar listing &amp; generation, and account balance. See [`GUIDE.md`](./GUIDE.md) for use-case walkthroughs.

Install
-------

[](#install)

```
composer require heroshots/sdk
```

Requires PHP 8.1+. Runtime dependency: `guzzlehttp/guzzle`.

Authenticate
------------

[](#authenticate)

```
use HeroShots\Client;

// Email/password login: stores the JWT, auto re-logins on expiry.
// Base URL defaults to https://app.heroshots.ai.
$client = Client::fromLogin('dev@partner.com', 'secret');

// Or reuse an existing token.
$client = new Client(token: 'eyJ...');
```

Agency act-as
-------------

[](#agency-act-as)

Agency API keys can operate as a managed brand by passing the `managedUserId`returned by the managed-client provisioning API. The SDK adds `X-Managed-User-Id` to authenticated requests.

```
use HeroShots\Client;

$client = new Client(token: 'lz_live_YOUR_AGENCY_KEY', managedUserId: 12345);
$job = $client->images->generate('https://example.com/product.jpg');

// Switch target brand later, or pass null to clear it.
$client->withManagedUser(67890);
```

Usage
-----

[](#usage)

```
// Local file paths are auto-uploaded to hosted URLs.
$briefs = $client->storyboard->briefSuggestions('product.jpg', 'model.jpg', [
    'duration_seconds' => 30, 'language_code' => 'it',
]);

$candidates = $client->storyboard->candidates($briefs[0], 30, 'product.jpg', 'model.jpg');

$job = $client->storyboard->generate($briefs[0], 30, $candidates[0], 'product.jpg', 'model.jpg');
$sb  = $client->storyboard->wait($job['job_id']);          // polls until done/failed

$vjob  = $client->longvideo->start('product.jpg', null, $sb['storyboard']);
$final = $client->longvideo->wait($vjob['job_id']);
echo $final['final_video_url'];
```

Extra backend fields go in the trailing `$payload`/`$fields` array argument and are forwarded verbatim. `/api/v1` billing metadata is under `$result['_meta']`.

Resources
---------

[](#resources)

`uploads` · `images` · `videos` · `longvideo` · `stilllife` · `storyboard` · `avatars`

Plus on the client: `login()`, `me()`, `balance()`, `stats()`.

Errors
------

[](#errors)

```
use HeroShots\Errors\ValidationException;

try {
    $client->storyboard->candidates('', 30, 'p.jpg');
} catch (ValidationException $e) {
    echo $e->errorCode . ': ' . $e->getMessage();
}
```

All errors extend `HeroShots\Errors\ApiException` (`->errorCode`, `->status`, `->details`).

Test
----

[](#test)

```
composer install
composer test       # PHPUnit, offline (Guzzle MockHandler)
```

Billing
-------

[](#billing)

Generations cost credits. Check remaining credits with `$client->balance()`(`hs_credits` + `wallet_balance`). Use `$client->stats()` for the full raw `/api/auth/stats` payload, including recent generations and offered plans. See `examples/full_storyboard_flow.php`.

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance91

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity36

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.

###  Release Activity

Cadence

Every ~5 days

Total

5

Last Release

42d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/15e02d34fbc1592ae8cc7831cf272d95222f6d99217ac782dc9d800aa785e69e?d=identicon)[JasonPriore](/maintainers/JasonPriore)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[aws/aws-sdk-php

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

6.2k555.0M2.9k](/packages/aws-aws-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k832.6k56](/packages/neuron-core-neuron-ai)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3661.3M49](/packages/tencentcloud-tencentcloud-sdk-php)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

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

The PHP framework that gets out of your way.

2.3k37.6k21](/packages/tempest-framework)[ellaisys/aws-cognito

Laravel Authentication using AWS Cognito (Web and API)

121269.8k1](/packages/ellaisys-aws-cognito)

PHPackages © 2026

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