Install the Godot SDK
Overview
Use the AccelByte Gaming Services (AGS) Game SDK for Godot to implement AGS features in your game. The SDK is written in GDScript, so it needs no build step and works with Godot's desktop, web, and dedicated server exports.
AGS Godot SDK on GitHubPrerequisites
- Godot version 4.4 or newer
- An AGS Game Namespace
- An AGS IAM Client
- An AGS Client ID
Make sure that you use the following format for the base_url, otherwise your API calls may return an error due to a domain mismatch:
https://<Studio ID>-<Game TitleID>.prod.gamingservices.accelbyte.io
- For example:
https://mystudio-myawesomegame.prod.gamingservices.accelbyte.io
Tutorial
Install the SDK
You can get the SDK from the Godot Asset Library or from GitHub.
- Asset Library
- GitHub
- Open your Godot project and go to the AssetLib tab.
- Search for AccelByte Gaming Service SDK, or open its Asset Library page. Click Download, and then click Install.
- In the install dialog, keep all files selected and click Install again. The SDK is added to
addons/accelbyte_sdkin your project.
- Download the latest version of the SDK from the AGS Godot SDK tags page and extract the archive.
- Copy the
addons/accelbyte_sdkfolder into your game'saddonsfolder. If your game doesn't have this folder yet, create a folder namedaddonsin your project's root directory. The final structure should be[YourProject]/addons/accelbyte_sdk/.
The SDK is not an editor plugin, so you don't need to enable it in Project Settings > Plugins. After you install it, you can use the SDK classes, such as AccelByteSDK, from any script.
Configure the SDK
Add your AGS configuration to the [accelbyte] section of your project.godot file, or go to Project > Project Settings > General and add the settings there. The SDK reads them when you call initialize().
[accelbyte]
base_url="Required"
namespace="Required"
client_id="Required"
client_secret=""
redirect_uri=""
log_level="Off"
Then initialize the SDK from a script in your game:
extends Node
var sdk: AccelByteSDK
func _ready() -> void:
sdk = AccelByteSDK.new()
sdk.initialize(self)
- You can find your Client ID, Client Secret, and Namespace settings in the AGS Admin Portal.
- For AGS Public Cloud, use the following format for Namespace:
<Studio ID>-<Game TitleID>. - Leave the Client Secret empty if the Game Client uses the Public Client type.
- Contact support or your Account Manager if you're unsure of your API URLs. If you're in AGS Public Cloud, the
base_urlishttps://<Studio ID>-<Game TitleID>.prod.gamingservices.accelbyte.io.
Override the configuration with launch arguments
Launch arguments override the values in project.godot, so one build can run against another environment. This is useful for dedicated servers. Each setting has the flag -ab_<name>, for example:
godot --headless --path game --server -ab_base_url=https://<base URL> -ab_namespace=<namespace> -ab_client_id=<client ID> -ab_client_secret=<client secret>
A client secret on a command line is visible in the process list. A dedicated server started with AccelByteDedicatedServer can read it from the AB_CLIENT_SECRET environment variable instead.
Congratulations! You successfully configured the AGS SDK for Godot. To log in a player, see Implement login with device ID.