Access
Connect cross-platform accounts & identity management
You can use an SDK to help implement AccelByte services in your game. The SDK acts as a bridge between your game and our services, making those services easy to access.
Download Unity SDKTo get started with Unity, you are required to install the Unity plugin either from package or source code.
Find the Package You've Downloaded
Input the JSON Content into AccelByteSDKConfig.json
{
"ClientId":"<GAME_CLIENT_ID>",
"ClientSecret":"<GAME_CLIENT_SECRET>",
"UseSessionManagement": true,
"PublisherNamespace":"<YOUR-PUBLISHER-NAMESPACE>",
"Namespace":"<YOUR-GAME-NAMESPACE>",
"BaseUrl": "<SERVER-BASE-URL>",
"LoginServerUrl":"<AUTH-SERVER-URL>",
"IamServerUrl":"<IAM-SERVER-URL>",
"PlatformServerUrl":"<PLATFORM-SERVER-URL>",
"BasicServerUrl":"<BASIC-SERVER-URL>",
"LobbyServerUrl":"<LOBBY-SERVER-URL>",
"TelemetryServerUrl":"<TELEMETRY-SERVER-URL>",
"RedirectUri":"http://localhost",
"CloudStorageServerUrl":"<CLOUDSTORAGE-SERVER-URL>",
"GameProfileServerUrl":"<GAMEPROFILE-SERVER-URL>",
"StatisticServerUrl": "<STATISTIC-SERVER-URL>"
}
INFO
If your game will be released without a publisher, you’ll be able to do everything related to your game in the game namespace. You can leave PublisherNamespace in the config file empty or null.
Install the Unity Plugin from the Source Code
To get started, first you need to download the AccelByte repository. To do so, follow the steps below.
Install the Unity Plugin from the Package
Ensure that you have downloaded the Unity package before getting started.
TIP
You can exclude any API that you’re sure you won’t use, such as CloudStorage, Telemetry, etc. If you need these APIs at a later date, you’ll be able to import them without reinstalling the Unity plugin.
Here’s an example of how to use the SDK to create a new user profile. Note that you must be logged in before you can implement any backend services.
using AccelByte.Api;
using AccelByte.Models;
using AccelByte.Core;
class MainMenu
{
public void OnLoginClick(string email, string password)
{
var user = AccelBytePlugin.GetUser();
user.LoginWithUsername(email, password,
result =>
{
if (result.IsError)
{
Debug.Log("Login failed");
}
else
{
Debug.Log("Login successful");
}
});
}
public void OnCreateProfileClick()
{
var userProfiles = AccelBytePlugin.GetUserProfiles();
userProfiles.CreateUserProfile(
new CreateUserProfileRequest
{
language = "en",
timeZone = "Asia/Jakarta",
firstName = "John",
lastName = "Doe",
dateOfBirth = "2000-01-01"
},
result =>
{
if (result.IsError)
{
Debug.Log("Creating user profile failed");
}
else
{
Debug.Log("User profile created.");
Debug.Log("First Name: " + result.firstName);
Debug.Log("Last Name: " + result.lastName);
}
});
}
}