SpaceEdge is a small Unity space shooter that shows PlayFab Matchmaking and Edgegap working together, end to end: PlayFab signs players in and matches them, and every match gets its own Edgegap dedicated game server.
PlayFab keeps doing what it does: accounts, login and matchmaking queues. When it finds a match, an Azure Function starts an Edgegap server near the matched players, and a second one tells each player where to connect.
No secret ships in the game: the client holds only your PlayFab title ID, and the game server holds no PlayFab or Edgegap credentials and admits only the matched players. The server stops itself when the players leave.
Edgegap's network spans 615+ Edge Cloud locations (learn more). Each server is deployed to the best available location for its players and billed only while the match runs.
Clone the sample: SpaceEdge PlayFab sample on GitHub
Full guide: add Edgegap to your own PlayFab game with the PlayFab integration guide
Platforms: Windows desktop client (tested). A Linux dedicated server, built with the Edgegap Unity plugin. The client code could run in WebGL, but WebGL hasn’t been tested.
How it works
The player signs in to PlayFab and presses Start Game: the client creates a matchmaking ticket in a PlayFab queue.
PlayFab matches two players and fires
playfab.matchmaking.match_found. A rule on that event runs the Azure FunctionStartEdgegapDeployment.The function looks up each player’s location and asks Edgegap for a deployment near them, tagged with the start of the match ID. It returns in about a second.
When the server is up, Edgegap calls the second function,
EdgegapDeploymentReady. It checks the deployment with the Edgegap API, then writes the server’s host and port, and a join token, to each player’s read-only PlayFab data.Both clients read the address, connect over UDP with their join token and play. The server turns away anyone else. When they leave, the server stops its own deployment.
What's in the repo:
Path | What it does |
|---|---|
| The two Azure Functions (Node.js 22, no PlayFab or Edgegap SDK). |
| Client: login, ticket, wait for the match, wait for the server, connect. |
| Server: starts the game server in server builds and stops the Edgegap deployment when the match is over. Adds itself at runtime, no scene setup. |
| Command-line builds: the Edgegap plugin’s server build, and the Windows test client. |
| Admits only the matched players: checks the join token each client sends. |
1. Before you start
A free Edgegap account and an API token from Dashboard → User Settings → Tokens. It's organization-wide, so it only goes into your Function App's settings, never into the game.
A PlayFab title.
An Azure subscription and the Azure CLI.
Clone the sample.
2. Put the game server on Edgegap
Open SpaceEdge_project in Unity, then Tools → Edgegap Server Hosting, and sign in with Edgegap.
Build server, then Containerize with Docker: image name playfab-fishnet, image tag empty (the plugin uses the current UTC time).
Upload to Edgegap: application playfab-fishnet, then Upload image and Create app version. The plugin pushes the image and opens the version form:
Without the Editor, the same server build runs from the command line:
"<Unity>" -batchmode -projectPath SpaceEdge_project -executeMethod EdgegapPluginBuild.BuildServer -logFile build-server.log
For later builds, Rebuild from Source builds, containerizes and pushes in one click.
In the version form:
Keep the image and the version name the plugin proposes (the image tag). The Azure Functions need that name. If the form asks for registry credentials, use the username and token from the Container Registry page.
One port: name
gameport, 7770, UDP. The functions look the port up by that name.0.5 vCPU and 1 GB.
A max duration of 60 minutes. The server also stops itself.
The version needs no environment variables and no secrets: the functions pass the match details and join tokens to each deployment.
3. Set up your PlayFab title
Matchmaking queue (Multiplayer → Matchmaking → New queue): name
edgegap-fishnet, match size 2-2, Enable server allocation off, since Edgegap hosts the servers. No rules are needed to match any two players.Let clients create players (gear icon → Title settings → API Features): untick Disable player creation using Client/LoginWithCustomId. New titles have it ticked, and logins fail with
PlayerCreationDisabled.Note your Title ID, and create a Secret Key (Title settings → Secret Keys) for the Azure Functions.
4. Deploy the Azure Functions
Create a resource group, a storage account and a Flex Consumption Function App on Node.js 22. PlayFab recommends a US West region:
az group create -n rg-edgegap-playfab -l westus2
az storage account create -n <storageaccount> -g rg-edgegap-playfab -l westus2 --sku Standard_LRS
az functionapp create -g rg-edgegap-playfab -n <function-app> --storage-account <storageaccount> --flexconsumption-location westus2 --runtime node --runtime-version 22
In azure-functions, run npm ci --omit=dev, zip host.json, package.json, src/ and node_modules/ into bridge.zip, then deploy it:
az functionapp deployment source config-zip -g rg-edgegap-playfab -n <function-app> --src bridge.zip
Add the app settings (Function App → Settings → Environment variables):
PLAYFAB_TITLE_IDandPLAYFAB_SECRET_KEY: from step 3.EDGEGAP_API_TOKEN: your Edgegap token, without thetokenprefix.EDGEGAP_APP_NAME/EDGEGAP_APP_VERSION:playfab-fishnet/ the version name from step 2.EDGEGAP_PORT_NAMEis optional and defaults togameport.EDGEGAP_READY_WEBHOOK_URL:https://<function-app>.azurewebsites.net/api/EdgegapDeploymentReady?code=<function key>.Optional:
EDGEGAP_QUEUESto give Edgegap servers to some queues only, andFALLBACK_LATITUDE/FALLBACK_LONGITUDEfor players PlayFab can't locate.
Get each function's key with az functionapp function keys list -g rg-edgegap-playfab -n <function-app> --function-name <name>. Function keys are secrets: don't commit or share URLs that contain them.
Then, in PlayFab:
Automation → CloudScript → Functions → Register Function: name
StartEdgegapDeployment, with its URL and function key.Automation → Rules → New Rule: event type
playfab.matchmaking.match_found, action Execute Azure Function → StartEdgegapDeployment.
Don't register EdgegapDeploymentReady: Edgegap calls it, not PlayFab.
5. Play a match
Open
SpaceEdge_projectand the sceneAssets/SpaceEdge/Scenes/MainMenu.On the
PlayfabRestApiServiceobject (componentPlayFabMatchmakingClient), set Title Id. Queue Name is alreadyedgegap-fishnet.Make sure no other deployment is running: the free tier runs one at a time.
You need two players. Build a Windows client (Mono, so the Windows IL2CPP module isn’t needed) and run it twice, each with its own PlayFab player:
"<Unity>" -batchmode -projectPath SpaceEdge_project -executeMethod EdgegapPluginBuild.BuildClient -logFile build-client.log
SpaceEdge_project/Builds/Client/win64/Game.exe -playfabCustomId player-a
SpaceEdge_project/Builds/Client/win64/Game.exe -playfabCustomId player-b
Press Start Game in both. Once PlayFab matches them, a deployment tagged with the start of the match ID appears in the Edgegap dashboard, and both clients connect to it a few seconds later. Quit both: the server stops on its own within a minute.
Other options: -playfabTitleId <id>, -playfabQueue <name>, and -autoMatch to queue right after login. For headless test clients, add -batchmode -nographics -client.
6. Add PlayFab Matchmaking to your own game
The sample is a working reference: your coding agent can copy its tested files instead of writing them from scratch. Four changes make a game run on Edgegap with PlayFab Matchmaking:
PlayFab only matches. Turn server allocation off on your queue, so PlayFab forms the match and Edgegap hosts it. No GSDK and no PlayFab builds.
Two Azure Functions connect them. One deploys a server near the players on
match_found; the other receives Edgegap’s ready webhook and writes the address and a join token to each player’s read-only data (azure-functions/, usable as is with any engine).The server runs headless and stops itself. It listens on a fixed port, holds no secret, admits only the matched players, and stops its deployment when nobody joins or everyone leaves (
EdgegapServer.cs). The sample's netcode is FishNet; for another netcode, replace the part that starts the server and counts players.The client waits for its server. After
Matched, it readsEdgegapServerfrom its read-only data and connects with its join token tohost:port(PlayFabMatchmakingClient.cs, with one netcode-specific connect call).
With your agent:
"Load the edgegap skill, then edgegap-playfab and the skill for my netcode. Using github.com/edgegap/backend-game-sample-unity-playfab-matchmaker-fishnet-spaceedge as the reference, add a headless server mode that stops itself to my game, deploy the two Azure Functions to my subscription, and wire my client to queue in PlayFab and connect to the address in its read-only data."
For each step in detail, by hand, see the PlayFab integration guide.
Known limits
2 players per match. The queue is 2-2, and only queues of 2 were tested. For larger matches, raise the queue's match size and test again.
Windows clients only. macOS and Linux client builds weren’t tested.
WebGL not tested. The client code avoids threads and the PlayFab SDK, so it could run in a browser, but a web build would also need a WebSocket port with TLS Upgrade.
What was tested
Tested end to end on Edgegap on 21 October 2026, with Unity 2021.3.45f2, Node.js 22 on Azure Functions (Flex Consumption) and a PlayFab queue of 2:
Two clients signed in and were matched by PlayFab.
The rule ran
StartEdgegapDeployment, one server started near them, and the address reached both players about 8 seconds after the function call.Both connected to the same server and played.
The server stopped itself after the players quit, and 2 minutes after start when nobody joined.
Join tokens and the build with the Edgegap Unity plugin came after this run. They were tested on 29 October 2026 with unit tests and a local server container: matched players got in, anyone else was turned away, and a crashed player could rejoin. Not tested: WebGL clients, queues larger than 2, latency-based queue rules.
Frequently Asked Questions
Questions about running the SpaceEdge sample with PlayFab and Edgegap.
Is there a PlayFab Matchmaking sample for Unity with dedicated servers?
Yes. SpaceEdge is a Unity space shooter where PlayFab Matchmaking pairs two players and two Azure Functions start an Edgegap dedicated server near them for the match. It was tested end to end in October 2026.
Why does the sample use Azure Functions instead of CloudScript?
Microsoft calls JavaScript CloudScript “classic” and points new work to CloudScript using Azure Functions. The functions also let the deploy call return in about a second and receive Edgegap’s webhook when the server is ready.
Does the game server need the PlayFab secret key?
No. The secret key and the Edgegap token stay in the Function App’s settings. The client holds only the title ID, and the server reads nothing from PlayFab. It checks players with per-match join tokens that the functions compute.
How do I test two PlayFab players on one machine?
Run two client builds with different custom IDs, for example -playfabCustomId player-a and -playfabCustomId player-b. Copies on one machine share PlayerPrefs, so without it both sign in as the same player.

