SDK
Analytics provider SDK
Analytics are plugins. Providers can be installed without changing the platform core, so hardware never depends on a single vendor.
Concepts
- Tiers: open, community, research, premium.
- Capabilities: what the provider can compute (
turn_detection,edge_angle…), shown in the marketplace and the API. - Permissions: data scopes requested; the user grants a subset at install time. The provider only ever receives granted data.
- Versioning: semantic versions with changelog; analyses record the version used.
- Sandboxing: HTTP providers run on your infrastructure. Calls are HTTPS-only, pinned to validated public IPs, signed with HMAC-SHA256, time-limited (20 s) and size-limited (1 MB).
Manifest
{
"slug": "my-model",
"name": "My Model",
"vendor": "My University",
"version": "1.0.0",
"tier": "research",
"transport": "http",
"endpoint": "https://models.example.org/medius",
"capabilities": ["turn_detection", "edge_angle"],
"permissions": ["activity.metadata", "activity.summary"],
"price_cu": 100,
"changelog": "First release"
}
Request
POST {endpoint}/analyze with JSON containing only granted scopes. Headers: X-Medius-Timestamp, X-Medius-Signature: sha256=HMAC(secret, timestamp + "." + body). Reject requests older than five minutes.
{ "api_version": 1,
"activity": { "id": 12, "sport": "ski", "duration_s": 5400, "distance_m": 18400 },
"summary": { "left_turns": 110, "right_turns": 102, "max_speed_kmh": 63.4 } }
Response
{ "metrics": { "turns": 212, "symmetry_pct": 94.3 },
"insights": ["Left and right turns are well balanced."] }
Permission scopes
activity.metadata— Title, sport, date, duration and distance of the activityactivity.summary— Aggregated results of the activity (turns, speeds, angles)user.equipment— Equipment profile (ski, boot, binding, length)device.info— Device model and firmware version
Reference implementation
The in-process Open Analytics Engine implements Medius\Contracts\ProviderInterface and lives in plugins/open-analytics. Drop a folder with provider.json into /plugins and run php bin/providers-discover.php.
Register your provider
Sign in with a Developer account to register.