SdkContext currently exposes the following services.
| Accessor | Interface | Scope | Notes |
|---|---|---|---|
license() | LicenseServiceInterface | shared | License state and checks |
tokens() | TokensServiceInterface | shared | Token generation / validation |
channel() | ChannelServiceInterface | shared | Channel and realtime bridge helpers |
logger() | LoggerServiceInterface | module | Module-scoped logging |
cache() | CacheServiceInterface | module | Slug-scoped cache namespace |
settings() | SettingsServiceInterface | module | Module settings helpers |
events() | EventsServiceInterface | module | In-process event bus |
http() | HttpServiceInterface | shared | Outbound HTTP abstraction |
scheduler() | SchedulerServiceInterface | module | Slug-scoped cron/event scheduling |
storage() | StorageServiceInterface | module | File and storage abstraction |
auth() | AuthServiceInterface | shared | Current-user auth and nonce helpers |
secrets() | SecretsServiceInterface | module | Slug-scoped secret storage |
Usage pattern
Use SdkContext inside onSdkReady() for boot wiring, and use module helper traits when they make the call sites simpler.
public function onSdkReady(SdkContext $ctx): void
{
parent::onSdkReady($ctx);
$ctx->logger()->info('billing.boot', []);
$enabled = $ctx->settings()?->get('enabled', false);
if ($enabled) {
$ctx->scheduler()?->schedule('billing_refresh', time() + 60, 'hourly');
}
}Important caveat
Many services are nullable by contract. Module code should handle missing services explicitly instead of assuming every runtime exposes every implementation.