Code Examples

Production-ready patterns you can copy

Explore curated examples covering backend services, realtime overlays, automation scripts, and workflow integrations. Each project includes source code, detailed comments, and deployment instructions.

Server-side Matchmaking

Quickly assemble a matchmaking service that uses AeThex queues, weighting rules, and player telemetry streams.

Language: TypeScript Repository: aethex/examples/matchmaking-service

import { createQueue, matchPlayers } from "@aethex/matchmaking";

const queue = await createQueue({
  region: "us-central",
  size: 4,
  constraints: [
    { field: "skillRating", tolerance: 120 },
    { field: "latency", max: 90 },
  ],
});

export async function enqueuePlayer(player) {
  await queue.enqueue(player.id, {
    skillRating: player.mmr,
    latency: player.ping,
  });

  const match = await matchPlayers(queue);
  if (match) {
    await queue.lock(match.id);
    return match;
  }

  return null;
}

Realtime Activity Overlays

Broadcast live deployment and incident updates to your in-game HUD or operations dashboard using AeThex events.

Language: React Repository: aethex/examples/realtime-overlay

Workshop Automation

Automate the packaging and publishing of custom workshop content across AeThex environments using the CLI.

Language: Shell Repository: aethex/examples/workshop-automation

Integration Ideas

Commerce Hooks

Sync AeThex purchase events into your billing or CRM system using the webhook relay template.

  • View guide

Live Operations Dashboard

Combine project metrics, incident response playbooks, and player sentiment into a single React dashboard.

  • View guide

Cross-platform Presence

Mirror AeThex voice and party status with your Discord or Slack community using the presence bridge sample.

  • View community

Analytics Pipeline

Export gameplay events to your data warehouse with the managed streaming connectors.

  • View guide

Getting Started

  1. Clone the example you want to explore

  2. Follow the README instructions

  3. Customize for your use case

Contributing Examples

Have a great example? Submit it to the community!

  • Fork the repository

  • Add your example with detailed comments

  • Submit a pull request

  • Your example will be featured in our library

Last updated