SDK docs
Godot 4
Export a Godot web build and use JavaScriptBridge only at the few natural ad moments in your game.
Export checklist
- Export for Web with index.html at the root of the ZIP.
- Include every .wasm, .pck, .js, and asset generated by Godot.
- Do not rely on file:// testing; validate through a hosted HTTP player.
Bridge the SDK
JavaScriptBridge is built into Godot Web exports. PlayKovo does not provide or require a Godot plugin, addon, or package. Keep callback references alive only when JavaScript will call back into GDScript later, such as onClose or onError.
# PlayKovoBridge.gd
extends Node
var _on_ad_closed = JavaScriptBridge.create_callback(_finish_level)
func show_level_complete_ad() -> void:
var sdk = JavaScriptBridge.get_interface("PlayKovoSDK")
if sdk:
sdk.showInterstitial({
"placement": "level_complete",
"onClose": _on_ad_closed,
"onError": _on_ad_closed,
})
else:
_finish_level([])
func _finish_level(_arguments: Array) -> void:
open_next_level()Pause and sound
PlayKovo pauses your game during ads, while the app menu is open and when the tab or app is in the background, and mutes it from the player's sound button. Forward those events into the engine. The check for isMuted skips this on SDK 1.x, so the same build runs on both versions.
# PlayKovoBridge.gd (add to the same node)
var _on_pause = JavaScriptBridge.create_callback(func(_a): get_tree().paused = true)
var _on_resume = JavaScriptBridge.create_callback(func(_a): get_tree().paused = false)
var _on_audio = JavaScriptBridge.create_callback(func(a): AudioServer.set_bus_mute(0, a[0].muted))
func _ready() -> void:
var sdk = JavaScriptBridge.get_interface("PlayKovoSDK")
if sdk and sdk.isMuted:
sdk.on("pause", _on_pause)
sdk.on("resume", _on_resume)
sdk.on("audio", _on_audio)Test before review
Check desktop and mobile browser exports. When the SDK is unavailable, your GDScript path must immediately continue gameplay without an error dialog.
One SDK, every web engine