Skip to content
Concept

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 taskRepresentative public API / importUsageCore suppliesApp implements or specifiesDetailed reference
Register an AppNexia\AppRuntime\AbstractPackageAppManifestExtendManifest discovery and route loadingApp identity and contribution locationsApp manifest
Authorize tenant workNexia\Laravel\Access\Contracts\ResourceAuthorization, Nexia\Tenancy\Contracts\TenantSettings, Nexia\Tenancy\Contracts\TenantRunnerCallPermission evaluation, tenant settings and tenant restorationDeclare permissions and enforce row/action rules with an actor supplied by a trusted host boundarySDK contracts
Protect an HTTP routeNexia\Http\MiddlewareConfigureRegistered authentication, installation and organization-context middlewareRoute middleware composition and business authorization checksHTTP middleware
Resolve organizations, users and PartyNexia\Organization\Contracts\OrganizationDirectory, Nexia\Identity\Contracts\ActorDirectory, Nexia\Laravel\Identity\Contracts\PartyDirectory; /host: useOrganizationListScope, NxOrganizationTargetSelectorCallScoped lookups and organization selection UIChoose read permission and scope axes; keep domain eligibility in the AppSDK contracts, React components and hooks
Publish and query Resource lists, filters and sortsNexia\Contribution\Contracts\ResourceCatalogContribution, Nexia\Laravel\Resources\ResourceListFields; /host: ResourceTable, useResourceListParamsImplement / Create / CallCatalog, list adapters and common table UIResource identity, authorized query, fields, filters and sort declarationsResource contracts
Resolve references and summariesNexia\ResourceReference\Contracts\ResourceReferences, Nexia\AppDescriptors\Contracts\ResourceSummaries, Nexia\AppDescriptors\Contracts\ResourceSummaryContributionCall / ImplementOwner dispatch and protected result handlingAuthorized resolution and safe summary projectionsResource References, Resource contracts
Expose authorized Resource Composition queriesNexia\ResourceComposition\Contracts\CompositionQueryContribution, Nexia\ResourceComposition\CompositionSpecImplement / CreateDescriptor validation, planning and query execution for human DashboardsProvider-owned row visibility, redaction and declared aliasesResource contracts
Add Navigation, Command Palette and Dashboard WidgetsNexia\Navigation\Contracts\NavigationContribution, Nexia\Palette\Contracts\PaletteCommandContribution, Nexia\Dashboard\Contracts\DashboardWidgetContributionImplement / CreateDiscovery, permission gates and Shell presentationDestinations, command handlers and widget declarations/dataAdd a menu destination, Command Palette, Add a Dashboard Widget
Publish events and consume Inbox workNexia\Events\Contracts\EventPublisher, Nexia\Events\Contracts\InboxConsumer, Nexia\Events\Contracts\AppEventListeners, Nexia\Events\Contracts\ActorDelegatedAppEventListenersCall / Implement / CreateDurable delivery, consumer execution and tenant-gated listener registrationEvent schemas, handlers, idempotency and explicit delegated actor authorityHandle events and jobs, SDK contracts
Track async work and publish Mutation hintsNexia\AsyncWork\Contracts\BackgroundOperationStore, Nexia\Mutation\Contracts\MutationPublisher, Nexia\Mutation\MutationMatcher; /host: useResourceProjectionChangeCall / CreateActor-owned progress and after-commit browser wake-upAuthorized execution, transactions, retry rules and correct identitiesSDK contracts
List attachments, read files and uploadNexia\Attachments\Contracts\AttachmentDirectory, Nexia\Attachments\Contracts\AuthorizedFileReader, Nexia\Attachments\Contracts\AttachmentStore; /host: useUploadFile, useUploadAttachment, NxFileDropzoneCall / CreateAuthorized file access, storage, upload protocol and common controlsResource target, upload abilities and domain mutation authorizationSDK contracts, React components and hooks
Reuse Import and ExportNexia\ResourceTransfer\Contracts\ResourceTransferExportSourceContribution, Nexia\ResourceImport\Contracts\ImportRecipeContribution, Nexia\ResourceImport\Contracts\ResourceImportPipelineContribution; /host: NxResourceTransferActions, NxResourceImportDialog, NxDatasetImportWorkspace, NxDatasetExportWorkspaceImplement / CallFormats, upload, mapping, preview, orchestration, polling and common UISchema, permissions, scope filtering, export rows, validation, business writes and retry rulesResource Transfer
Build a data migration workspaceNexia\DataMigration\Contracts\DataMigrationRunRecorder; /host: dataMigrationRegistry, useDataMigrationBackgroundOperationCall / CreateStage registry, transient polling and durable execution evidenceRegister targets/stages and implement authorized migration executionReact components and hooks, SDK contracts
Submit Approval and run a ProcessNexia\Approval\Contracts\ApprovalHost, Nexia\Process\Contracts\ProcessRuntime; /host: approvalComposerBusinessFormRegistry, processUserTaskFormRegistryCall / ImplementApproval lifecycle and Process runtimeBusiness bindings, work handlers, forms and domain authorizationElectronic Approval contracts, Business Process contracts
Prepare documents, signatures, seals and PDF assetsNexia\Signature\Contracts\SignatureHost, Nexia\Signature\Contracts\SignatureDocumentHost, Nexia\OfficialSeal\Contracts\OfficialSealUseService, Nexia\Documents\Contracts\PdfFontProviderCall / Implement / CreateSignature orchestration, protected seal use and local PDF fontsDocument data providers, business bindings and authorized contentElectronic Signature contracts, SDK contracts
Contribute a Setup Plan taskNexia\Setup\Contracts\SetupTaskContribution, Nexia\Setup\Contracts\SetupTaskEvaluatorImplement / CreateTask discovery, assessment orchestration and Setup UITask declarations, completion criteria and domain evaluatorContribute Setup tasks
Provide Copyable Templates, Fixtures and Feature GuidesNexia\Templates\Contracts\CopyableTemplateContribution, Nexia\Fixture\Contracts\FixtureContribution, Nexia\Guidance\Contracts\FeatureGuideContributionImplement / CreateTemplate selection, fixture context and guide discovery/presentationCopy logic, disposable App records and guide stepsInstallation content, Contribution contracts
Build forms and tables/host: NxFormField, NxResourceInformationForm, ResourceTableCall / CreateAccessible controls, schema rendering and table behaviorField declarations, values, validation and authorized save handlersReact components and hooks
Render calendars, schedulers and charts/host: NxCalendar, NxResourceScheduler, NxBarChart, NxLineChartCall / CreateHost renderers and interactionsAuthorized events, resources, series and action callbacksReact components and hooks
Open an Inspector or Work Tab/host: resourceInspectorAdapterRegistry, ResourceInspectorPanel, useOpenResourceWorkTab, useMarkTabDirtyCall / CreateInspection stack, tab navigation and unsaved-change stateRegister the App adapter, route identity and dirty stateReact components and hooks
Show toasts, parse errors, format and debounce/host: useMessage, parseMutationFormError, useDateTimeFormatter, useDebouncedValue; root: formatNumberCallMessage UI, error mapping and date/time context; SDK supplies the pure number helperFeedback text, field names, values, locale and debounce delayReact components and hooks
Test through the public boundaryNexia\Testing\Contracts\HostTestStore; /testing: appTestServer, appTestI18nCall / CreateTest-only fixture and configured frontend harnessApp scenarios, assertions and request handlersTest 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:

Code example
PHP
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

ImportUse it for
@nexia/sdkShared types, values, and pure helpers
@nexia/sdk/hostHost-bound components, hooks, registries, and api
@nexia/sdk/testingTest-host request and locale helpers
Code example
TSX
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.

Source of truth: docs/developers/content/en/app-sdk/overview.md