Last Updated: 4/20/2022, 6:18:39 AM

# Unity SDK Installation Guide

You can use our Unity SDK to implement AccelByte services into your game. The SDK acts as a bridge between your game and our services.

Download Unity SDK

# Install SDK and Configure

In this tutorial, you will learn how to download and install the AccelByte Unity SDK, as well as set up your AccelByte Config file.

  1. Before continuing, ensure you have the necessary Namespace and OAuth Clients set up in the Admin Portal. Follow this guide (opens new window) to create a new game namespace and this guide (opens new window) to add or adjust your OAuth Clients.
  2. Create a Project.
  3. Go to Window > Package Manager > + > Add package from git URL…, paste https://github.com/AccelByte/accelbyte-unity-sdk.git (opens new window) into the pop-up, and click Add. a. If you are using Assembly Definitions in your project, you may need to add the com.accelbyte.UnitySDK Assembly as a reference to your relevant definitions. b. You must have Git installed and configured on your computer in order for Unity to use a UPM Package.
  4. Go to AccelByte > Edit Settings in the menu bar and fill in Namespace, Publisher Namespace, Base Url, Client Id, Client Secret, Redirect Uri, and App Id. Leave the other input fields empty and click Save.

Unity

Alternatively, you can create a file called AccelByteSDKConfig.json in your Assets/Resources folder and fill it with the appropriate information in the following format:

{
  "Namespace": "<GAME_CLIENT_NAMESPACE>",
  "UsePlayerPrefs": true,
  "EnableDebugLog": false,
  "DebugLogFilter": "Log",
  "BaseUrl": "https://demo.accelbyte.io",
  "ClientId": "<GAME_CLIENT_ID>",
  "ClientSecret": "<GAME_CLIENT_SECRET>",
  "RedirectUri": "http://127.0.0.1",
  "AppId": "<GAME_APP_ID>",
  "PublisherNamespace": "<PUBLISHER_NAMESPACE>"
}

You can find your ClientID, Secret, and Namespace settings in the AccelByte Admin Portal.

  1. Create a file called AccelByteServerSDKConfig.json in your Assets/Resources folder for the server SDK configuration and fill it with the appropriate information in the following format:
{
    "Namespace": "<PUBLISHER_NAMESPACE>",
    "BaseUrl": "https://demo.accelbyte.io",
    "ClientId": "<GAME_SERVER_CLIENT_ID>",
    "ClientSecret": "<GAME_SERVER_CLIENT_SECRET>",
    "RedirectUri": "http://127.0.0.1"
}

You can find your ClientID, ClientSecret, and Namespace settings in the AccelByte Admin Portal. Contact support or your Account Manager if you are unsure of your API URLs.

Now that you have the SDK installed in your project, you will need to configure your project settings in order for the SDK to work on your project’s build standalone.

  1. In your Editor, go to File > Build Settings… and select Player Settings.
  2. Select Other Settings to expand the options.
  3. In Configurations, change the API Compatibility Level to .NET 4.x from the drop down menu.

Unity

Congratulations! You have successfully configured the SDK for use in Unity.

Proceed to the next section to learn how to implement the Login IAM (opens new window).