C++ API

Overview

Overview of the Blazeauth C++ session API.

The Blazeauth C++ API exposes the WebSocket protocol through blaze::session and language-native result types.

Design philosophy

If you want the design goals behind the library itself, see Philosophy. That page explains the runtime contract, portability stance, technology choices, and why the library avoids owning your UI/logging/process behavior.

API styles

Every session operation is exposed in the same general forms:

StyleExampleWhen to use
Throwing syncauto app = session.initialize(key, client_id);Straightforward code paths where std::system_error is acceptable.
No-throw syncauto app = session.initialize(key, client_id, ec);Manual error handling without exceptions.
Callbacksession.async_initialize(key, client_id, callback);Existing async/event-driven code.
Coroutineauto [ec, app] = co_await session.co_initialize(key, client_id);Coroutine-based async flows.

Error model

API-level failures are returned through result objects like application.status. Transport and runtime failures are returned through std::error_code or std::system_error.

Runtime hooks

Utilities

Connection

This page is a quick function index.

For full signatures, result schemas, and behavior details, open the dedicated page from each block.

Account Flows

Server events

Files

Moderation and Metrics

Variables and Session Data

Notes

  • Common misuse cases are documented on Common pitfalls.
  • with_timeout, get_io_thread_id, is_connected, and last_operation_took are local utility methods and do not perform API requests.
  • connect, shutdown, and ping do not return blaze::status.
  • initialize, create_account, both authorize overloads, get_online_users_count, get_variable, get_session_value, get_current_license, get_current_account, transfer_file, and get_file_metadata return API status through result objects.
  • link_license, logout, blacklist, set_session_value, delete_session_value, enable_panel_events, and stop_file_transfer return API status directly as blaze::status.
  • get_online_users_count returns API status through online_users_count.status.
  • transfer_file is asymmetric by design: sync and coroutine overloads aggregate the whole transfer, while async overloads stream per-chunk packets.
  • Sync overloads use the session timeout configured in the constructor or via with_timeout(...).
  • Coroutine overloads are available only when the library is built with coroutine support.

On this page