Platform Spine Concept

One login. One shared XP + badges ledger across the whole suite — a badge earned in Ground Game shows up in Save Arena, PD Hub, Dream Big, and on the Command Center home. This is the API that makes ~30 tools feel like one competitive platform.

The badge catalog

loading…

Endpoints

MethodPathAuthPurpose
POST/emitx-internal tokenApp pushes a typed event
GET/user/:emailopenIdentity + XP + level + badges (badge bar)
GET/badgesopenThis catalog (JSON)
GET/leaderboardopen?scope=market|portfolio|system&key=…
GET/badge-bar.jsopenThe shared embed strip

Wire an app in 3 steps

// 1. bind the spine in the app's wrangler.jsonc
"services": [{ "binding": "BADGES", "service": "badges-api" }]

// 2. share the secret:  wrangler secret put INTERNAL_TOKEN  (same value)

// 3. emit where credit is awarded (copy src/client.js):
const res = await emitBadgeEvent(env, {
  app: 'pd-hub', type: 'scenario', actor_email: email,
  market, portfolio, id: submissionId,    // stable id => idempotent
});
if (res?.new_badges?.length) toastBadges(res.new_badges);  // 🎉

The badge bar (display, any app)

<!-- after Cloudflare Access sets the user -->
<script src="https://badges.dreambigsouthwind.com/badge-bar.js"
        data-email="rep@dreambigsouthwind.com"></script>

Ring 1 of the spine — live. Next: Cloudflare Access (one login) · first real loop in Save Arena · custom domain badges.dreambigsouthwind.com.