Getting Started
You can quickly add real-time chat functionality to your Unity project using the Unity SDK. This guide will walk you through each step—from installing the Chat SDK, sending your first message, to checking messages in the console.
Jump right in with the Example project provided by BACKND! It includes a ready-made UI and working real-time chat so you can see it in action and easily use just the parts you need.
1. Install Chat SDK
Download the package below and import it into your Unity project.
- BackndChat-1.4.1.unitypackage [2026-08-27]
When importing the Chat SDK, make sure to uncheck Backend.dll to avoid overwriting it. For more information, check out the When also using Base SDK document.
Add the following to your mainTemplate.gradle file:
android {
...
packagingOptions {
jniLibs {
useLegacyPackaging true
}
}
}
2. Set up authentication key
The chat service uses BACKND Base's user features by default, so you must register the authentication keys issued by BACKND Console in your Unity project. If you do not want to use BACKND Base's user features, refer to Custom authentication.
- Go to Chat > Settings page in BACKND Console and copy
Chat UUID,Client App ID,andSignature Key.
- Paste the keys into Unity.


- Enter Chat UUID in
The Backend > Edit Chat Settings - Enter Client App ID / Signature Key in
The Backend > Edit Settings
3. Set user nickname
User nickname must be set to use the chatting function.
using UnityEngine;
using BackEnd;
public class BackendInit : MonoBehaviour
{
void Start()
{
// BACKND initialization
Backend.Initialize();
var result = Backend.BMember.CustomLogin("testId", "testPw");
if (!result.IsSuccess())
{
Backend.BMember.CustomSignUp("testId", "testPw");
// Set nickname
Backend.BMember.UpdateNickname("Nickname");
}
}
}
4. Initialize chat client
Initialize ChatClient to exchange chat messages.
using System.Collections.Generic;
using UnityEngine;
using BackndChat;
public class UIChatExample : MonoBehaviour, BackndChat.IChatClientListener
{
private ChatClient ChatClient;
void Start()
{
ChatClient = new ChatClient(this, new ChatClientArguments
{
Avatar = "default",
Metadata = new Dictionary<string, string>()
{
{ "Rank", "1" },
{ "Level", "1000" },
{ "Server", "1" }
}
});
}
void Update() => ChatClient?.Update();
void OnApplicationQuit() => ChatClient?.Dispose();
public void OnJoinChannel(ChannelInfo channelInfo) { }
public void OnLeaveChannel(ChannelInfo channelInfo) { }
public void OnJoinChannelPlayer(string channelGroup, string channelName, ulong channelNumber, PlayerInfo player) { }
public void OnLeaveChannelPlayer(string channelGroup, string channelName, ulong channelNumber, PlayerInfo player) { }
public void OnUpdatePlayerInfo(string channelGroup, string channelName, ulong channelNumber, PlayerInfo player) { }
public void OnChangeGamerName(string oldGamerName, string newGamerName) { }
public void OnWhisperMessage(WhisperMessageInfo messageInfo) { }
public void OnTranslateMessage(List<MessageInfo> messages) { }
public void OnHideMessage(MessageInfo messageInfo) { }
public void OnDeleteMessage(MessageInfo messageInfo) { }
public void OnChatMessage(MessageInfo messageInfo)
{
Debug.Log($"[Received] {messageInfo.GamerName}: {messageInfo.Message}");
}
public void OnSuccess(SUCCESS_MESSAGE success, object param) { }
public void OnError(ERROR_MESSAGE error, object param) { }
}
Call ChatClient.Update() every frame to process received messages and callbacks.
The BACKND Chat SDK automatically reconnects after network changes or temporary disconnections. You do not need to implement separate reconnection logic; call Dispose() when terminating the client.
5. Send message
Send a message to the default channel.
When BACKND Chat is activated, the server-1 default channel under the global group is automatically created. Send the message after the default channel is joined and OnJoinChannel is called.
public void OnJoinChannel(ChannelInfo channelInfo)
{
if (channelInfo.ChannelGroup != "global" || channelInfo.ChannelName != "server-1") return;
ChatClient.SendChatMessage(channelInfo.ChannelGroup, channelInfo.ChannelName, channelInfo.ChannelNumber, "Hello!");
}
The chat server connection is not yet established immediately after creating ChatClient, so channel join requests made at that point are ignored. Call additional channel join methods only after the connection has completed, such as from the default channel's OnJoinChannel callback.
Complete code template
BACKND initialization script
using BackEnd;
using UnityEngine;
using UnityEngine.UI;
public class LoginManager : MonoBehaviour
{
public InputField Username = null;
public InputField Password = null;
void Start()
{
Backend.Initialize(true);
}
void Login()
{
var returnObject = Backend.BMember.CustomLogin(Username.text, Password.text);
if (false == returnObject.IsSuccess())
{
Debug.Log("CustomLogin Fail");
returnObject = Backend.BMember.CustomSignUp(Username.text, Password.text);
if (false == returnObject.IsSuccess())
{
Debug.Log("CustomSignUp Fail");
return;
}
returnObject = Backend.BMember.CustomLogin(Username.text, Password.text);
if (false == returnObject.IsSuccess())
{
Debug.Log("CustomLogin Fail");
return;
}
// Nickname update - You cannot connect to the chat if you do not have a nickname.
Backend.BMember.UpdateNickname(Username.text);
}
}
}
Chat initialization script
using System;
using System.Collections.Generic;
using UnityEngine;
using BackndChat;
public class UIChatManager : MonoBehaviour, BackndChat.IChatClientListener
{
private BackndChat.ChatClient ChatClient = null;
void Start()
{
ChatClient = new ChatClient(this, new ChatClientArguments
{
Avatar = "default",
Metadata = new Dictionary<string, string>()
{
{ "Rank", "1" },
{ "Level", "1000" },
{ "Server", "Server 1" },
},
});
// If the inspector has not been configured, you can register the Chat UUID (xxxx-xxxx-xxxxxx-xxxxxxx) manually as shown below.
/*
ChatClient = new ChatClient(this, new ChatClientArguments
{
UUID = "xxxx-xxxx-xxxxxx-xxxxxxx",
Avatar = "default",
Metadata = new Dictionary<string, string>()
{
{ "Rank", "1" },
{ "Level", "1000" },
{ "Server", "Server 1" },
},
});
*/
// If using a custom authentication server, the token can be registered as shown below.
/*
ChatClient = new ChatClient(this, new ChatClientArguments
{
UUID = "xxxx-xxxx-xxxxxx-xxxxxxx",
Avatar = "default",
Metadata = new Dictionary<string, string>()
{
{ "Rank", "1" },
{ "Level", "1000" },
{ "Server", "Server 1" },
},
CustomAccessToken = USER_TOKEN,
});
*/
}
void Update()
{
ChatClient?.Update();
}
public void OnJoinChannel(ChannelInfo channelInfo) { }
public void OnLeaveChannel(ChannelInfo channelInfo) { }
public void OnJoinChannelPlayer(string channelGroup, string channelName, UInt64 channelNumber, PlayerInfo player) { }
public void OnLeaveChannelPlayer(string channelGroup, string channelName, UInt64 channelNumber, PlayerInfo player) { }
public void OnUpdatePlayerInfo(string channelGroup, string channelName, ulong channelNumber, PlayerInfo player) { }
public void OnChangeGamerName(string oldGamerName, string newGamerName) { }
public void OnChatMessage(MessageInfo messageInfo) { }
public void OnWhisperMessage(WhisperMessageInfo messageInfo) { }
public void OnTranslateMessage(List<MessageInfo> messages) { }
public void OnHideMessage(MessageInfo messageInfo) { }
public void OnDeleteMessage(MessageInfo messageInfo) { }
public void OnSuccess(SUCCESS_MESSAGE success, object param)
{
switch(success)
{
default:
break;
}
}
public void OnError(ERROR_MESSAGE error, object param)
{
switch(error)
{
default:
break;
}
}
private void OnApplicationQuit()
{
ChatClient?.Dispose();
}
}
6. Check the message in the console
Select the server-1 channel in the BACKND console to view the chat messages sent from the client.

Chat integration is now complete! 🎉
You can now use the real-time chat function in your game.
To expand the feature or apply it to your actual project, check out the resources below.
- I want to see the sample with complete GUI → Example project
- I'm curious about other chat functions → Introduction to chat functions
- I want to use it with BACKND Base → Base integration guide
- I want to use my own auth system → Custom authentication guide