Realtime Core Intro
Overview
Realtime Core is a modern C++20 client-side SDK and the base layer for higher level Photon network solutions. It focuses on matchmaking and message transport: connect to the Photon Cloud, match players into rooms and exchange messages via events.
Realtime Core is the low-level foundation of all Photon's higher level SDKs, supporting them with its battle proven matchmaking and data transport capabilities backed by the Photon Cloud.
For most cases, the recommendation instead is to use the feature-rich SDKs: Fusion for Unity, Quantum for Unity, Fusion for Unreal, Fusion for Godot and Fusion Core for custom C++ engine integrations.
Use Realtime Core directly only in the rare case in which just matchmaking and message transport are needed or when the goal is building a customer synchronization layer on top of it.
Realtime Core is cross platform and runs on desktop, mobile, web and console targets. It also ships with a flat C API, a C# wrapper and a JavaScript package for browsers and Node.js, so the same client core can be used outside of C++.
The single user-facing entry point is RealtimeClient.
You create one instance, keep it serviced and await its asynchronous operations.
In C++ you drive it with Service() from your game loop and co_await (or poll) each operation, in JavaScript a timer services the client and each operation returns a promise.
The C++ API rests on four design pillars: coroutine-based asynchronous operations built on Task and Result, callback delivery through Broadcaster subscriptions, UTF-8 strings throughout and error handling that does not require exceptions.
Where to Go Next
Feature Overview
| Feature Area | Description | Manual Page |
|---|---|---|
| Connection and regions | Connect to the Photon Cloud and choose the region to play in. | Connection and Regions |
| Authentication | Identify users and integrate platform or custom authentication providers. | Authentication |
| Lobbies and matchmaking | List rooms and match players randomly or by filter, including the SQL lobby. | Lobbies and Matchmaking, SQL Lobby Matchmaking |
| Rooms and players | Create, join and manage rooms and the players inside them. | Rooms and Players |
| Properties | Share key-value data on rooms and players. | Custom Properties |
| Custom events | Send game messages to other players, with targeting and caching. | Custom Events |
| Structured payloads | Send self-describing event payloads, including your own custom types. | Structured Payloads |
| Direct messaging | Exchange peer-to-peer messages with optional server relay fallback. | Direct Messaging |
| Friends | Look up where friends are playing. | Friends |
| Statistics | Inspect connection quality and traffic counters. | Statistics |
| Logging | Route SDK logs into your own logging system. | Logging |
Language Wrappers
Realtime Core ships with a pure C API, a language wrapper for C# and a JavaScript/TypeScript package.
The C API is the flat C ABI the C# wrapper is built on, and it is also the binding to use from C itself or from any language with a foreign-function interface.
The JavaScript/TypeScript API is the npm package @photonengine/realtime-core for JavaScript and TypeScript, in browsers and Node.js.
It is the same client core compiled to WebAssembly, with a promise-based TypeScript API that binds the C++ RealtimeClient directly rather than through the C API.
Every tabbed code sample in this manual has a C and a JavaScript tab beside its C++ tab.
Requirements
Building against the C++ libraries requires a C++20 toolchain. The SDK Download page lists the supported platforms and compilers. The JavaScript/TypeScript package runs in the browser and in Node.js 22 or later, see JavaScript/TypeScript API.
You also need a Photon account and an App Id created in the Photon Dashboard.
Last updated on
Back to top