Documentation menu

Quickstart

Sign up, fork the reference network, and bring up a lobby + minigame on your own boxes.

HiveScale is one Java SDK and one API key. There’s no backend to run - you point your servers at the network and the SDK handles matchmaking, player data, presence and punishments for you.

1. Add the SDK

Drop the dependency into your pom.xml and export your key. Get a key from the dashboard - it looks like hv_live_….

pom.xml
# Add the SDK (Maven)
<dependency>
  <groupId>dev.hivescale</groupId>
  <artifactId>hive-sdk</artifactId>
  <version>1.0.0</version>
</dependency>

# Point a server at your network
$ export HIVE_API_KEY=hv_live_••••••••••••••••

The SDK artifact and hub endpoint go live with the Hytale beta. Want to build against them now? Ask us for early access - we answer fast.

2. Connect a server

Construct one HiveSdk at startup and share it. The Hive core plugin announces the box to the network’s server registry and heartbeats automatically; the SDK is how your own code talks to the network.

Bootstrap.java
public final class Bootstrap {
  public static void start() {
    HiveSdk hive = HiveSdk.create(HiveSdkConfig.builder()
        .baseUrl("https://hub.hivescale.dev")
        .apiKey(System.getenv("HIVE_API_KEY"))
        .build());
  }
}

Once announced, the box shows up in findServer results. See Server registry for presence and transfers.

3. Route a player

Ask the network for a server with capacity and send the player there. Every call is async and returns a CompletableFuture; routing is capacity-aware, so you never overfill a box.

Queue.java
public void join(Player player) {
  hive.matchmaking()
      .findServer(player.uuid(), player.name(), "skywars")
      .thenAccept(result -> {
        if (result.isSuccess()) hive.transfer(player, result.matchedServer());
      });
}

Next steps