Clients
Learn more from clients who integrated Edgegap
31 case studies are available from studios that moved to Edgegap from another platform.

A Flawless Global Launch for Rivals of Aether 2
Aether Studios
Learn how Aether Studios quickly added Edgegap and delivered flawless launch & post-launch to their community.
Case Study

Overcome Latency Introduced by VR’s use of WiFi in Competitive Multiplayer
Halfbrick Studios
Discover how Halfbrick successfully launched & maintains a multiplayer-focused Early Access on META Quest's VR platform.
Case Study

MENA’s Social App Adds Online Games
WOLF
Learn how the highly popular MENA-region social app added matchmaking & multiplayer games orchestration easily to WOLF Qanawat.
Case Study

Hybrid Orchestration Keeps Kickoff Tactics Ready for Any Traffic
Birch Games
How hybrid orchestration helped Birch Games handle traffic, pairing egress-free Fleets with the regionless cloud.
Case Study

7 Days Blood Moons
The Fun Pimps & iLLOGIKA
Learn how Illogika dramatically reduced server costs & ensured the online experience the 7 Days to Die franchise expects.
Case Study

Authentic Online Warfare Requires the Ultimate Orchestration
Highwire Games
Learn how Highwire's need for performance required orchestration only Edgegap can deliver.
Case Study

