Godot SDK
This section describes the Jest Godot SDK and how to integrate it into your Godot 4.x game.
Installation
- Download or clone the Jest Godot SDK repository
- Copy the
addons/jest_sdk/folder into your Godot project'saddons/directory - Open your project in the Godot editor
- Go to Project > Project Settings > Plugins
- Enable the Jest SDK plugin
The plugin automatically registers JestSDK as an autoload singleton.
Sample Project
A complete sample project is available at jest-com/jest-godot-sample-project.
Requirements
- Godot 4.x
- Web export target (the SDK communicates with the Jest platform via JavaScript)
SDK Access
The Jest SDK is registered as an autoload singleton. Access all SDK functionality through JestSDK:
# Access the SDK singleton
var jest = JestSDK
# Access specific modules
var player = JestSDK.player
var notifications = JestSDK.notifications
var payment = JestSDK.payment
var referrals = JestSDK.referrals
var navigation = JestSDK.navigation
Initialization
Before using any SDK features, initialize the SDK with init_sdk(). This should be called once, typically in your main scene's _ready() function:
func _ready():
var success = await JestSDK.init_sdk()
if success:
print("Jest SDK initialized")
else:
print("Jest SDK failed to initialize")
You can also listen for the sdk_initialized signal:
func _ready():
JestSDK.sdk_initialized.connect(_on_sdk_initialized)
JestSDK.init_sdk()
func _on_sdk_initialized(success: bool):
if success:
print("Jest SDK ready")
Configuration
JestSDK.init_sdk() accepts an optional dictionary of options:
| Option | Type | Default | Description |
|---|---|---|---|
auto_login_reminders | bool | true | When set to false, disables the automatic login reminder popups that appear at escalating intervals for unregistered players. Manual login via JestSDK.login() is unaffected. |
# Disable automatic platform login reminders
var success = await JestSDK.init_sdk({"auto_login_reminders": false})
Using the SDK
The remainder of this guide walks through the SDK's modules and how to use them in your game.
This includes retrieving player data and authenticating players, passing data into your game, scheduling and managing notifications, and using in-app payments. It also includes sharing your game with referral links and tracking conversions and controlling the platform loading screen.
Testing
The SDK includes a mock system for testing in the Godot editor. When running outside a web browser, the SDK automatically uses a mock bridge that simulates all platform functionality locally.
Configuring the Mock
Access the mock configuration via JestSDK.mock (only available when JestSDK.is_web is false):
if not JestSDK.is_web:
var mock = JestSDK.mock
# Enable verbose logging
mock.verbose = true
# Set mock player state
mock.player_id = "mock-player-123"
mock.is_registered = true
# Control purchase outcomes
mock.mock_purchase_succeeds = true
This is especially useful for:
- Debugging player progression
- Testing notification scheduling
- Simulating different player scenarios
- Testing payments
- Testing referral flows
Detecting the Environment
Use JestSDK.is_web to check whether the game is running in a web browser or in the editor:
if JestSDK.is_web:
# Running on the Jest platform
pass
else:
# Running in the Godot editor or non-web export
pass