An asynchronous Godot 4.x client that mirrors the BosBase JS SDK surface. The API is close to the JS version but uses plain GDScript classes and await-based methods.
- Copy
gdscript-sdk/srcinto your project (eg. underres://gdscript-sdk/). - Instantiate the client and call the same services you know from the JS SDK:
var BosBase = preload("res://gdscript-sdk/src/bosbase.gd")
func _ready() -> void:
var pb = BosBase.new("http://127.0.0.1:8090")
var auth = await pb.collection("_superusers").auth_with_password("admin@example.com", "password")
if auth is ClientResponseError:
push_error(auth.to_string())
return
var list = await pb.collection("articles").get_list()
print(list)- Services: collections, records, files, realtime (SSE), pubsub (websocket), settings, backups, crons, vectors, LLM documents, LangChaingo, cache, GraphQL, SQL, batch API and health/log helpers.
- Auth store: in-memory with optional disk persistence (
AuthStorestorestokenandmodel). - Errors: methods return a
ClientResponseErrorinstance when something goes wrong. Checkresult is ClientResponseErrorbefore using the payload. - Files: pass
filesas aDictionaryorArrayof{name, filename, content_type, data}; the body is sent as multipart with@jsonPayload. - Realtime & pubsub: run on the main thread and reconnect when possible; callbacks are invoked on the main thread.
- All network methods are
await-able. They rely onHTTPRequest,HTTPClient, andWebSocketPeer, so the Godot main loop must be running. - The SDK paths assume the folder lives at
res://gdscript-sdk/; adjust thepreload()paths inbosbase.gdif you place it elsewhere.