22,000 Reviews, 4.8 Stars, and Infrastructure That Scaled Automatically
Sinn Studios
How a simple, Slack-supported integration got Sinn Studio's hit VR title online fast and keeps it there.
Case Study

Dynamic Server Orchestration
Under NDA - AAA Studio
Discover how one the world's biggest AAA studio improved its peer-to-peer multiplayer experience through edge computing.
Case Study

Near Zero Latency for AAA Fighting Game
AAA Studio - Under NDA
How an unannounced project delivered the lowest lag possible and improved fairness in its 1v1 game.
Case Study

Play Gods with Multiplayer Physics
Squido Studio
Learn how Squido uses Edgegap's highligh optimized game servers to deliver mind-bending & chaotic VR gameplay.
Case Study

A Fully Managed Solutions that Saves Time for Indies Multiplayer VR Horror
Dirty Pearl Studios
Discover how Dirty Pearl Studios saved development time thanks to Edgegap’s easy integration and automated orchestration alongside its Nakama integration.
Case Study

Instant Global Server Deployment for Collaborative XR Medical Education
AlensiaXR
How AlensiaXR uses Edgegap to deliver low-latency, always-available shared anatomy sessions to medical students worldwide.
Case Study

The Lightkeepers: A VR Social Co-op Game with Dedicated Servers
Spectral Games
How Spectral Games used Edgegap Matchmaking and Server Browser to launch dedicated servers for its VR social lobby, with no prior server experience.
Case Study

