SDK

Services

Canonical doc

The current SdkContext service surface.

SdkContext currently exposes the following services.

AccessorInterfaceScopeNotes
license()LicenseServiceInterfacesharedLicense state and checks
tokens()TokensServiceInterfacesharedToken generation / validation
channel()ChannelServiceInterfacesharedChannel and realtime bridge helpers
logger()LoggerServiceInterfacemoduleModule-scoped logging
cache()CacheServiceInterfacemoduleSlug-scoped cache namespace
settings()SettingsServiceInterfacemoduleModule settings helpers
events()EventsServiceInterfacemoduleIn-process event bus
http()HttpServiceInterfacesharedOutbound HTTP abstraction
scheduler()SchedulerServiceInterfacemoduleSlug-scoped cron/event scheduling
storage()StorageServiceInterfacemoduleFile and storage abstraction
auth()AuthServiceInterfacesharedCurrent-user auth and nonce helpers
secrets()SecretsServiceInterfacemoduleSlug-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.