Note: The runtime bridge works in Godot 3.4+ and Godot 4.x.
This plugin is designed to help the integration of the PokiSDK into your Godot game. It is possible to build the integration yourself by creating a custom html shell by modifying the default template, but this plugin makes it easier and faster to do the same.
This plugin provides:
- A custom html shell
- PokiSDK singleton for GDScript integration
- A demo scene showcasing usage
The runtime files in addons/poki-sdk are parser-safe in both Godot 3 and Godot 4. Godot's editor-plugin annotation is not cross-version compatible (tool in Godot 3, @tool in Godot 4), so the checked-in addons/poki-sdk/plugin.gd is only a neutral placeholder. Add the autoload/export preset manually, or copy the matching editor-plugin template before enabling the plugin.
Please note that Poki is a curated platform, you will need to submit your game through Poki for Developers first, and only work on the sdk integration after the game is approved.
There are two ways to download and install the plugin
You can search and install the plugin directly from the official Asset Library. This is the easiest way to get started.
- Switch to the AssetLib tab (1) and search for poki (2) using the search bar. Once you find it (3) click on it.
- You will be shown the details of the plugin. Click the download button.
- Once the download is finished, you will be shown the install dialog box. Click on the install button.
- If everything goes well, you will see a dialog box showing that you have successfully installed the plugin.
Download the plugin archive godot-poki-sdk-master.zip.
Or download the source code and copy the poki-sdk directory into your project's addons directory.
git clone https://github.com/vkbsb/godot-poki-sdk.git
Add res://addons/poki-sdk/pokisdk.gd as an autoload named PokiSDK.
Create a Poki export preset:
- Godot 3.4+: platform
HTML5 - Godot 4.x: platform
Web
Set the export preset's custom HTML shell to:
res://addons/poki-sdk/full-size.html
Before enabling the plugin, copy the matching template from inside the addon package into addons/poki-sdk:
Godot 3.4+:
cp addons/poki-sdk/editor-plugin-templates/godot3/plugin.cfg addons/poki-sdk/plugin.cfg
cp addons/poki-sdk/editor-plugin-templates/godot3/plugin.gd.txt addons/poki-sdk/plugin.gdGodot 4.x:
cp addons/poki-sdk/editor-plugin-templates/godot4/plugin.cfg addons/poki-sdk/plugin.cfg
cp addons/poki-sdk/editor-plugin-templates/godot4/plugin.gd.txt addons/poki-sdk/plugin.gd- Launch the plugin manager in Godot editor under project settings.
- Switch to the plugins tab to make sure that the plugin is enabled.
- Reload the current project.
Once you have finished the installation, you need to export your preset.
- Open the export dialog
- Under Presets you should see an entry called "Poki"
When using the optional editor auto-setup, the extension:
- Adds a new preset called
Pokito export config in project. - Adds an automatically loaded singleton called
PokiSDKfor the game script to use.
Add or autoload a singleton called PokiSDK. In Godot scripts you call it directly, while the exported HTML shell initializes the underlying browser SDK before the Godot engine starts.
The exported shell is the only place where the browser PokiSDK.init() call happens. It runs before the Godot engine starts, so the Godot autoload does not expose a public PokiSDK.init() method.
By default, the shell enables Poki debug mode on localhost and 127.0.0.1. You can still override that at runtime with PokiSDK.setDebug(false) or enable logging later with PokiSDK.setLogging(true).
Note: to fully understand the difference between commercialBreak() and rewardedBreak(), refer to the PokiSDK events documentation.
Lifecycle and monetization:
PokiSDK.gameLoadingFinished()
PokiSDK.gameplayStart()
PokiSDK.gameplayStop()
PokiSDK.commercialBreak()
PokiSDK.rewardedBreak()
PokiSDK.rewardedBreak({
"size": "small", # accepted values: small, medium, large
})Callbacks use the engine's native callback type:
# Godot 3.4+
PokiSDK.commercialBreak(funcref(self, "_on_ad_started"))
PokiSDK.rewardedBreak({
"size": "small",
"onStart": funcref(self, "_on_ad_started"),
})
# Godot 4.x
PokiSDK.commercialBreak(Callable(self, "_on_ad_started"))
PokiSDK.rewardedBreak({
"size": "small",
"onStart": Callable(self, "_on_ad_started"),
})Sharing, URL helpers, and accounts:
PokiSDK.shareableURL({
"id": "demo-user",
"type": "reward",
"score": 42,
})
PokiSDK.getURLParam("id")
PokiSDK.getLanguage()
PokiSDK.getUser()
PokiSDK.getToken()
PokiSDK.login()Diagnostics, analytics, and playtest helpers:
PokiSDK.captureError("Something went wrong")
PokiSDK.setDebug(true)
PokiSDK.setLogging(true)
PokiSDK.enableEventTracking(123)
PokiSDK.openExternalLink("https://developers.poki.com/")
PokiSDK.movePill(50, -100)
PokiSDK.measure("demo", "button", "clicked")
PokiSDK.playtestSetCanvas(canvas_handle)
PokiSDK.playtestSetCanvas([canvas_a, canvas_b])Promise-based methods resolve through Godot signals:
commercial_break_done(response)
commercial_break_failed(error)
rewarded_break_done(response)
rewarded_break_failed(error)
shareable_url_ready(url)
shareable_url_failed(error)
user_ready(user_dict_or_null)
user_failed(error)
token_ready(token_or_null)
token_failed(error)
login_done()
login_failed(error)The User payload is exposed as a Godot Dictionary:
{
"username": "TestUser",
"avatarUrl": "https://a.poki-cdn.com/img/placeholder_gradient.png",
}Basic ad flow:
func _on_play_again_pressed():
$AudioStreamPlayer.stream_paused = true
PokiSDK.gameplayStop()
PokiSDK.commercialBreak()
func _on_commercial_break_done(_response):
$AudioStreamPlayer.stream_paused = false
PokiSDK.gameplayStart()Account flow:
Godot 3.4+:
func _ready():
PokiSDK.connect("user_ready", self, "_on_user_ready")
PokiSDK.getUser()
func _on_login_button_pressed():
PokiSDK.login()Godot 4.x:
func _ready():
PokiSDK.connect("user_ready", Callable(self, "_on_user_ready"))
PokiSDK.getUser()
func _on_login_button_pressed():
PokiSDK.login()Move the Poki Pill, track a custom event, and open an approved external link:
PokiSDK.movePill(50, -100)
PokiSDK.measure("demo", "ui", "open_store")
PokiSDK.openExternalLink("https://developers.poki.com/")Submit your game on Poki
Submit your game to Poki on Poki for Developers! We will review your game, and if we think your game is a good fit for our playground, we will reach out to you!









