SDK

Services

Canonical doc

The current SdkContext service surface.

SdkContext is the current WordPress-host compatibility bag. The durable portable contracts live in @meteorack/modules-sdk-core/services.

Today the host surface spans these service families:

FamilyExamples
Core runtime servicessettings, events, cache, http, logger, storage
Identity and trustauth, secrets, rate limits, feature flags
Content and datacontent, data
Async and deliveryscheduler, queue, email, webhooks, uploads
Search and realtimesearch, channel
Platform controlslicensing, design tokens, observability

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.

The portable rule is:

  • modules depend on service contracts
  • runtimes decide which concrete services they expose
  • WordPress-specific helpers remain compatibility glue, not the permanent module API