PHPackages                             flashmandu/app-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. flashmandu/app-sdk

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

flashmandu/app-sdk
==================

Public SDK and contracts for Flashmandu app/plugin developers.

v1.0.1(yesterday)00proprietaryPHPPHP ^8.2CI failing

Since Jun 19Pushed yesterdayCompare

[ Source](https://github.com/flashmandu-org/flashmandu-app-sdk)[ Packagist](https://packagist.org/packages/flashmandu/app-sdk)[ RSS](/packages/flashmandu-app-sdk/feed)WikiDiscussions master Synced today

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

Flashmandu App SDK
==================

[](#flashmandu-app-sdk)

The public SDK for building **apps/plugins** that extend a Flashmandu storefront platform. The SDK exposes contracts; the platform keeps its implementation.

> This package is intentionally dependency-light (PHP 8.2+, contracts only) so it is fully standalone and independently versionable.

Install (app developer)
-----------------------

[](#install-app-developer)

```
composer require flashmandu/app-sdk
```

Build an app
------------

[](#build-an-app)

An app is any autoloaded class implementing `Flashmandu\AppSdk\AppProvider` that returns an `AppManifest`:

```
namespace Acme\Loyalty;

use Flashmandu\AppSdk\AppManifest;
use Flashmandu\AppSdk\AppProvider;

class Manifest implements AppProvider
{
    public function manifest(): AppManifest
    {
        return new AppManifest(
            id: 'acme/loyalty',
            name: 'Loyalty Points',
            version: '1.0.0',
            scopes: [Scope::ReadOrders],
        );
    }
}
```

Register the class in the platform's `config/apps.php` `registered` list. A merchant then installs it for their account on the platform's **Apps** page.

What an app can declare
-----------------------

[](#what-an-app-can-declare)

All optional except `id`/`name`/`version`:

- **`scopes`** — `Scope[]` the app requests at install (e.g. `ReadOrders`, `WriteCustomers`, `ManageStorefront`). `ManagePayments` is elevated and defaults to denied.
- **`hooks`** — an `AppHooks` implementation: declare listeners/filters that run **only for accounts that installed the app**: ```
    public function register(HookRegistrar $r): void
    {
        $r->on('order.status.changed', function (array $payload, AppContext $ctx): void {
            // $ctx->profileId() — the merchant; $ctx->hasScope(Scope::ReadOrders)
        });
        $r->filter('cart.totals', fn (mixed $value, AppContext $ctx) => $value);
    }
    ```
- **`admin`** — an `AdminUI` with `MenuItem[]`: the app contributes items to the merchant's admin sidebar (gated by `requiredScopes`).
- **`storefront`** — a `Storefront` with `SectionDefinition[]`: composable section templates (element-trees of **existing** page-builder elements) the merchant drops onto pages. Parity across the platform's renderers is inherited by construction — never introduce a new element type.
- Implement **`Installable`** as well to run `onInstall()` / `onUninstall()`lifecycle hooks (seed defaults, clean up).

Platform hooks reference (common)
---------------------------------

[](#platform-hooks-reference-common)

- Events: `order.status.changed` (`{order_id, status}`), and others the platform emits via `Hooks::emit()`.
- Filters: pipe a value through apps, e.g. `cart.totals`.

Test your app locally (no platform needed)
------------------------------------------

[](#test-your-app-locally-no-platform-needed)

Verify your app reacts correctly **before** publishing — no platform, database, or server required. `Flashmandu\AppSdk\Testing\AppTester` is an in-memory harness that collects your app's hook declarations and lets you install, emit, and pipe filters in your own Pest/PHPUnit suite:

```
use Flashmandu\AppSdk\Testing\AppTester;

it('awards points when an order is paid', function (): void {
    $tester = AppTester::for(Acme\Loyalty\Manifest::class);

    $tester->install()->emit('order.status.changed', ['status' => 'paid']);

    expect($tester->wasFired('order.status.changed'))->toBeTrue();
    // assert your app's side effect (DB row, API call, etc.)
});

it('applies a redemption to cart totals', function (): void {
    $tester = AppTester::for(Acme\Loyalty\Manifest::class)->install();

    expect($tester->runFilter('cart.totals', 100))->toBe(90);
});
```

The harness mirrors the platform's gating: nothing fires before `install()`, so tests reflect how the real engine only runs apps a merchant has installed.

Versioning
----------

[](#versioning)

This package is the **stable contract** between apps and the platform. Breaking changes follow Semver (`vMAJOR.MINOR.PATCH`); apps pin a compatible range.

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance100

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity47

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

Every ~0 days

Total

2

Last Release

1d ago

### Community

Maintainers

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

---

Top Contributors

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

###  Code Quality

TestsPest

### Embed Badge

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

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

###  Alternatives

[elhebert/laravel-sri

Subresource Integrity hash generator for laravel

39241.9k](/packages/elhebert-laravel-sri)[mtdowling/burgomaster

Packages up PHP packages into zips and phars

2780.9k12](/packages/mtdowling-burgomaster)[francescomalatesta/laravel-circuit-breaker

A circuit breaker pattern implementation for the Laravel framework

2919.2k2](/packages/francescomalatesta-laravel-circuit-breaker)

PHPackages © 2026

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