App SDK
Choose the public PHP capability or frontend API for your App task, then use it through the installed SDK.
App SDK
Use the SDK to call platform capabilities and publish your App's resources, screens, and integrations. Start with the capability your App needs; an SDK source checkout is not a prerequisite for consuming the installed package.
SDK Capability Index
Call uses a public function, component or host service; Implement supplies an App implementation of a public interface; Extend subclasses a public SDK base; Configure selects exported constants or host options; Create constructs a DTO, enum or adapter. Contributions are App implementations discovered by Core, distinct from injected PHP host contracts. /host, /testing and root refer to the import paths below.
Continue to SDK contracts, Contribution contracts, React components and hooks for the API inventories. This index selects representative entry points.
| Developer task | Representative public API / import | Usage | Core supplies | App implements or specifies | Detailed reference |
|---|---|---|---|---|---|
| Register an App | Nexia\AppRuntime\AbstractPackageAppManifest | Extend | Manifest discovery and route loading | App identity and contribution locations | App manifest |
| Authorize tenant work | Nexia\Laravel\Access\Contracts\ResourceAuthorization, Nexia\Tenancy\Contracts\TenantSettings, Nexia\Tenancy\Contracts\TenantRunner | Call | Permission evaluation, tenant settings and tenant restoration | Declare permissions and enforce row/action rules with an actor supplied by a trusted host boundary | SDK contracts |
| Protect an HTTP route | Nexia\Http\Middleware | Configure | Registered authentication, installation and organization-context middleware | Route middleware composition and business authorization checks | HTTP middleware |
| Resolve organizations, users and Party | Nexia\Organization\Contracts\OrganizationDirectory, Nexia\Identity\Contracts\ActorDirectory, Nexia\Laravel\Identity\Contracts\PartyDirectory; /host: useOrganizationListScope, NxOrganizationTargetSelector | Call | Scoped lookups and organization selection UI | Choose read permission and scope axes; keep domain eligibility in the App | SDK contracts, React components and hooks |
| Publish and query Resource lists, filters and sorts | Nexia\Contribution\Contracts\ResourceCatalogContribution, Nexia\Laravel\Resources\ResourceListFields; /host: ResourceTable, useResourceListParams | Implement / Create / Call | Catalog, list adapters and common table UI | Resource identity, authorized query, fields, filters and sort declarations | Resource contracts |
| Resolve references and summaries | Nexia\ResourceReference\Contracts\ResourceReferences, Nexia\AppDescriptors\Contracts\ResourceSummaries, Nexia\AppDescriptors\Contracts\ResourceSummaryContribution | Call / Implement | Owner dispatch and protected result handling | Authorized resolution and safe summary projections | Resource References, Resource contracts |
| Expose authorized Resource Composition queries | Nexia\ResourceComposition\Contracts\CompositionQueryContribution, Nexia\ResourceComposition\CompositionSpec | Implement / Create | Descriptor validation, planning and query execution for human Dashboards | Provider-owned row visibility, redaction and declared aliases | Resource contracts |
| Add Navigation, Command Palette and Dashboard Widgets | Nexia\Navigation\Contracts\NavigationContribution, Nexia\Palette\Contracts\PaletteCommandContribution, Nexia\Dashboard\Contracts\DashboardWidgetContribution | Implement / Create | Discovery, permission gates and Shell presentation | Destinations, command handlers and widget declarations/data | Add a menu destination, Command Palette, Add a Dashboard Widget |
| Publish events and consume Inbox work | Nexia\Events\Contracts\EventPublisher, Nexia\Events\Contracts\InboxConsumer, Nexia\Events\Contracts\AppEventListeners, Nexia\Events\Contracts\ActorDelegatedAppEventListeners | Call / Implement / Create | Durable delivery, consumer execution and tenant-gated listener registration | Event schemas, handlers, idempotency and explicit delegated actor authority | Handle events and jobs, SDK contracts |
| Track async work and publish Mutation hints | Nexia\AsyncWork\Contracts\BackgroundOperationStore, Nexia\Mutation\Contracts\MutationPublisher, Nexia\Mutation\MutationMatcher; /host: useResourceProjectionChange | Call / Create | Actor-owned progress and after-commit browser wake-up | Authorized execution, transactions, retry rules and correct identities | SDK contracts |
| List attachments, read files and upload | Nexia\Attachments\Contracts\AttachmentDirectory, Nexia\Attachments\Contracts\AuthorizedFileReader, Nexia\Attachments\Contracts\AttachmentStore; /host: useUploadFile, useUploadAttachment, NxFileDropzone | Call / Create | Authorized file access, storage, upload protocol and common controls | Resource target, upload abilities and domain mutation authorization | SDK contracts, React components and hooks |
| Reuse Import and Export | Nexia\ResourceTransfer\Contracts\ResourceTransferExportSourceContribution, Nexia\ResourceImport\Contracts\ImportRecipeContribution, Nexia\ResourceImport\Contracts\ResourceImportPipelineContribution; /host: NxResourceTransferActions, NxResourceImportDialog, NxDatasetImportWorkspace, NxDatasetExportWorkspace | Implement / Call | Formats, upload, mapping, preview, orchestration, polling and common UI | Schema, permissions, scope filtering, export rows, validation, business writes and retry rules | Resource Transfer |
| Build a data migration workspace | Nexia\DataMigration\Contracts\DataMigrationRunRecorder; /host: dataMigrationRegistry, useDataMigrationBackgroundOperation | Call / Create | Stage registry, transient polling and durable execution evidence | Register targets/stages and implement authorized migration execution | React components and hooks, SDK contracts |
| Submit Approval and run a Process | Nexia\Approval\Contracts\ApprovalHost, Nexia\Process\Contracts\ProcessRuntime; /host: approvalComposerBusinessFormRegistry, processUserTaskFormRegistry | Call / Implement | Approval lifecycle and Process runtime | Business bindings, work handlers, forms and domain authorization | Electronic Approval contracts, Business Process contracts |
| Prepare documents, signatures, seals and PDF assets | Nexia\Signature\Contracts\SignatureHost, Nexia\Signature\Contracts\SignatureDocumentHost, Nexia\OfficialSeal\Contracts\OfficialSealUseService, Nexia\Documents\Contracts\PdfFontProvider | Call / Implement / Create | Signature orchestration, protected seal use and local PDF fonts | Document data providers, business bindings and authorized content | Electronic Signature contracts, SDK contracts |
| Contribute a Setup Plan task | Nexia\Setup\Contracts\SetupTaskContribution, Nexia\Setup\Contracts\SetupTaskEvaluator | Implement / Create | Task discovery, assessment orchestration and Setup UI | Task declarations, completion criteria and domain evaluator | Contribute Setup tasks |
| Provide Copyable Templates, Fixtures and Feature Guides | Nexia\Templates\Contracts\CopyableTemplateContribution, Nexia\Fixture\Contracts\FixtureContribution, Nexia\Guidance\Contracts\FeatureGuideContribution | Implement / Create | Template selection, fixture context and guide discovery/presentation | Copy logic, disposable App records and guide steps | Installation content, Contribution contracts |
| Build forms and tables | /host: NxFormField, NxResourceInformationForm, ResourceTable | Call / Create | Accessible controls, schema rendering and table behavior | Field declarations, values, validation and authorized save handlers | React components and hooks |
| Render calendars, schedulers and charts | /host: NxCalendar, NxResourceScheduler, NxBarChart, NxLineChart | Call / Create | Host renderers and interactions | Authorized events, resources, series and action callbacks | React components and hooks |
| Open an Inspector or Work Tab | /host: resourceInspectorAdapterRegistry, ResourceInspectorPanel, useOpenResourceWorkTab, useMarkTabDirty | Call / Create | Inspection stack, tab navigation and unsaved-change state | Register the App adapter, route identity and dirty state | React components and hooks |
| Show toasts, parse errors, format and debounce | /host: useMessage, parseMutationFormError, useDateTimeFormatter, useDebouncedValue; root: formatNumber | Call | Message UI, error mapping and date/time context; SDK supplies the pure number helper | Feedback text, field names, values, locale and debounce delay | React components and hooks |
| Test through the public boundary | Nexia\Testing\Contracts\HostTestStore; /testing: appTestServer, appTestI18n | Call / Create | Test-only fixture and configured frontend harness | App scenarios, assertions and request handlers | Test an App |
Distinguish exports, bindings and availability
An SDK export makes a symbol importable. PHP services separately need Core container bindings; delegated /host APIs need Core configuration in resources/js/app-sdk/configure-host.ts. DTOs, enums and pure helpers need no service binding. Helpers composed inside /host use configured APIs/hooks instead of a dedicated binding for each helper.
A binding does not guarantee availability to the current tenant/user. App installation and operational state, tenant/actor context, organization scope and point-in-time authorization remain separate gates. TenantRunner does not restore an actor, and a UI permission query does not authorize a server mutation.
Reuse the Import/Export foundation
Apps can use the shared Import/Export foundation directly through the contributions and UI above. Core supplies formats, upload, mapping, preview, orchestration, polling and common UI; the App supplies schema, permissions, scope filtering, export rows, validation, business writes and retry rules. Recipes write through declared Resource actions; choose a pipeline for an App-owned batch lifecycle or retry behavior. Follow Resource Transfer for integration steps and detailed contracts.
Call a PHP capability
Composer publishes amuzcorp/nexia-app-sdk-laravel under Nexia\*. Inject the interface
into a class Laravel resolves, or resolve it from the container inside an existing
tenant request:
use Nexia\Tenancy\Contracts\TenantSettings;
$timezone = app(TenantSettings::class)->businessTimezone();The result is the current tenant's business timezone. The host supplies the implementation and tenant context; your App does not read a host settings table. A missing binding means the installed host and SDK capability do not match.
Choose the frontend import
| Import | Use it for |
|---|---|
@nexia/sdk | Shared types, values, and pure helpers |
@nexia/sdk/host | Host-bound components, hooks, registries, and api |
@nexia/sdk/testing | Test-host request and locale helpers |
import { WorkSurface } from "@nexia/sdk/host";
export default function Overview() {
return <WorkSurface>App content</WorkSurface>;
}Render the registered screen inside NEXIA, where the host configures the bindings. See React components and hooks for registration and peer dependencies, or Create an App Package for the complete first screen.
Consume, contribute, or construct
- Consume a capability: inject its interface; the host runs it. Examples:
TenantSettings,ResourceAuthorization,SignatureHost. - Implement a contribution: your App implements the published interface and returns declarations from a manifest-discovered class. Core discovers and evaluates them; see Contribution contracts.
- Construct a value or use a helper: instantiate SDK DTOs and enums, extend an adapter model, or call a pure frontend helper directly. No service binding is needed for a value object.
When the API you need is absent
Check the installed package's exports and the focused reference first. Keep
App-specific behavior in your App; use Resource References or public events for
cross-App integration. A missing platform capability needs a coordinated host/SDK
change before an App can consume it. Do not import App\*, Core frontend aliases,
or another App's implementation as a substitute.
Only contributors changing the SDK itself need a selected local SDK checkout.
After local setup, add it with task apps:add PACKAGES=app-sdk; this preserves the saved package selection and prepares the Composer and frontend local overlays. Consumers use the published Laravel and React packages.