Copy the Godot SDK into your project, register an autoload, and export for web. GDScript calls mirror the JavaScript SDK through the built-in JavaScriptBridge.
View the SDK on GitHub Playtest the example projectInstall the SDK
- Download the add-on folder on GitHub
- Place it at
res://addons/wavedash/in your project - In Project > Project Settings > Autoload, add
res://addons/wavedash/WavedashSDK.gdasWavedashSDK - Autoload ordering matters: Make sure the WavedashSDK Autoload is listed above any other scripts that use the WavedashSDK
Web export settings
- Add a Web export preset in Project > Export...
- Enable Threads support and VRAM texture compression as needed
- Export to the folder you reference as
upload_dir
Use the SDK from GDScript
Calling init() is required. It opts your game into Wavedash platform features and is how the SDK confirms you're set up. Call it once your game is ready to play.
func _ready():
WavedashSDK.backend_connected.connect(_on_connected)
WavedashSDK.init({"debug": true})
func _on_connected(_payload):
print("Playing as: ", WavedashSDK.get_username())
Async calls: await or callbacks
Every async WavedashSDK.* function returns the response and also emits a matching signal (e.g. post_leaderboard_score → posted_leaderboard_score). Pick whichever style suits your code — use await for straight-line flow, or connect a callback to the signal.
Responses come back as a Dictionary with success, data, and message keys:
# Option A: await the return value
func post_score_awaited(leaderboard_id: String, value: int):
var response = await WavedashSDK.post_leaderboard_score(leaderboard_id, value, true)
if response.success:
print("Rank: ", response.data.globalRank)
# Option B: connect once, handle responses in a callback
func _ready():
WavedashSDK.posted_leaderboard_score.connect(_on_score_posted)
func post_score(leaderboard_id: String, value: int):
WavedashSDK.post_leaderboard_score(leaderboard_id, value, true)
func _on_score_posted(response):
if response.success:
print("Rank: ", response.data.globalRank)
wavedash.toml
game_id = "YOUR_GAME_ID_HERE"
upload_dir = "./exports/web"
[godot]
version = "4.5-stable"