Fast & reliable deployments worldwide for PvPvE challenger Gravebound
Crater Studios
How Edgegap’s orchestration and matchmaking helped Crater Studios dramatically helped a small them focus on gameplay instead of infrastructure.
Case Study

Rapid Scaling of Web Metaverse
Hiber
Learn how Hiber eliminated the guesswork out of its server capacity planning with Edgegap.
Case Study

High Hardware Requirements & Custom Game Server Pools
Alderon Games
Learn how Alderon Games instantly leverages a custom pool of game servers across multiple providers worldwide for its popular MMO.
Case Study

Easy Integration for Indie Devs
WhaleFood Games
Read how WhaleFood Games "kicked out" its netcode issues with Edgegap.
Case Study

Cutting-edge tech that powers South-East Asia’s first-ever eSports title.
Anantarupa Studios
Learn how Edgegap transformed South-East Asia’s gaming landscape streamlining complex infrastructure and cutting-edge tech with one seamless solution.
Case Study

One Strike. Global Reach.
Triple Hill Interactive
How Triple Hill Interactive leverages Edgegap's orchestration to deliver low latency and improve fairness in a genre where every millisecond counts.
Case Study

Fast-paced Team Battle Royale... with Gun-totting Animal Plushes!
SANDYFLOOR
Discover how a Korea-based Indie Studio launched it multiplayer worldwide.
Case Study

Mobile Horse Racing Goes Global with Instant, Cost-Efficient Servers
Mirai Labs
How Mirai Labs powers Pegaxy Blaze's worldwide multiplayer races with just-in-time server deployment and fractional vCPU to keep cost per player low.
Case Study

Server Management & Distribution
Matrioshka Games
Read how Matrioshka Games were able to ship a Battle Royale in early access with limited ressources.
Case Study

At my Signal, Unleash Hell!
TyGames
Discover how Indie studio TyGames immerses players in third-person gladiatorial combat multiplayer.
Case Study

Instant Worldwide Orchestration
Soliton Interactive
Discover how Soliton Interactive did the impossible… Ship it's first playable as multiplayer!
Case Study

Competitive play with server-side physics ensures ideal sub-50 ms latency
NS7
Discover why solely Edgegap could enable an indie studio to deliver on its vision for a AAA-quality F2P sports gameplay through server-side physics and authority.
Case Study

Regional Deployments for iGaming
X1 Contra 1
X1 Contra 1 delivers real-time PvP casual games to its Brazilian player base through cost-effective hosting & regional deployments, ensuring data and legal compliance.
Case Study

Pay Only When Players Play: Affordable Multiplayer Infrastructure
Meltdown Interactive
How Edgegap helped indie developer Meltdown Interactive Media solve cost-effective scaling and matchmaking without the complexity, so they could focus on building the game.
Case Study

One Edgegap platform, three very different networking profiles
Warped Games
How Warped Games runs a social hub, real-time co-op, and turn-based co-op, all on the same Edgegap deployment API and the same container pipeline.
Case Study

Pool Live Tour Max
RETA Games
Case Study

Korea’s Web3 POP Extraction Shooter Goes Global, Instantly
NDUS Entertainment
How XOCIETY easily added Edgegap orchestration & integrated custom matchmaking working alongside Edgegap Ping Beacons to optimize latency.
Case Study

Multiplayer in Every Dimension
Arcadia.tv
Discover how Arcadia.tv uses Edgegap's edge network to deliver an innovative, team and location-based athletic VR sport.
Case Study

F2P Mobile Fighter Cuts Infrastructure Costs With Just-in-Time Servers
Game Changers Worldwide
How Game Changer Worldwide hosted Rumble Rush's real-time 3v3 PvP globally on mobile.
Case Study
Key reasons why they chose Edgegap
Discover the impact of Edgegap's automated game server orchestration for a flawless multiplayer experience.









