Documentation Index
Fetch the complete documentation index at: https://docs.hyperx.dev/llms.txt
Use this file to discover all available pages before exploring further.
HyperX chat lets authenticated users join channels and exchange messages inside a project. The server stores channels, memberships, message order, acknowledgements, and reports. Operators can inspect and moderate chat from Console.
Create and Join a Channel
var channel = await HyperX.Core.Chat.CreateChannel(
session.AccessToken,
channelKey: "global",
channelType: "project",
displayName: "Global",
retentionDays: 90
);
await HyperX.Core.Chat.Join(session.AccessToken, channel.Id);
Supported channel types are project, guild, party, direct, and announcement. Announcement channels are read-only for regular users.
Send and Read Messages
var sent = await HyperX.Core.Chat.Send(
session.AccessToken,
channel.Id,
"hello"
);
var messages = await HyperX.Core.Chat.ListMessages(
session.AccessToken,
channel.Id,
afterSequence: sent.Sequence - 1
);
await HyperX.Core.Chat.Acknowledge(
session.AccessToken,
channel.Id,
sent.Sequence
);
sequence is the increasing message number inside a channel. After reconnecting, pass the last processed sequence as afterSequence to catch up.
Unity Subscription
var subscription = HyperX.Core.Chat.Subscribe(
session.AccessToken,
channel.Id,
message => Debug.Log(message.Body),
error => Debug.LogWarning(error.Message),
pollIntervalMilliseconds: 2000
);
// When the GameObject is destroyed
subscription.Dispose();
Subscribe only while the chat screen is open, and call Dispose when it closes.
Subscriptions keep the last processed sequence and acknowledge after new messages are delivered to the callback. On transient failures the SDK enters reconnecting, applies bounded backoff up to 30 seconds, and resumes catch-up from the last sequence. If your access token expires, refresh the session with Core.Users.Refresh(refreshToken) and recreate the subscription with the new access token.
Reports and Moderation
await HyperX.Core.Chat.Report(
session.AccessToken,
channel.Id,
messageId,
reason: "spam"
);
If an operator mutes a user or hides a message, SDK calls may return structured errors.
try
{
await HyperX.Core.Chat.Send(session.AccessToken, channel.Id, "hello");
}
catch (HyperX.HyperXServerException ex)
when (ex.ErrorCode == "CHAT_SENDER_MUTED")
{
Debug.Log("The player is muted in chat.");
}