Developers

Get Started

~5 min

Build your first Meteorack module in 5 minutes.

Prerequisites: WordPress 6.0+ and PHP 8.2+ on any hosting provider.

1

Install the Hub

The Hub provides the module runtime, crash isolation, service container, and CLI tools.

wp plugin install meteorack-suite --activate
2

Create your module directory

Modules live in wp-content/meteorack/modules/. The Hub auto-discovers any folder with a valid module.json.

mkdir -p wp-content/meteorack/modules/my-first-module
3

Define module.json

This manifest tells the Hub everything about your module — what it needs, what services it uses, and how it appears in the admin.

module.json
{
  "slug": "my-first-module",
  "name": "My First Module",
  "version": "1.0.0",
  "entry": "class-module.php",
  "requires": {
    "php": "^8.2",
    "hub": "^1.0"
  },
  "services": ["settings", "logger"],
  "admin": {
    "page": true,
    "menu_title": "My Module"
  }
}
4

Write the entry point

Your module class implements ModuleInterface. The container injects the services you declared in module.json automatically.

class-module.php
<?php

declare(strict_types=1);

use Meteorack\SDK\Contracts\ModuleInterface;
use Meteorack\SDK\Contracts\SettingsInterface;
use Meteorack\SDK\Contracts\LoggerInterface;

class My_First_Module implements ModuleInterface {

    public function __construct(
        private readonly SettingsInterface $settings,
        private readonly LoggerInterface $logger,
    ) {}

    public function boot(): void {
        $this->logger->info('my-first-module.boot', [
            'version' => '1.0.0',
        ]);

        add_action('admin_init', [$this, 'register_settings']);
    }

    public function register_settings(): void {
        $this->settings->register('my-first-module', [
            'enabled' => true,
        ]);
    }
}
5

Activate and verify

Run the CLI to confirm your module was discovered and booted:

wp meteorack modules list
Expected output
+------------------+---------+--------+
| Module           | Version | Status |
+------------------+---------+--------+
| my-first-module  | 1.0.0   | active |
+------------------+---------+--------+

Your module is running. The Hub discovered it, booted it in isolation, and it's ready to serve.