MediaGrabber Pro

Connect a Plugin

Step-by-step — register a Customer Portal deployment with the central Admin Module and verify the handshake.

Follow these steps once per plugin deployment you want to manage centrally. Each plugin has its own portal, its own slug, and its own shared secret.

What you'll need

  • The portal's API URL (e.g. https://api.my-plugin.com)
  • Access to set environment variables on that portal
  • Access to the Admin Module to register the plugin

Step-by-step

Generate a shared secret

This secret authenticates the Admin Module to this portal. Generate a strong, random value:

openssl rand -base64 48

Keep it secret — you'll paste the same value into both sides.

Configure the Customer Portal

Set these environment variables on the portal (the API app), then restart it:

# Identifies this deployment — must match the slug you register in the Admin Module
PLUGIN_SLUG=my-plugin
 
# The shared secret from step 1 (the connector service token)
CONNECTOR_SECRET=<paste the generated secret>
 
# Where the Admin Module lives (used for outbound handshakes)
ADMIN_CONNECTOR_URL=https://admin.yourcompany.com

The connector surface is enabled by default. It only accepts requests once CONNECTOR_SECRET is set — without a secret, every connector call is rejected. For a fully standalone deployment, leave CONNECTOR_SECRET empty.

Register the plugin in the Admin Module

In the Admin Module, add a new plugin and provide:

FieldValue
SlugThe exact PLUGIN_SLUG (e.g. my-plugin)
Portal URLThe portal's API origin (e.g. https://api.my-plugin.com)
Service tokenThe same CONNECTOR_SECRET from step 1

The slug must match exactly on both sides. A mismatch is the most common reason the handshake fails.

Verify with a handshake

Confirm the connection with a ping. The Admin Module does this automatically, but you can test it directly:

curl -X POST https://api.my-plugin.com/connector/ping \
  -H "Content-Type: application/json" \
  -H "x-connector-token: $CONNECTOR_SECRET" \
  -H "x-connector-plugin: my-plugin" \
  -H "x-connector-timestamp: $(date +%s)" \
  -d '{"timestamp":"2025-06-03T00:00:00Z"}'

A healthy connection returns the plugin's identity:

{ "pluginSlug": "my-plugin", "ok": true, "timestamp": "2025-06-03T00:00:00Z" }

Confirm in the Admin Module

The plugin should now show as Connected. From here the central dashboard can run the management operations listed in the Events Reference.

Connecting multiple plugins

Repeat the steps for each plugin. Use a distinct slug and a distinct secret per plugin — never share one secret across deployments, so revoking one plugin's access never affects the others.

PluginPLUGIN_SLUGSecret
Plugin Aplugin-aunique secret A
Plugin Bplugin-bunique secret B
Plugin Cplugin-cunique secret C

Verify the result

Handshake succeeds

The ping above returns ok: true with the correct slug.

Wrong token is rejected

A ping with a bad x-connector-token returns 401 Unauthorized — confirming the surface is actually protected.

Next

On this page

Connect a Plugin | MediaGrabber Pro