Repository navigation
RuntimeExtensionInterface
Pair\Core\RuntimeExtensionInterface is the minimal runtime contract for Pair v4 extension packages.
The official name for this extension style is Runtime Extension.
It is separate from Installable Packages, the ZIP/manifest package installer classes Pair\Packages\InstallablePackage and Pair\Packages\InstallablePackageRecord.
namespace Pair\Core;
interface RuntimeExtensionInterface {
/**
* Register runtime services, adapters, routes, renderers, or configuration.
*/
public function register(Application $app): void;
}Runtime Extensions are registered explicitly from application bootstrap:
use Pair\Core\Application;
$app = Application::getInstance();
$app->registerRuntimeExtension(new StripeExtension());There is no automatic discovery, no mandatory manifest, and no dependency injection container.
use Pair\Core\AdapterKeys;
use Pair\Core\Application;
use Pair\Core\RuntimeExtensionInterface;
final class StripeExtension implements RuntimeExtensionInterface {
/**
* Register Stripe as the application payments adapter.
*/
public function register(Application $app): void {
$app->setAdapter(AdapterKeys::PAYMENTS, new StripeGateway());
}
}use Pair\Core\AdapterKeys;
use Pair\Core\Application;
use Pair\Core\RuntimeExtensionInterface;
use Pair\Services\GeminiClient;
final class GeminiExtension implements RuntimeExtensionInterface {
/**
* Register Gemini as the application AI adapter.
*/
public function register(Application $app): void {
$app->setAdapter(AdapterKeys::AI, new GeminiClient());
}
}Runtime Extensions may register adapters, routes, UI renderers, or runtime configuration. Required behavior must live in code and configuration, not in comments or docblocks.
See also: Application, AdapterRegistry, InstallablePackage, InstallablePackageRecord, UiRenderer.
Home · Setup · Configuration
Build with Pair 4
- Generator
- Controllers and responses
- Read models
- ActiveRecord and queries
- Forms and validation
- PairUI.js and HTML fragments
APIs and authentication
- API guide and CRUD
- Middleware and rate limits
- Users, sessions, and ACL
- Passkeys and social login
- Native mobile setup
Integrate and operate
- Integrations
- Runtime extensions and adapter keys
- Cache and cache stores
- Logs and observability
- PWA and push
- Packages and distribution
- Upgrade to v4