Add Flock to your Godot game with the official addon — from GDScript or C#.
The Flock Godot SDK connects your game to the Flock backend: player auth, save data, economy,
remote config, leaderboards, notifications, downloadable assets and analytics — set up from one
window in the editor, with typed GDScript and C# classes generated from your own dashboard content.
Download the Godot SDK
Get the latest addon release from GitHub.
Requirements
Godot 4.4.1 to 4.7.2, the standard build, or the .NET build for C#. Every change to the SDK is
tested on 4.4.1, 4.5.2, 4.6.3 and 4.7.2; Godot 4.3 and older are not supported.
Nothing else: the addon brings everything it needs, C# included.
Setup
1
Install the addon
Download flock-godot-sdk-v<version>.zip from the latest
release (not GitHub’s Source code archive)
and extract it into your project’s folder, so you have res://addons/flock/.Then turn on Flock under Project → Project Settings → Plugins. That adds a global Flock
object to your project (an autoload), so there is no node to add to a scene. A C# project needs no
extra step: your .csproj picks up the C# files inside the addon by itself.
2
Configure
Open Project → Tools → Flock → Open Flock setup. On a new project, press Create config on
its Setup tab: that makes res://flock_config.tres, the file the SDK reads its settings from.
Then fill in the fields from your game’s page on the dashboard:
Field
Value
API URL
Leave the default (https://api-flock.qwacks.com) unless told otherwise
API key
Identifies your game — treat it like a password
Game
Your game’s name, exactly as the dashboard shows it
Game version
A version name that exists on the dashboard (e.g. 1.0.0)
Every edit is saved into flock_config.tres when you leave the field or press Enter. The SDK finds that file when the game
starts and initializes itself.
3
Resolve the game version
Press Resolve version. The version name is looked up and its id is written into
flock_config.tres, so the game never has to ask the server for it, and a game started offline
still gets a working SDK. The SDK will not start without this id.The same press checks that the Game name matches the game your API key belongs to, and writes
nothing when it does not, so a key from the wrong game is caught here.The window’s checklist shows what is still missing. Test connection (also under
Project → Tools → Flock) checks the API URL and key (and the Game name, when you typed one), before you know a version
name.
The Setup tab: the credentials with the version resolved, the Create config, Resolve version and Test connection buttons, and the checklist.
The API key ships inside your exported game: flock_config.tres is part of it and can be read.
Use a key for the right environment, and rotate it on the dashboard if it leaks.
Your first call
With flock_config.tres in place, the SDK starts by itself when the game starts. Add this script to a
node in your first scene: once the SDK has started, it picks up the player’s saved sign-in, and signs
the player in with this device only when there was none.
GDScript
C#
extends Nodefunc _ready() -> void: Flock.events.when_initialized(_on_flock_ready)func _on_flock_ready() -> void: # Pick up the sign-in saved on an earlier launch. value is false when there was none. var restored: FlockResult = await Flock.auth.restore_sign_in().completed if not restored.value: var signed_in: FlockResult = await Flock.auth.sign_in_with_device().completed if signed_in.error_code() == "player.invalid_login_credentials": # The first launch on this device: registering creates the player and signs them in. signed_in = await Flock.auth.register_with_device().completed if not signed_in.ok: push_error(signed_in.error.describe()) # What is wrong, then a Fix: line. return var game: FlockResult = await Flock.game.get_game().completed if game.ok: print("Signed in as ", Flock.auth.player_id(), ", playing ", game.value.name) else: push_error(game.error.describe())
using Flock;using Godot;public partial class FlockFirstCall : Node{ public override void _Ready() { FlockClient.Events.WhenInitialized(OnFlockReady); } private async void OnFlockReady() { // Pick up the sign-in saved on an earlier launch. Value is false when there was none. var restored = await FlockClient.Auth.RestoreSignInAsync(); if (!restored.Value) { var signedIn = await FlockClient.Auth.SignInWithDeviceAsync(); if (signedIn.ErrorCode == "player.invalid_login_credentials") { // The first launch on this device: registering creates the player and signs them in. signedIn = await FlockClient.Auth.RegisterWithDeviceAsync(); } if (!signedIn.Ok) { GD.PushError(signedIn.Error.ToString()); // What is wrong, then a Fix: line. return; } } var game = await FlockClient.Game.GetGameAsync(); if (game.Ok) GD.Print($"Signed in as {FlockClient.Auth.PlayerId}, playing {game.Value.Name}"); else GD.PushError(game.Error.ToString()); }}
Success is Signed in as and the player’s id in the Output panel.With no id passed, the device calls use the id Godot gives for this device (OS.get_unique_id()).
Godot has none on the Web and on iOS, so there the calls fail with flock.invalid_argument and send
nothing: make an id yourself, save it in the game’s files, and pass it to sign_in_with_device(id) and
register_with_device(id). Two copies of the game on one computer have the same device id, and so are
one player: pass a different id in one of them. A new device means a new player, so offer
account linking (an email or a platform account) to players who want to get
back in on another device.
Initialization
The SDK can start two ways. Automatic is the default and fits most games; manual gives you
control over when it starts (after a splash screen, or once a player has answered a consent
question).
Automatic (default)
Manual
Nothing to call: when the game starts, the Flock autoload reads res://flock_config.tres and
initializes from it. The SDK sends its signals on the next frame, so a handler connected in
_ready() still gets what the SDK announced while it started. Flock.events.when_initialized()
runs its callable even when the SDK started before it was called, which a plain connect() cannot.
Restoring a saved sign-in is yours to start: call Flock.auth.restore_sign_in(), as
Your first call does.
Untick Auto initialize on the setup window’s Configuration tab (auto_initialize on
flock_config.tres), then start the SDK yourself. initialize() returns straight away.
The Configuration tab: Connection, HTTP, and Initialization with Persist sign in and Auto initialize.
var config: FlockConfig = load("res://flock_config.tres")var started: FlockResult = Flock.initialize(config)if not started.ok: push_error(started.error.describe())
FlockResult started = FlockClient.Initialize(); // reads res://flock_config.tresif (!started.Ok) GD.PushError(started.Error.ToString());
A config the SDK cannot start from (no API URL or key, no game version id) fails initialize() with
flock.not_initialized and a message naming what is missing, and the automatic start raises
Flock.events.initialization_failed. Until the SDK has started, its services do not exist: in GDScript
Flock.auth and the others are null, and in C# FlockClient.Auth and the others throw an
InvalidOperationException saying to initialize first. Check Flock.is_initialized()
(FlockClient.IsInitialized in C#), or wait for when_initialized() as above.
GDScript and C#
The SDK is one client with two ways in. Its core is GDScript, reached through the Flock
autoload; C# gets a typed layer, FlockClient, generated from that core and shipped inside the addon.
Both use the same client, so a player signed in from GDScript is signed in for C#, and the other way
round.Every call that reaches the server returns a FlockRequest in GDScript: await its completed
signal (not the method), or connect to it. The answer is a FlockResult with ok, value and
error. In C# the same call is an …Async method that returns a FlockResult<T> with Ok, Value
and Error, and takes an optional CancellationToken.
var result: FlockResult = await Flock.auth.sign_in_with_email(email, password).completed
var result = await FlockClient.Auth.SignInWithEmailAsync(email, password);
Once the SDK has started, calls do not throw. A failed call is a result whose ok is false, in both
languages, so a project that uses both handles a failure the same way on each side. Check ok: a
successful call can still answer null (a player with no saved data yet, for example).Names map one to one, so a GDScript name tells you the C# one:
GDScript
C#
Example
A call that reaches the server
PascalCase + Async
get_standings → GetStandingsAsync
A property
PascalCase
player_name → PlayerName
A check with no arguments
A property
is_signed_in() → IsSignedIn
A constant
Spelled the same
STATUS_UNUSED → STATUS_UNUSED
int, float
long, double
size_bytes → long SizeBytes
C# code needs using Flock;, and using Flock.Generated; for the classes made from your dashboard
content (Work with your game data). A project without the .NET build
ignores the C# files in the addon.
Authenticate a player
Signing in does not create an account: registering is a separate register_with_* call, and a
register that creates the account also signs the player in.
Device
Email
Google / Apple / Steam
Sign in, and register on the first launch, as Your first call shows.
email and password come from your own sign-in and sign-up screens.
# Sign-up screen: creates the account and signs the player in. The name is optional.await Flock.auth.register_with_email(email, password, display_name).completed# Sign-in screen, on later launches:await Flock.auth.sign_in_with_email(email, password).completed
Player names are unique in a game: Flock.auth.is_name_available(name) checks one before you
register with it. forgot_password(), reset_password(), send_email_verification() and
verify_email() cover account recovery.
Pass the credential your platform sign-in produced to the matching call: Google an ID token
(sign_in_with_google), Apple an identity token (sign_in_with_apple), Steam a session ticket
(sign_in_with_steam). Each has a register_with_* call too. The SDK does not get these credentials
for you, as Godot ships no Google, Apple or Steam sign-in: get them from the platform plugin you
use.
Every sign-in and register call completes with a FlockAuthInfo (the player’s id, how they signed in,
and whether the sign-in was restored). The tokens stay inside the SDK.A player can add more ways to sign in to one account (link_email, link_device, link_oauth), list
them (list_linked_accounts) and remove one (unlink); see Account linking.Keeping the sign-in. The sign-in is saved in an encrypted file under user:// (not the platform’s
secure storage, which Godot has no access to), and Flock.auth.restore_sign_in() picks it up on the
next launch. Untick persist_sign_in to keep the sign-in in memory only, so players sign in on every
launch. A saved sign-in belongs to the API key it was made with: after the key changes, the player
signs in again.Expired tokens are renewed for you, and only the server refusing the sign-in signs the player out: a
lost connection or a server that is restarting never does. Connect to the events to drive your UI:
# Raised for a sign-in, a register that signed the player in, or a restored sign-in.Flock.events.signed_in.connect(func(info: FlockAuthInfo) -> void: print(info.player_id, " signed in (", info.method, ")"))# The saved sign-in can no longer be renewed: show your sign-in screen.Flock.events.sign_in_expired.connect(func() -> void: print("Sign in again"))
FlockClient.Events.SignedIn += info => GD.Print($"{info.PlayerId} signed in ({info.Method})");FlockClient.Events.SignInExpired += () => GD.Print("Sign in again");
Work with your game data
Project → Tools → Flock → Generate content code turns your dashboard’s configs, player templates,
shop items, currencies and achievements into typed classes. It reads the game version set in
flock_config.tres with your API key (no player sign-in) and writes into the config’s Generated
code path, res://flock/generated by default. In a C# project it writes the same classes in C#
(namespace Flock.Generated) beside them; build the project afterwards.
What it writes
For a dashboard item named
Gives you
A class per config
Gameplay
GameplayConfig, a typed member per field, and fetch()
A class per player template
PlayerProgress
PlayerProgressTemplate, a typed member per field, fetch_mine() and save()
FlockShopItemId
a shop item Gem Pack
FlockShopItemId.GEM_PACK (GemPack in C#), the item’s id
FlockCurrencyId
a currency Gold
FlockCurrencyId.GOLD (Gold in C#)
FlockAchievementId
an achievement First Win
FlockAchievementId.FIRST_WIN (FirstWin in C#)
The example below assumes a player template named PlayerProgress (with a level field), a config
named Gameplay (with spawn_rate) and a shop item Gem Pack on your dashboard. They are examples:
create them first (Player Data, Remote Config,
Shops and Inventory), or use your own names.
GDScript
C#
# Player data: null until the player has a row for this template.var progress: FlockResult = await PlayerProgressTemplate.fetch_mine().completedif progress.ok and progress.value != null: var row: PlayerProgressTemplate = progress.value row.level = 5 await row.save().completed # Writes every field back to the row.# Remote config: change values on the dashboard without a new build.var gameplay: FlockResult = await GameplayConfig.fetch().completedif gameplay.ok: var spawn_rate: float = gameplay.value.spawn_rate# Shop: the generated id names the item.var bought: FlockResult = await Flock.shop.purchase(FlockShopItemId.GEM_PACK).completed
using Flock;using Flock.Generated;// Player data: null until the player has a row for this template.var progress = await PlayerProgressTemplate.FetchMineAsync();if (progress.Ok && progress.Value != null){ progress.Value.Level = 5; await progress.Value.SaveAsync(); // Writes every field back to the row.}// Remote config: change values on the dashboard without a new build.var gameplay = await GameplayConfig.FetchAsync();if (gameplay.Ok){ double spawnRate = gameplay.Value.SpawnRate;}// Shop: the generated id names the item.var bought = await FlockClient.Shop.PurchaseAsync(FlockShopItemId.GemPack);
fetch() gives a config’s values with its patch applied. With a player signed in, a gameplay or
feature config comes as the server works it out for that player: its newest patch, then the overrides
of the segments the player is in, then the player’s own. save() writes every field, because the server refuses a write that leaves one out.
These classes do not exist until you generate them. Run Generate content code again whenever
the dashboard changes (a new template, a renamed field, a new shop item); the setup window says how
many files it wrote and removed. It only replaces the files it wrote itself, so a file of your own in
that folder is kept.
Checking in CI
The generated files can fall behind the dashboard. This command, for your build pipeline (CI), tells
you when they have, without opening the editor. Import the project first, as a fresh checkout has no
class list yet:
They do not: generate again (never generated, another game version, the content changed, or a generated file was edited or deleted by hand)
1
It could not tell: no flock_config.tres, no game version set, or the server could not be read
-- --write instead of -- --check generates the files without the editor. Use the same Godot version
you generate with in the editor. A price or a value changed on the dashboard does not count as a
change: no price or value is written into the code.
Explore features
Players & auth
Account linking
Player data
Shops & inventory
Leaderboards
Notifications
Remote config
Assets
Analytics & events
Achievements
Currencies & wallets
Bans
Game patches
Not in the Godot SDK yet: multiplayer, real-money purchases and web checkout, typed tracking-plan calls,
the launch events and standard event parameters, and automatic exception capture. The guides’ Godot
tabs say where each stands.
Advanced settings
The setup window’s Configuration tab holds the settings a project must get right (connection,
HTTP and initialization); its Advanced tab holds the rest: the offline cache, the asset cache,
analytics, the content code folder, the editor checks and debug logs. Each field is a setting on
flock_config.tres, and the inspector edits the same values. The defaults are sensible — change them
only when you need to.
The Advanced tab, top to bottom: Offline Cache, Assets, Analytics, then Content Code, Editor and Diagnostics further down.
Offline cache enabled (on by default) saves game content to disk as it is read, so a game that has
been online once still starts offline, and keeps the player data writes queued while offline across a
relaunch. Money never waits in that queue: a fund grant or a purchase is sent once. Each guide’s
Godot tab says what its feature keeps offline; Player data covers the queue.Two editor checks are on by default. Play mode guard enabled stops a run from the editor that could
not start the SDK (no autoload, no game version, an invalid config) and shows a dialog with a button
that opens the setup window. Fail export if version unresolved checks the game version on export;
see Platform notes.Verbose logging prints the SDK’s diagnostics to the Output panel, never the request and response
bodies, which carry passwords and tokens.For analytics (sessions, events, consent, quit and crash reports), see
Analytics & events.
Platform notes
Exported games are tested on Windows, Linux, Android and the Web, in the standard and .NET builds
(the Web in the standard build only, as Godot has no .NET export for the Web). macOS and iOS are not
tested yet.
Android: nothing to set up. Godot’s Android export leaves the internet permission off, so while
the addon is enabled it turns permissions/internet on for every Android export.
The Web and iOS: there is no device id, so pass your own to the device sign-in calls (see
Your first call).
Every platform: an export whose flock_config.tres has no game version, or another version than
the content code was generated for, ends with an error naming the fix. The export still writes its
files (Godot gives an addon no way to stop it), so read the export’s result, or run the
check in CI.
Error handling
Every failed call answers a FlockResult whose error is a FlockError. describe() gives what
is wrong (the server’s own reason when it gave one), then a Fix: line telling you what to do next.
In C#, Error.ToString() gives the same with the code in front.
var signed_in: FlockResult = await Flock.auth.sign_in_with_device().completedif not signed_in.ok: push_error(signed_in.error.describe())
describe() on a Web export, where Godot has no device id
This platform reports no device id (OS.get_unique_id() is unsupported on web and iOS). Pass a device_id you generate and persist yourself.Fix: Change the argument the message names, then make the call again.
Member
What it holds
message
What is wrong: the server’s own reason when it gave one.
hint()
The fix on its own. Never empty: a code with no advice of its own gets the advice for its kind of failure.
describe()
message, then a Fix: line with hint().
code
The error code as a string ("shop.insufficient_funds").
status
The HTTP status, or 0 when the request never got an answer from the server.
In C# these are Message, Hint, Code and Status.
Branch on the code, never on message text. Codes are a stable contract; wording is not and will
change between versions.
result.error_code() (ErrorCode in C#) is the code, or an empty string on success, so you can compare
it directly:
var bought: FlockResult = await Flock.shop.purchase(FlockShopItemId.GEM_PACK).completedif bought.error_code() == "shop.insufficient_funds": show_not_enough_coins() # Your own UI.
Server codes are named by feature (shop.insufficient_funds, player.invalid_login_credentials). The
SDK’s own codes start with flock., so a log line says which side found the problem:
Code
Meaning
flock.network_unreachable
The request never reached the server.
flock.timeout
No answer came in time. An unreachable server usually shows up this way too.
flock.invalid_response
An answer came but could not be read, or lacked what it should hold.
flock.not_initialized
The SDK could not start, or a generated class was used before it started.
flock.not_signed_in
The call needs a signed-in player, and there is none.
flock.player_already_signed_in
A local player (Flock.add_local_player(), for several players on one machine) tried to sign in as a player already signed in here.
An answer with that HTTP status and no Flock code of its own. Every failure Flock’s game API sends carries a code, so these came from something in between (a proxy, a network login page, an API URL that points at another server), and the fix says so.
flock.unknown
Anything else.
The fix is written for you, not your players — it names SDK calls, settings and dashboard steps.
Show it in your own logs or debug overlay, and write separate copy for your players.
In GDScript, FlockErrorHints.for_code(code) gives a code’s own advice, or an empty string when it
has none.
The full API reference and a guide per feature live in the
SDK README.
Was this page helpful?
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Qwacks","description":"Developer documentation for the Qwacks platform — Flock, Protokite, and Data Duck.","colors":{"primary":"#0099FF","light":"#33ADFF","dark":"#0077CC"},"logo":{"light":"https://mintcdn.com/qwacks/TGGmq_oWzDacAqHl/icons/qwacks.svg?fit=max\u0026auto=format\u0026n=TGGmq_oWzDacAqHl\u0026q=85\u0026s=2023abb340d6ec576975601525ab2ce9","dark":"https://mintcdn.com/qwacks/TGGmq_oWzDacAqHl/icons/qwacks.svg?fit=max\u0026auto=format\u0026n=TGGmq_oWzDacAqHl\u0026q=85\u0026s=2023abb340d6ec576975601525ab2ce9"},"favicon":"https://mintcdn.com/qwacks/TGGmq_oWzDacAqHl/icons/qwacks.svg?fit=max\u0026auto=format\u0026n=TGGmq_oWzDacAqHl\u0026q=85\u0026s=2023abb340d6ec576975601525ab2ce9","appearance":{"default":"dark","strict":true},"background":{"image":{"light":"https://mintcdn.com/qwacks/YCE61raZ52-QoE_F/officalbg.jpg?fit=max\u0026auto=format\u0026n=YCE61raZ52-QoE_F\u0026q=85\u0026s=5be5500ff5788565cf90d6a3e2111d47","dark":"https://mintcdn.com/qwacks/YCE61raZ52-QoE_F/officalbg.jpg?fit=max\u0026auto=format\u0026n=YCE61raZ52-QoE_F\u0026q=85\u0026s=5be5500ff5788565cf90d6a3e2111d47"},"color":{"light":"#FFFFFF","dark":"#181E2E"}},"navbar":{"links":[{"href":"https://www.qwacks.com/pricing","label":"Pricing"},{"href":"https://github.com/QwackStack/FlockUnitySdk/releases","label":"Unity SDK"},{"href":"https://github.com/QwackStack/FlockUnrealSdk/releases","label":"Unreal SDK"},{"href":"https://github.com/QwackStack/FlockGodotSDK/releases","label":"Godot SDK"}],"primary":{"type":"button","label":"Dashboard","href":"https://flock-saas.qwacks.com"}},"fonts":{"heading":{"family":"Readex Pro"},"body":{"family":"Inter"}},"styling":{"latex":false},"navigation":{"languages":[{"language":"en","default":true,"href":"welcome"},{"language":"ar","navbar":{"links":[{"href":"https://www.qwacks.com/pricing","label":"الأسعار"},{"href":"https://github.com/QwackStack/FlockUnitySdk/releases","label":"حزمة Unity"},{"href":"https://github.com/QwackStack/FlockUnrealSdk/releases","label":"حزمة Unreal"},{"href":"https://github.com/QwackStack/FlockGodotSDK/releases","label":"حزمة Godot"}],"primary":{"type":"button","label":"لوحة التحكم","href":"https://flock-saas.qwacks.com"}},"href":"ar/welcome"}]}},"deployment":{"deploymentMetadataValue":{"subdomain":"qwacks","hasAudioNarration":false,"actualSubdomain":"qwacks","customDomains":["docs.qwacks.com"],"gitSource":{"type":"github","owner":"qwackstack","repo":"qwacksdocs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":"","_id":"6b10b3a69ffae5051c3ffc73"},"feedback":{"thumbs":true},"entitlements":{},"buildId":"6b0f533cec7806446d977181","clientVersion":"0.0.4428","searchFilterCounts":[{"language":"ar","tag":"Flock","count":33},{"language":"en","tag":"Flock","count":33},{"language":"ar","tag":"الميزات","count":23},{"language":"en","tag":"Features","count":23},{"language":"ar","tag":"بدء الاستخدام","count":12},{"language":"ar","tag":"Qwacks","count":12},{"language":"en","tag":"Getting Started","count":12},{"language":"en","tag":"Qwacks","count":12},{"language":"ar","tag":"اللعب الجماعي","count":5},{"language":"ar","tag":"Protokite","count":5},{"language":"ar","tag":"المدفوعات والفوترة","count":5},{"language":"en","tag":"Multiplayer","count":5},{"language":"en","tag":"Protokite","count":5},{"language":"en","tag":"Payments \u0026 Billing","count":5},{"language":"ar","tag":"اللاعبون","count":4},{"language":"ar","tag":"الاقتصاد والمدفوعات","count":4},{"language":"en","tag":"Players","count":4},{"language":"en","tag":"Economy and Payments","count":4},{"language":"ar","tag":"المفاهيم","count":3},{"language":"en","tag":"Concepts","count":3}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"auth-vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":true},"customCss":[{"filePath":"style.css","content":".nav-logo{height:2.5rem!important;max-width:none!important}#topbar-cta-button .bg-primary-dark{background-color:#feca13!important}#topbar-cta-button:hover .bg-primary-dark{background-color:#f89c1c!important}#topbar-cta-button a,#topbar-cta-button a *{color:#1a1206!important}.qwacks-lang-toggle{display:inline-flex;align-items:center;align-self:center;gap:0.5rem;padding:0.25rem 1rem;border:1px solid rgba(255, 255, 255, 0.1);border-radius:56px;background:transparent;color:#fafafa;font-family:\"Readex Pro\", sans-serif;font-size:0.875rem;line-height:1.25rem;white-space:nowrap;margin-inline-start:auto;margin-inline-end:1rem}.qwacks-lang-toggle__option{color:inherit;text-decoration:none;font-weight:400;opacity:0.3}.qwacks-lang-toggle__option:hover{opacity:0.7}.qwacks-lang-toggle__option.is-active{font-weight:700;opacity:1}@media (min-width: 1024px){#localization-select-trigger{display:none!important}}:is(h1,h2,h3,h4){position:relative}:is(h1,h2,h3,h4)>div.absolute{left:auto;right:auto;inset-inline-end:0}:is(h1,h2,h3,h4)>div.absolute>a{margin-inline:0!important}"},{"filePath":"rtl.css","content":"html[data-current-path^=\"/ar\"]{direction:rtl}[dir=\"rtl\"]{direction:rtl}html[lang=\"ar\"]{direction:rtl}@media (min-width: 1024px){html[lang=\"ar\"] .lg\\:-ml-12{margin-left:0;margin-right:-3rem}html[lang=\"ar\"] .lg\\:pl-\\[5\\.7rem\\]{padding-left:0.25rem;padding-right:5.7rem}html[lang=\"ar\"] .lg\\:pl-\\[23\\.7rem\\]{padding-left:0.25rem;padding-right:23.7rem}}[dir=\"rtl\"] :is(pre,code,kbd,samp){direction:ltr;text-align:left}[dir=\"rtl\"] :not(pre)>code{unicode-bidi:isolate}[dir=\"rtl\"] pre>*{direction:ltr}[dir=\"rtl\"] .pl-3\\.5{padding-left:0;padding-right:0.875rem}[dir=\"rtl\"] .pl-3{padding-left:0;padding-right:0.75rem}[dir=\"rtl\"] .pl-4{padding-left:0;padding-right:1rem}[dir=\"rtl\"] .pr-3{padding-right:0;padding-left:0.75rem}[dir=\"rtl\"] .pr-4{padding-right:0;padding-left:1rem}[dir=\"rtl\"] .pr-8{padding-right:0;padding-left:2rem}[dir=\"rtl\"] .ml-2{margin-left:0;margin-right:0.5rem}[dir=\"rtl\"] .ml-4{margin-left:0;margin-right:1rem}[dir=\"rtl\"] .-ml-4{margin-left:0;margin-right:-1rem}[dir=\"rtl\"] .-ml-10{margin-left:0;margin-right:-2.5rem}[dir=\"rtl\"] .mr-2{margin-right:0;margin-left:0.5rem}[dir=\"rtl\"] .mr-4{margin-right:0;margin-left:1rem}[dir=\"rtl\"] .text-left{text-align:right}[dir=\"rtl\"] .text-right{text-align:left}[dir=\"rtl\"] .left-0{left:auto;right:0}[dir=\"rtl\"] .right-0{right:auto;left:0}[dir=\"rtl\"] .space-x-2>:not([hidden])~:not([hidden]),[dir=\"rtl\"] .space-x-3>:not([hidden])~:not([hidden]),[dir=\"rtl\"] .space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 1}[dir=\"rtl\"] .border-l{border-left-width:0;border-right-width:1px}[dir=\"rtl\"] .border-r{border-right-width:0;border-left-width:1px}@media (min-width: 1024px){[dir=\"rtl\"] .lg\\:-ml-12{margin-left:0;margin-right:-3rem}}[dir=\"rtl\"] :is(ul,ol){padding-left:0;padding-right:1.5rem}[dir=\"rtl\"] blockquote{border-left:0;border-right:4px solid currentColor;padding-left:0;padding-right:1rem}[dir=\"rtl\"] :is(th,td){text-align:right}[dir=\"rtl\"] .steps{margin-left:0;margin-right:0.875rem}[dir=\"rtl\"] .step>.absolute:not(.w-px){margin-left:0;margin-right:-13px}[dir=\"rtl\"] .step>:not(.absolute){padding-left:1px;padding-right:2rem}[dir=\"rtl\"] #table-of-contents{padding-inline-start:0.75rem;scrollbar-gutter:stable}[dir=\"rtl\"] #sidebar-content a[style*=\"padding-left\"]{padding-left:0!important;padding-right:1rem!important}[dir=\"rtl\"] .card .absolute{right:auto;left:1.25rem}[dir=\"rtl\"] .card .absolute svg{transform:scaleX(-1)}[dir=\"rtl\"] :is(.qwacks-flip-icon,[data-flip-rtl]) svg{transform:scaleX(-1)}[dir=\"rtl\"] #topbar-cta-button svg{transform:scaleX(-1)}[dir=\"rtl\"] .qwacks-lang-toggle svg{transform:none}[dir=\"rtl\"],[dir=\"rtl\"] body{font-family:\"Readex Pro\", system-ui, sans-serif;letter-spacing:normal;line-height:1.85}[dir=\"rtl\"] :is(h1,h2,h3,h4,h5,h6){font-family:\"Readex Pro\", system-ui, sans-serif;letter-spacing:normal;line-height:1.5}[dir=\"rtl\"] :is(pre,code,kbd,samp){font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;line-height:1.6}[dir=\"rtl\"]{font-variant-numeric:lining-nums}"}]}
{"page":{"pagePath":"sdk/godot","slug":"/sdk/godot","pageMetadata":{"title":"Godot SDK","description":"Add Flock to your Godot game with the official addon — from GDScript or C#.","href":"/sdk/godot"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Add Flock to your Godot game with the official addon — from GDScript or C#.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,em:`em`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{Card,CardGroup,CodeBlock,Frame,Heading,Note,OptimizedImage,Step,Steps,Tab,Table,Tabs,Tip,Warning}=_components;if(!Card)_missingMdxReference(`Card`,true);if(!CardGroup)_missingMdxReference(`CardGroup`,true);if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Frame)_missingMdxReference(`Frame`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!OptimizedImage)_missingMdxReference(`OptimizedImage`,true);if(!Step)_missingMdxReference(`Step`,true);if(!Steps)_missingMdxReference(`Steps`,true);if(!Tab)_missingMdxReference(`Tab`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Tabs)_missingMdxReference(`Tabs`,true);if(!Tip)_missingMdxReference(`Tip`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`The Flock Godot SDK connects your game to the Flock backend: player auth, save data, economy,\nremote config, leaderboards, notifications, downloadable assets and analytics — set up from one\nwindow in the editor, with typed GDScript and C# classes generated from your own dashboard content.`}),`\n`,_jsx(Card,{title:`Download the Godot SDK`,icon:`download`,href:`https://github.com/QwackStack/FlockGodotSDK/releases`,children:_jsx(_components.p,{children:`Get the latest addon release from GitHub.`})}),`\n`,_jsx(Heading,{level:`2`,id:`requirements`,children:`Requirements`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Godot `,_jsx(_components.strong,{children:`4.4.1 to 4.7.2`}),`, the standard build, or the `,_jsx(_components.strong,{children:`.NET build`}),` for C#. Every change to the SDK is\ntested on 4.4.1, 4.5.2, 4.6.3 and 4.7.2; Godot 4.3 and older are not supported.`]}),`\n`,_jsx(_components.li,{children:`Nothing else: the addon brings everything it needs, C# included.`}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`setup`,children:`Setup`}),`\n`,_jsxs(Steps,{children:[_jsxs(Step,{title:`Install the addon`,children:[_jsxs(_components.p,{children:[`Download `,_jsx(_components.code,{children:`flock-godot-sdk-v\u003cversion>.zip`}),` from the latest\n`,_jsx(_components.a,{href:`https://github.com/QwackStack/FlockGodotSDK/releases`,children:`release`}),` (not GitHub’s `,_jsx(_components.strong,{children:`Source code`}),` archive)\nand extract it into your project’s folder, so you have `,_jsx(_components.code,{children:`res://addons/flock/`}),`.`]}),_jsxs(_components.p,{children:[`Then turn on `,_jsx(_components.strong,{children:`Flock`}),` under `,_jsx(_components.strong,{children:`Project → Project Settings → Plugins`}),`. That adds a global `,_jsx(_components.code,{children:`Flock`}),`\nobject to your project (an autoload), so there is no node to add to a scene. A C# project needs no\nextra step: your `,_jsx(_components.code,{children:`.csproj`}),` picks up the C# files inside the addon by itself.`]})]}),_jsxs(Step,{title:`Configure`,children:[_jsxs(_components.p,{children:[`Open `,_jsx(_components.strong,{children:`Project → Tools → Flock → Open Flock setup`}),`. On a new project, press `,_jsx(_components.strong,{children:`Create config`}),` on\nits `,_jsx(_components.strong,{children:`Setup`}),` tab: that makes `,_jsx(_components.code,{children:`res://flock_config.tres`}),`, the file the SDK reads its settings from.\nThen fill in the fields from your game’s page on the `,_jsx(_components.a,{href:`https://flock-saas.qwacks.com`,children:`dashboard`}),`:`]}),_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Field`}),_jsx(_components.th,{children:`Value`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`API URL`})}),_jsxs(_components.td,{children:[`Leave the default (`,_jsx(_components.code,{children:`https://api-flock.qwacks.com`}),`) unless told otherwise`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`API key`})}),_jsx(_components.td,{children:`Identifies your game — treat it like a password`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Game`})}),_jsx(_components.td,{children:`Your game’s name, exactly as the dashboard shows it`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Game version`})}),_jsxs(_components.td,{children:[`A version name that exists on the dashboard (e.g. `,_jsx(_components.code,{children:`1.0.0`}),`)`]})]})]})]}),_jsxs(_components.p,{children:[`Every edit is saved into `,_jsx(_components.code,{children:`flock_config.tres`}),` when you leave the field or press Enter. The SDK finds that file when the game\nstarts and initializes itself.`]})]}),_jsxs(Step,{title:`Resolve the game version`,children:[_jsxs(_components.p,{children:[`Press `,_jsx(_components.strong,{children:`Resolve version`}),`. The version name is looked up and its `,_jsxs(_components.strong,{children:[`id is written into\n`,_jsx(_components.code,{children:`flock_config.tres`})]}),`, so the game never has to ask the server for it, and a game started offline\nstill gets a working SDK. The SDK will not start without this id.`]}),_jsxs(_components.p,{children:[`The same press checks that the `,_jsx(_components.strong,{children:`Game`}),` name matches the game your API key belongs to, and writes\nnothing when it does not, so a key from the wrong game is caught here.`]}),_jsxs(_components.p,{children:[`The window’s checklist shows what is still missing. `,_jsx(_components.strong,{children:`Test connection`}),` (also under\n`,_jsx(_components.strong,{children:`Project → Tools → Flock`}),`) checks the API URL and key (and the `,_jsx(_components.strong,{children:`Game`}),` name, when you typed one), before you know a version\nname.`]}),_jsx(Frame,{caption:`The Setup tab: the credentials with the version resolved, the Create config, Resolve version and Test connection buttons, and the checklist.`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/qwacks/OzMDMSJYBiNDPtqZ/images/godot/setup-setup.png?fit=max\u0026auto=format\u0026n=OzMDMSJYBiNDPtqZ\u0026q=85\u0026s=999337f84d89ef08ee1e4717bc3de175`,alt:`Flock setup window, Setup tab, with the credentials filled in and the checklist`,\"data-og-width\":`760`,width:`760`,\"data-og-height\":`930`,height:`930`,\"data-path\":`images/godot/setup-setup.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/qwacks/OzMDMSJYBiNDPtqZ/images/godot/setup-setup.png?w=280\u0026fit=max\u0026auto=format\u0026n=OzMDMSJYBiNDPtqZ\u0026q=85\u0026s=fa5ad4c3609d3ff9d8d97080bb3cca91 280w, https://mintcdn.com/qwacks/OzMDMSJYBiNDPtqZ/images/godot/setup-setup.png?w=560\u0026fit=max\u0026auto=format\u0026n=OzMDMSJYBiNDPtqZ\u0026q=85\u0026s=356c31aeacff066b470f5c19e5ce03cc 560w, https://mintcdn.com/qwacks/OzMDMSJYBiNDPtqZ/images/godot/setup-setup.png?w=840\u0026fit=max\u0026auto=format\u0026n=OzMDMSJYBiNDPtqZ\u0026q=85\u0026s=950a497b1c9dfeb05ff3a5a3ca784981 840w, https://mintcdn.com/qwacks/OzMDMSJYBiNDPtqZ/images/godot/setup-setup.png?w=1100\u0026fit=max\u0026auto=format\u0026n=OzMDMSJYBiNDPtqZ\u0026q=85\u0026s=62b5b148b2a3522bd90d3058c61e3111 1100w, https://mintcdn.com/qwacks/OzMDMSJYBiNDPtqZ/images/godot/setup-setup.png?w=1650\u0026fit=max\u0026auto=format\u0026n=OzMDMSJYBiNDPtqZ\u0026q=85\u0026s=087f487483d4c435148eb3474c5468fc 1650w, https://mintcdn.com/qwacks/OzMDMSJYBiNDPtqZ/images/godot/setup-setup.png?w=2500\u0026fit=max\u0026auto=format\u0026n=OzMDMSJYBiNDPtqZ\u0026q=85\u0026s=8b8515e3c88f3cb2ee52cb1e2b7d6b40 2500w`})})]})]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`The API key ships inside your exported game: `,_jsx(_components.code,{children:`flock_config.tres`}),` is part of it and can be read.\nUse a key for the right environment, and rotate it on the dashboard if it leaks.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`your-first-call`,children:`Your first call`}),`\n`,_jsxs(_components.p,{children:[`With `,_jsx(_components.code,{children:`flock_config.tres`}),` in place, the SDK starts by itself when the game starts. Add this script to a\nnode in your first scene: once the SDK has started, it picks up the player’s saved sign-in, and signs\nthe player in with this device only when there was none.`]}),`\n`,_jsxs(Tabs,{children:[_jsx(Tab,{title:`GDScript`,id:`gdscript`,children:_jsx(CodeBlock,{filename:``,numberOfLines:`22`,language:`gdscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`gdscript`,children:_jsxs(_components.code,{language:`gdscript`,numberOfLines:`22`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`extends`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` Node`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`func`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` _ready`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`() `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` void`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` Flock`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`events`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`when_initialized`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`_on_flock_ready`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`func`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` _on_flock_ready`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`() `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` void`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # Pick up the sign-in saved on an earlier launch. value is false when there was none.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` var`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` restored`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`FlockResult`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` Flock`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`auth`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`restore_sign_in`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`().`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`completed`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` not`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` restored`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`value`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` var`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` signed_in`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`FlockResult`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` Flock`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`auth`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`sign_in_with_device`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`().`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`completed`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` signed_in`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`error_code`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`() `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`==`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"player.invalid_login_credentials\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # The first launch on this device: registering creates the player and signs them in.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` signed_in`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` Flock`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`auth`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`register_with_device`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`().`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`completed`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` not`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` signed_in`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`ok`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` push_error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`signed_in`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`describe`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()) `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# What is wrong, then a Fix: line.`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` var`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` game`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`FlockResult`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` Flock`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`game`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`get_game`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`().`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`completed`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` game`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`ok`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Signed in as \"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`Flock`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`auth`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`player_id`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(), `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\", playing \"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`game`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`value`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`name`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` else`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` push_error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`game`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`describe`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`())`})]}),`\n`]})})})}),_jsx(Tab,{title:`C#`,id:`c%23`,children:_jsx(CodeBlock,{filename:``,numberOfLines:`36`,language:`csharp`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`csharp`,children:_jsxs(_components.code,{language:`csharp`,numberOfLines:`36`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`using`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Flock;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`using`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Godot;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`public`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` partial `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`class`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` FlockFirstCall : Node`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` public`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` override`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` void`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` _Ready()`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` FlockClient.Events.WhenInitialized(OnFlockReady);`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` private`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` async`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` void`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` OnFlockReady()`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Pick up the sign-in saved on an earlier launch. Value is false when there was none.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` var`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` restored = `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` FlockClient.Auth.RestoreSignInAsync();`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (!restored.Value)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` var`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` signedIn = `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` FlockClient.Auth.SignInWithDeviceAsync();`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (signedIn.ErrorCode == `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"player.invalid_login_credentials\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // The first launch on this device: registering creates the player and signs them in.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` signedIn = `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` FlockClient.Auth.RegisterWithDeviceAsync();`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (!signedIn.Ok)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` GD.PushError(signedIn.Error.ToString()); `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// What is wrong, then a Fix: line.`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` var`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` game = `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` FlockClient.Game.GetGameAsync();`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (game.Ok)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` GD.Print($`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Signed in as {FlockClient.Auth.PlayerId}, playing {game.Value.Name}\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` else`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` GD.PushError(game.Error.ToString());`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})})})]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Success`}),` is `,_jsx(_components.code,{children:`Signed in as`}),` and the player’s id in the Output panel.`]}),`\n`,_jsxs(_components.p,{children:[`With no id passed, the device calls use the id Godot gives for this device (`,_jsx(_components.code,{children:`OS.get_unique_id()`}),`).\nGodot has none on the Web and on iOS, so there the calls fail with `,_jsx(_components.code,{children:`flock.invalid_argument`}),` and send\nnothing: make an id yourself, save it in the game’s files, and pass it to `,_jsx(_components.code,{children:`sign_in_with_device(id)`}),` and\n`,_jsx(_components.code,{children:`register_with_device(id)`}),`. Two copies of the game on one computer have the same device id, and so are\none player: pass a different id in one of them. A new device means a new player, so offer\n`,_jsx(_components.a,{href:`/guides/account-linking`,children:`account linking`}),` (an email or a platform account) to players who want to get\nback in on another device.`]}),`\n`,_jsx(Heading,{level:`2`,id:`initialization`,children:`Initialization`}),`\n`,_jsxs(_components.p,{children:[`The SDK can start two ways. `,_jsx(_components.strong,{children:`Automatic`}),` is the default and fits most games; `,_jsx(_components.strong,{children:`manual`}),` gives you\ncontrol over `,_jsx(_components.em,{children:`when`}),` it starts (after a splash screen, or once a player has answered a consent\nquestion).`]}),`\n`,_jsxs(Tabs,{children:[_jsxs(Tab,{title:`Automatic (default)`,id:`automatic-default`,children:[_jsxs(_components.p,{children:[`Nothing to call: when the game starts, the `,_jsx(_components.code,{children:`Flock`}),` autoload reads `,_jsx(_components.code,{children:`res://flock_config.tres`}),` and\ninitializes from it. The SDK sends its signals on the next frame, so a handler connected in\n`,_jsx(_components.code,{children:`_ready()`}),` still gets what the SDK announced while it started. `,_jsx(_components.code,{children:`Flock.events.when_initialized()`}),`\nruns its callable even when the SDK started before it was called, which a plain `,_jsx(_components.code,{children:`connect()`}),` cannot.`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`gdscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`gdscript`,children:_jsxs(_components.code,{language:`gdscript`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`func`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` _ready`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`() `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` void`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` Flock`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`events`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`when_initialized`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`_on_flock_ready`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` Flock`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`events`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`signed_in`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`connect`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`_on_signed_in`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` Flock`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`events`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`sign_in_expired`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`connect`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`_on_sign_in_expired`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`]})})}),_jsxs(_components.p,{children:[`Restoring a saved sign-in is yours to start: call `,_jsx(_components.code,{children:`Flock.auth.restore_sign_in()`}),`, as\n`,_jsx(_components.a,{href:`#your-first-call`,children:`Your first call`}),` does.`]})]}),_jsxs(Tab,{title:`Manual`,id:`manual`,children:[_jsxs(_components.p,{children:[`Untick `,_jsx(_components.strong,{children:`Auto initialize`}),` on the setup window’s `,_jsx(_components.strong,{children:`Configuration`}),` tab (`,_jsx(_components.code,{children:`auto_initialize`}),` on\n`,_jsx(_components.code,{children:`flock_config.tres`}),`), then start the SDK yourself. `,_jsx(_components.code,{children:`initialize()`}),` returns straight away.`]}),_jsx(Frame,{caption:`The Configuration tab: Connection, HTTP, and Initialization with Persist sign in and Auto initialize.`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/qwacks/OzMDMSJYBiNDPtqZ/images/godot/setup-configuration.png?fit=max\u0026auto=format\u0026n=OzMDMSJYBiNDPtqZ\u0026q=85\u0026s=e7ec5c2a840db6489114b51044f44a80`,alt:`Flock setup window, Configuration tab`,\"data-og-width\":`760`,width:`760`,\"data-og-height\":`815`,height:`815`,\"data-path\":`images/godot/setup-configuration.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/qwacks/OzMDMSJYBiNDPtqZ/images/godot/setup-configuration.png?w=280\u0026fit=max\u0026auto=format\u0026n=OzMDMSJYBiNDPtqZ\u0026q=85\u0026s=c89121b815a5192190910960030b98a3 280w, https://mintcdn.com/qwacks/OzMDMSJYBiNDPtqZ/images/godot/setup-configuration.png?w=560\u0026fit=max\u0026auto=format\u0026n=OzMDMSJYBiNDPtqZ\u0026q=85\u0026s=a957ed4de5a62eef2a44bc3be4a9ddb4 560w, https://mintcdn.com/qwacks/OzMDMSJYBiNDPtqZ/images/godot/setup-configuration.png?w=840\u0026fit=max\u0026auto=format\u0026n=OzMDMSJYBiNDPtqZ\u0026q=85\u0026s=471bebf194a682cdff4f77c90fa8ac43 840w, https://mintcdn.com/qwacks/OzMDMSJYBiNDPtqZ/images/godot/setup-configuration.png?w=1100\u0026fit=max\u0026auto=format\u0026n=OzMDMSJYBiNDPtqZ\u0026q=85\u0026s=e799c26083622b13658a5725e684e792 1100w, https://mintcdn.com/qwacks/OzMDMSJYBiNDPtqZ/images/godot/setup-configuration.png?w=1650\u0026fit=max\u0026auto=format\u0026n=OzMDMSJYBiNDPtqZ\u0026q=85\u0026s=0309da0d667a3548e6eb04da5ac118a8 1650w, https://mintcdn.com/qwacks/OzMDMSJYBiNDPtqZ/images/godot/setup-configuration.png?w=2500\u0026fit=max\u0026auto=format\u0026n=OzMDMSJYBiNDPtqZ\u0026q=85\u0026s=dd08f4913bacc0bc81871bb7bc84980e 2500w`})}),_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`gdscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`gdscript`,children:_jsxs(_components.code,{language:`gdscript`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`var`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` config`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`FlockConfig`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` load`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"res://flock_config.tres\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`var`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` started`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`FlockResult`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` Flock`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`initialize`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`config`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`if`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` not`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` started`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`ok`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` push_error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`started`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`describe`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`())`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`csharp`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`csharp`,children:_jsxs(_components.code,{language:`csharp`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`FlockResult started = FlockClient.Initialize(); `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// reads res://flock_config.tres`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (!started.Ok)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` GD.PushError(started.Error.ToString());`})}),`\n`]})})})]})]}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[`A config the SDK cannot start from (no API URL or key, no game version id) fails `,_jsx(_components.code,{children:`initialize()`}),` with\n`,_jsx(_components.code,{children:`flock.not_initialized`}),` and a message naming what is missing, and the automatic start raises\n`,_jsx(_components.code,{children:`Flock.events.initialization_failed`}),`. Until the SDK has started, its services do not exist: in GDScript\n`,_jsx(_components.code,{children:`Flock.auth`}),` and the others are `,_jsx(_components.code,{children:`null`}),`, and in C# `,_jsx(_components.code,{children:`FlockClient.Auth`}),` and the others throw an\n`,_jsx(_components.code,{children:`InvalidOperationException`}),` saying to initialize first. Check `,_jsx(_components.code,{children:`Flock.is_initialized()`}),`\n(`,_jsx(_components.code,{children:`FlockClient.IsInitialized`}),` in C#), or wait for `,_jsx(_components.code,{children:`when_initialized()`}),` as above.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`gdscript-and-c#`,children:`GDScript and C#`}),`\n`,_jsxs(_components.p,{children:[`The SDK is `,_jsx(_components.strong,{children:`one client with two ways in`}),`. Its core is GDScript, reached through the `,_jsx(_components.code,{children:`Flock`}),`\nautoload; C# gets a typed layer, `,_jsx(_components.code,{children:`FlockClient`}),`, generated from that core and shipped inside the addon.\nBoth use the same client, so a player signed in from GDScript is signed in for C#, and the other way\nround.`]}),`\n`,_jsxs(_components.p,{children:[`Every call that reaches the server returns a `,_jsx(_components.strong,{children:_jsx(_components.code,{children:`FlockRequest`})}),` in GDScript: await its `,_jsx(_components.code,{children:`completed`}),`\nsignal (not the method), or connect to it. The answer is a `,_jsx(_components.strong,{children:_jsx(_components.code,{children:`FlockResult`})}),` with `,_jsx(_components.code,{children:`ok`}),`, `,_jsx(_components.code,{children:`value`}),` and\n`,_jsx(_components.code,{children:`error`}),`. In C# the same call is an `,_jsx(_components.code,{children:`…Async`}),` method that returns a `,_jsx(_components.code,{children:`FlockResult\u003cT>`}),` with `,_jsx(_components.code,{children:`Ok`}),`, `,_jsx(_components.code,{children:`Value`}),`\nand `,_jsx(_components.code,{children:`Error`}),`, and takes an optional `,_jsx(_components.code,{children:`CancellationToken`}),`.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`gdscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`gdscript`,children:_jsxs(_components.code,{language:`gdscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`var`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` result`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`FlockResult`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` Flock`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`auth`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`sign_in_with_email`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`email`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`password`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`).`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`completed`})]}),`\n`]})})}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`csharp`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`csharp`,children:_jsxs(_components.code,{language:`csharp`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`var`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` result = `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` FlockClient.Auth.SignInWithEmailAsync(email, password);`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Once the SDK has started, calls do not throw.`}),` A failed call is a result whose `,_jsx(_components.code,{children:`ok`}),` is false, in both\nlanguages, so a project that uses both handles a failure the same way on each side. Check `,_jsx(_components.code,{children:`ok`}),`: a\nsuccessful call can still answer `,_jsx(_components.code,{children:`null`}),` (a player with no saved data yet, for example).`]}),`\n`,_jsx(_components.p,{children:`Names map one to one, so a GDScript name tells you the C# one:`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`GDScript`}),_jsx(_components.th,{children:`C#`}),_jsx(_components.th,{children:`Example`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`A call that reaches the server`}),_jsxs(_components.td,{children:[`PascalCase + `,_jsx(_components.code,{children:`Async`})]}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`get_standings`}),` → `,_jsx(_components.code,{children:`GetStandingsAsync`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`A property`}),_jsx(_components.td,{children:`PascalCase`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`player_name`}),` → `,_jsx(_components.code,{children:`PlayerName`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`A check with no arguments`}),_jsx(_components.td,{children:`A property`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`is_signed_in()`}),` → `,_jsx(_components.code,{children:`IsSignedIn`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`A constant`}),_jsx(_components.td,{children:`Spelled the same`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`STATUS_UNUSED`}),` → `,_jsx(_components.code,{children:`STATUS_UNUSED`})]})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`int`}),`, `,_jsx(_components.code,{children:`float`})]}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`long`}),`, `,_jsx(_components.code,{children:`double`})]}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`size_bytes`}),` → `,_jsx(_components.code,{children:`long SizeBytes`})]})]})]})]}),`\n`,_jsxs(_components.p,{children:[`C# code needs `,_jsx(_components.code,{children:`using Flock;`}),`, and `,_jsx(_components.code,{children:`using Flock.Generated;`}),` for the classes made from your dashboard\ncontent (`,_jsx(_components.a,{href:`#work-with-your-game-data`,children:`Work with your game data`}),`). A project without the .NET build\nignores the C# files in the addon.`]}),`\n`,_jsx(Heading,{level:`2`,id:`authenticate-a-player`,children:`Authenticate a player`}),`\n`,_jsxs(_components.p,{children:[`Signing in does not create an account: registering is a separate `,_jsx(_components.code,{children:`register_with_*`}),` call, and a\nregister that creates the account also signs the player in.`]}),`\n`,_jsxs(Tabs,{children:[_jsxs(Tab,{title:`Device`,id:`device`,children:[_jsxs(_components.p,{children:[`Sign in, and register on the first launch, as `,_jsx(_components.a,{href:`#your-first-call`,children:`Your first call`}),` shows.`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`gdscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`gdscript`,children:_jsxs(_components.code,{language:`gdscript`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`var`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` signed_in`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`FlockResult`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` Flock`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`auth`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`sign_in_with_device`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`().`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`completed`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` signed_in`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`error_code`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`() `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`==`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"player.invalid_login_credentials\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` signed_in`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` Flock`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`auth`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`register_with_device`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`().`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`completed`})]}),`\n`]})})})]}),_jsxs(Tab,{title:`Email`,id:`email`,children:[_jsxs(_components.p,{children:[_jsx(_components.code,{children:`email`}),` and `,_jsx(_components.code,{children:`password`}),` come from your own sign-in and sign-up screens.`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`5`,language:`gdscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`gdscript`,children:_jsxs(_components.code,{language:`gdscript`,numberOfLines:`5`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Sign-up screen: creates the account and signs the player in. The name is optional.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` Flock`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`auth`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`register_with_email`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`email`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`password`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`display_name`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`).`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`completed`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Sign-in screen, on later launches:`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` Flock`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`auth`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`sign_in_with_email`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`email`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`password`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`).`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`completed`})]}),`\n`]})})}),_jsxs(_components.p,{children:[`Player names are unique in a game: `,_jsx(_components.code,{children:`Flock.auth.is_name_available(name)`}),` checks one before you\nregister with it. `,_jsx(_components.code,{children:`forgot_password()`}),`, `,_jsx(_components.code,{children:`reset_password()`}),`, `,_jsx(_components.code,{children:`send_email_verification()`}),` and\n`,_jsx(_components.code,{children:`verify_email()`}),` cover account recovery.`]})]}),_jsx(Tab,{title:`Google / Apple / Steam`,id:`google-%2F-apple-%2F-steam`,children:_jsxs(_components.p,{children:[`Pass the credential your platform sign-in produced to the matching call: Google an `,_jsx(_components.strong,{children:`ID token`}),`\n(`,_jsx(_components.code,{children:`sign_in_with_google`}),`), Apple an `,_jsx(_components.strong,{children:`identity token`}),` (`,_jsx(_components.code,{children:`sign_in_with_apple`}),`), Steam a `,_jsx(_components.strong,{children:`session ticket`}),`\n(`,_jsx(_components.code,{children:`sign_in_with_steam`}),`). Each has a `,_jsx(_components.code,{children:`register_with_*`}),` call too. The SDK does not get these credentials\nfor you, as Godot ships no Google, Apple or Steam sign-in: get them from the platform plugin you\nuse.`]})})]}),`\n`,_jsxs(_components.p,{children:[`Every sign-in and register call completes with a `,_jsx(_components.code,{children:`FlockAuthInfo`}),` (the player’s id, how they signed in,\nand whether the sign-in was restored). The tokens stay inside the SDK.`]}),`\n`,_jsxs(_components.p,{children:[`A player can add more ways to sign in to one account (`,_jsx(_components.code,{children:`link_email`}),`, `,_jsx(_components.code,{children:`link_device`}),`, `,_jsx(_components.code,{children:`link_oauth`}),`), list\nthem (`,_jsx(_components.code,{children:`list_linked_accounts`}),`) and remove one (`,_jsx(_components.code,{children:`unlink`}),`); see `,_jsx(_components.a,{href:`/guides/account-linking`,children:`Account linking`}),`.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Keeping the sign-in.`}),` The sign-in is saved in an encrypted file under `,_jsx(_components.code,{children:`user://`}),` (not the platform’s\nsecure storage, which Godot has no access to), and `,_jsx(_components.code,{children:`Flock.auth.restore_sign_in()`}),` picks it up on the\nnext launch. Untick `,_jsx(_components.code,{children:`persist_sign_in`}),` to keep the sign-in in memory only, so players sign in on every\nlaunch. A saved sign-in belongs to the API key it was made with: after the key changes, the player\nsigns in again.`]}),`\n`,_jsx(_components.p,{children:`Expired tokens are renewed for you, and only the server refusing the sign-in signs the player out: a\nlost connection or a server that is restarting never does. Connect to the events to drive your UI:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`5`,language:`gdscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`gdscript`,children:_jsxs(_components.code,{language:`gdscript`,numberOfLines:`5`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Raised for a sign-in, a register that signed the player in, or a restored sign-in.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`Flock`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`events`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`signed_in`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`connect`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`func`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`info`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`FlockAuthInfo`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` void`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`info`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`player_id`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\" signed in (\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`info`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`method`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\")\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`))`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# The saved sign-in can no longer be renewed: show your sign-in screen.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`Flock`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`events`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`sign_in_expired`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`connect`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`func`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`() `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` void`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Sign in again\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`))`})]}),`\n`]})})}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`csharp`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`csharp`,children:_jsxs(_components.code,{language:`csharp`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`FlockClient.Events.SignedIn += info => GD.Print($`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"{info.PlayerId} signed in ({info.Method})\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`FlockClient.Events.SignInExpired += () => GD.Print(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Sign in again\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`work-with-your-game-data`,children:`Work with your game data`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Project → Tools → Flock → Generate content code`}),` turns your dashboard’s configs, player templates,\nshop items, currencies and achievements into typed classes. It reads the game version set in\n`,_jsx(_components.code,{children:`flock_config.tres`}),` with your API key (no player sign-in) and writes into the config’s `,_jsx(_components.strong,{children:`Generated\ncode path`}),`, `,_jsx(_components.code,{children:`res://flock/generated`}),` by default. In a C# project it writes the same classes in C#\n(namespace `,_jsx(_components.code,{children:`Flock.Generated`}),`) beside them; build the project afterwards.`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`What it writes`}),_jsx(_components.th,{children:`For a dashboard item named`}),_jsx(_components.th,{children:`Gives you`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`A class per config`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`Gameplay`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`GameplayConfig`}),`, a typed member per field, and `,_jsx(_components.code,{children:`fetch()`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`A class per player template`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`PlayerProgress`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`PlayerProgressTemplate`}),`, a typed member per field, `,_jsx(_components.code,{children:`fetch_mine()`}),` and `,_jsx(_components.code,{children:`save()`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`FlockShopItemId`})}),_jsxs(_components.td,{children:[`a shop item `,_jsx(_components.code,{children:`Gem Pack`})]}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`FlockShopItemId.GEM_PACK`}),` (`,_jsx(_components.code,{children:`GemPack`}),` in C#), the item’s id`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`FlockCurrencyId`})}),_jsxs(_components.td,{children:[`a currency `,_jsx(_components.code,{children:`Gold`})]}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`FlockCurrencyId.GOLD`}),` (`,_jsx(_components.code,{children:`Gold`}),` in C#)`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`FlockAchievementId`})}),_jsxs(_components.td,{children:[`an achievement `,_jsx(_components.code,{children:`First Win`})]}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`FlockAchievementId.FIRST_WIN`}),` (`,_jsx(_components.code,{children:`FirstWin`}),` in C#)`]})]})]})]}),`\n`,_jsxs(_components.p,{children:[`The example below assumes a player template named `,_jsx(_components.code,{children:`PlayerProgress`}),` (with a `,_jsx(_components.code,{children:`level`}),` field), a config\nnamed `,_jsx(_components.code,{children:`Gameplay`}),` (with `,_jsx(_components.code,{children:`spawn_rate`}),`) and a shop item `,_jsx(_components.code,{children:`Gem Pack`}),` on your dashboard. They are examples:\ncreate them first (`,_jsx(_components.a,{href:`/guides/player-data`,children:`Player Data`}),`, `,_jsx(_components.a,{href:`/guides/remote-config`,children:`Remote Config`}),`,\n`,_jsx(_components.a,{href:`/guides/shops-and-inventory`,children:`Shops and Inventory`}),`), or use your own names.`]}),`\n`,_jsxs(Tabs,{children:[_jsx(Tab,{title:`GDScript`,id:`gdscript-2`,children:_jsx(CodeBlock,{filename:``,numberOfLines:`14`,language:`gdscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`gdscript`,children:_jsxs(_components.code,{language:`gdscript`,numberOfLines:`14`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Player data: null until the player has a row for this template.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`var`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` progress`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`FlockResult`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` PlayerProgressTemplate`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`fetch_mine`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`().`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`completed`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` progress`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`ok`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` and`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` progress`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`value`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` !=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` null`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` var`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` row`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`PlayerProgressTemplate`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` progress`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`value`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` row`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`level`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 5`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` row`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`save`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`().`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`completed`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # Writes every field back to the row.`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Remote config: change values on the dashboard without a new build.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`var`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` gameplay`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`FlockResult`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` GameplayConfig`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`fetch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`().`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`completed`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` gameplay`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`ok`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` var`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` spawn_rate`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`float`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` gameplay`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`value`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`spawn_rate`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Shop: the generated id names the item.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`var`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` bought`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`FlockResult`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` Flock`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`shop`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`purchase`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`FlockShopItemId`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`GEM_PACK`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`).`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`completed`})]}),`\n`]})})})}),_jsx(Tab,{title:`C#`,id:`c%23-2`,children:_jsx(CodeBlock,{filename:``,numberOfLines:`20`,language:`csharp`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`csharp`,children:_jsxs(_components.code,{language:`csharp`,numberOfLines:`20`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`using`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Flock;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`using`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Flock.Generated;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Player data: null until the player has a row for this template.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`var`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` progress = `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` PlayerProgressTemplate.FetchMineAsync();`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (progress.Ok \u0026\u0026 progress.Value != `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`null`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` progress.Value.Level = 5;`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` progress.Value.SaveAsync(); `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Writes every field back to the row.`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Remote config: change values on the dashboard without a new build.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`var`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` gameplay = `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` GameplayConfig.FetchAsync();`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (gameplay.Ok)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` double`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` spawnRate = gameplay.Value.SpawnRate;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Shop: the generated id names the item.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`var`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` bought = `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` FlockClient.Shop.PurchaseAsync(FlockShopItemId.GemPack);`})]}),`\n`]})})})})]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`fetch()`}),` gives a config’s values with its patch applied. With a player signed in, a gameplay or\nfeature config comes as the server works it out for that player: its newest patch, then the overrides\nof the segments the player is in, then the player’s own. `,_jsx(_components.code,{children:`save()`}),` writes `,_jsx(_components.strong,{children:`every`}),` field, because the server refuses a write that leaves one out.`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`These classes do not exist until you generate them.`}),` Run `,_jsx(_components.strong,{children:`Generate content code`}),` again whenever\nthe dashboard changes (a new template, a renamed field, a new shop item); the setup window says how\nmany files it wrote and removed. It only replaces the files it wrote itself, so a file of your own in\nthat folder is kept.`]})}),`\n`,_jsx(Heading,{level:`3`,id:`checking-in-ci`,children:`Checking in CI`}),`\n`,_jsx(_components.p,{children:`The generated files can fall behind the dashboard. This command, for your build pipeline (CI), tells\nyou when they have, without opening the editor. Import the project first, as a fresh checkout has no\nclass list yet:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`godot --headless --path . --import`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`godot --headless --path . --script res://addons/flock/editor/content_code.gd -- --check`})}),`\n`]})})}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Exit`}),_jsx(_components.th,{children:`Meaning`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`0`})}),_jsx(_components.td,{children:`The generated files match the dashboard`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`2`})}),_jsx(_components.td,{children:`They do not: generate again (never generated, another game version, the content changed, or a generated file was edited or deleted by hand)`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`1`})}),_jsxs(_components.td,{children:[`It could not tell: no `,_jsx(_components.code,{children:`flock_config.tres`}),`, no game version set, or the server could not be read`]})]})]})]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`-- --write`}),` instead of `,_jsx(_components.code,{children:`-- --check`}),` generates the files without the editor. Use the same Godot version\nyou generate with in the editor. A price or a value changed on the dashboard does not count as a\nchange: no price or value is written into the code.`]}),`\n`,_jsx(Heading,{level:`2`,id:`explore-features`,children:`Explore features`}),`\n`,_jsxs(CardGroup,{cols:2,children:[_jsx(Card,{title:`Players \u0026 auth`,icon:`user`,href:`/guides/players-and-auth`}),_jsx(Card,{title:`Account linking`,icon:`link`,href:`/guides/account-linking`}),_jsx(Card,{title:`Player data`,icon:`database`,href:`/guides/player-data`}),_jsx(Card,{title:`Shops \u0026 inventory`,icon:`cart-shopping`,href:`/guides/shops-and-inventory`}),_jsx(Card,{title:`Leaderboards`,icon:`ranking-star`,href:`/guides/leaderboards`}),_jsx(Card,{title:`Notifications`,icon:`bell`,href:`/guides/notifications`}),_jsx(Card,{title:`Remote config`,icon:`sliders`,href:`/guides/remote-config`}),_jsx(Card,{title:`Assets`,icon:`box-archive`,href:`/guides/assets`}),_jsx(Card,{title:`Analytics \u0026 events`,icon:`chart-line`,href:`/guides/analytics-and-events`}),_jsx(Card,{title:`Achievements`,icon:`trophy`,href:`/guides/achievements`}),_jsx(Card,{title:`Currencies \u0026 wallets`,icon:`coins`,href:`/guides/currencies-and-wallets`}),_jsx(Card,{title:`Bans`,icon:`ban`,href:`/guides/bans`}),_jsx(Card,{title:`Game patches`,icon:`code-branch`,href:`/guides/game-patches`})]}),`\n`,_jsx(Note,{children:_jsx(_components.p,{children:`Not in the Godot SDK yet: multiplayer, real-money purchases and web checkout, typed tracking-plan calls,\nthe launch events and standard event parameters, and automatic exception capture. The guides’ Godot\ntabs say where each stands.`})}),`\n`,_jsx(Heading,{level:`2`,id:`advanced-settings`,children:`Advanced settings`}),`\n`,_jsxs(_components.p,{children:[`The setup window’s `,_jsx(_components.strong,{children:`Configuration`}),` tab holds the settings a project must get right (connection,\nHTTP and initialization); its `,_jsx(_components.strong,{children:`Advanced`}),` tab holds the rest: the offline cache, the asset cache,\nanalytics, the content code folder, the editor checks and debug logs. Each field is a setting on\n`,_jsx(_components.code,{children:`flock_config.tres`}),`, and the inspector edits the same values. The defaults are sensible — change them\nonly when you need to.`]}),`\n`,_jsx(Frame,{caption:`The Advanced tab, top to bottom: Offline Cache, Assets, Analytics, then Content Code, Editor and Diagnostics further down.`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/qwacks/OzMDMSJYBiNDPtqZ/images/godot/setup-advanced.png?fit=max\u0026auto=format\u0026n=OzMDMSJYBiNDPtqZ\u0026q=85\u0026s=948b32241151d45b40687b54436c7707`,alt:`Flock setup window, Advanced tab`,\"data-og-width\":`760`,width:`760`,\"data-og-height\":`985`,height:`985`,\"data-path\":`images/godot/setup-advanced.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/qwacks/OzMDMSJYBiNDPtqZ/images/godot/setup-advanced.png?w=280\u0026fit=max\u0026auto=format\u0026n=OzMDMSJYBiNDPtqZ\u0026q=85\u0026s=e7ff1566cad9fc663c5bf67f29746521 280w, https://mintcdn.com/qwacks/OzMDMSJYBiNDPtqZ/images/godot/setup-advanced.png?w=560\u0026fit=max\u0026auto=format\u0026n=OzMDMSJYBiNDPtqZ\u0026q=85\u0026s=5679072310ef36ba36610a5dc40f584c 560w, https://mintcdn.com/qwacks/OzMDMSJYBiNDPtqZ/images/godot/setup-advanced.png?w=840\u0026fit=max\u0026auto=format\u0026n=OzMDMSJYBiNDPtqZ\u0026q=85\u0026s=db10289c9c2708dce34dcad3360a309e 840w, https://mintcdn.com/qwacks/OzMDMSJYBiNDPtqZ/images/godot/setup-advanced.png?w=1100\u0026fit=max\u0026auto=format\u0026n=OzMDMSJYBiNDPtqZ\u0026q=85\u0026s=d3d83f07c3cbad71c14fdc65f4de4fb9 1100w, https://mintcdn.com/qwacks/OzMDMSJYBiNDPtqZ/images/godot/setup-advanced.png?w=1650\u0026fit=max\u0026auto=format\u0026n=OzMDMSJYBiNDPtqZ\u0026q=85\u0026s=9f13e3586881e97f081161a8a7ebcbbb 1650w, https://mintcdn.com/qwacks/OzMDMSJYBiNDPtqZ/images/godot/setup-advanced.png?w=2500\u0026fit=max\u0026auto=format\u0026n=OzMDMSJYBiNDPtqZ\u0026q=85\u0026s=db284584d25d48baec9283eb95a9cdc1 2500w`})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Offline cache enabled`}),` (on by default) saves game content to disk as it is read, so a game that has\nbeen online once still starts offline, and keeps the player data writes queued while offline across a\nrelaunch. Money never waits in that queue: a fund grant or a purchase is sent once. Each guide’s\nGodot tab says what its feature keeps offline; `,_jsx(_components.a,{href:`/guides/player-data`,children:`Player data`}),` covers the queue.`]}),`\n`,_jsxs(_components.p,{children:[`Two editor checks are on by default. `,_jsx(_components.strong,{children:`Play mode guard enabled`}),` stops a run from the editor that could\nnot start the SDK (no autoload, no game version, an invalid config) and shows a dialog with a button\nthat opens the setup window. `,_jsx(_components.strong,{children:`Fail export if version unresolved`}),` checks the game version on export;\nsee `,_jsx(_components.a,{href:`#platform-notes`,children:`Platform notes`}),`.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Verbose logging`}),` prints the SDK’s diagnostics to the Output panel, never the request and response\nbodies, which carry passwords and tokens.`]}),`\n`,_jsxs(_components.p,{children:[`For analytics (sessions, events, consent, quit and crash reports), see\n`,_jsx(_components.a,{href:`/guides/analytics-and-events`,children:`Analytics \u0026 events`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`platform-notes`,children:`Platform notes`}),`\n`,_jsxs(_components.p,{children:[`Exported games are tested on `,_jsx(_components.strong,{children:`Windows, Linux, Android and the Web`}),`, in the standard and .NET builds\n(the Web in the standard build only, as Godot has no .NET export for the Web). macOS and iOS are not\ntested yet.`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Android:`}),` nothing to set up. Godot’s Android export leaves the internet permission off, so while\nthe addon is enabled it turns `,_jsx(_components.code,{children:`permissions/internet`}),` on for every Android export.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`The Web and iOS:`}),` there is no device id, so pass your own to the device sign-in calls (see\n`,_jsx(_components.a,{href:`#your-first-call`,children:`Your first call`}),`).`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Every platform:`}),` an export whose `,_jsx(_components.code,{children:`flock_config.tres`}),` has no game version, or another version than\nthe content code was generated for, ends with an error naming the fix. The export still writes its\nfiles (Godot gives an addon no way to stop it), so read the export’s result, or run the\n`,_jsx(_components.a,{href:`#checking-in-ci`,children:`check in CI`}),`.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`error-handling`,children:`Error handling`}),`\n`,_jsxs(_components.p,{children:[`Every failed call answers a `,_jsx(_components.code,{children:`FlockResult`}),` whose `,_jsx(_components.code,{children:`error`}),` is a `,_jsx(_components.strong,{children:_jsx(_components.code,{children:`FlockError`})}),`. `,_jsx(_components.code,{children:`describe()`}),` gives what\nis wrong (the server’s own reason when it gave one), then a `,_jsx(_components.code,{children:`Fix:`}),` line telling you what to do next.\nIn C#, `,_jsx(_components.code,{children:`Error.ToString()`}),` gives the same with the code in front.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`gdscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`gdscript`,children:_jsxs(_components.code,{language:`gdscript`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`var`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` signed_in`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`FlockResult`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` Flock`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`auth`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`sign_in_with_device`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`().`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`completed`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`if`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` not`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` signed_in`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`ok`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` push_error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`signed_in`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`describe`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`())`})]}),`\n`]})})}),`\n`,_jsx(CodeBlock,{filename:`describe() on a Web export, where Godot has no device id`,numberOfLines:`3`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`3`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`This platform reports no device id (OS.get_unique_id() is unsupported on web and iOS). Pass a device_id you generate and persist yourself.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Fix: Change the argument the message names, then make the call again.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Member`}),_jsx(_components.th,{children:`What it holds`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`message`})}),_jsx(_components.td,{children:`What is wrong: the server’s own reason when it gave one.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`hint()`})}),_jsx(_components.td,{children:`The fix on its own. Never empty: a code with no advice of its own gets the advice for its kind of failure.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`describe()`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`message`}),`, then a `,_jsx(_components.code,{children:`Fix:`}),` line with `,_jsx(_components.code,{children:`hint()`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`code`})}),_jsxs(_components.td,{children:[`The error code as a string (`,_jsx(_components.code,{children:`\"shop.insufficient_funds\"`}),`).`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`status`})}),_jsxs(_components.td,{children:[`The HTTP status, or `,_jsx(_components.code,{children:`0`}),` when the request never got an answer from the server.`]})]})]})]}),`\n`,_jsxs(_components.p,{children:[`In C# these are `,_jsx(_components.code,{children:`Message`}),`, `,_jsx(_components.code,{children:`Hint`}),`, `,_jsx(_components.code,{children:`Code`}),` and `,_jsx(_components.code,{children:`Status`}),`.`]}),`\n`,_jsx(Warning,{children:_jsx(_components.p,{children:`Branch on the code, never on message text. Codes are a stable contract; wording is not and will\nchange between versions.`})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`result.error_code()`}),` (`,_jsx(_components.code,{children:`ErrorCode`}),` in C#) is the code, or an empty string on success, so you can compare\nit directly:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`gdscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`gdscript`,children:_jsxs(_components.code,{language:`gdscript`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`var`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` bought`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`FlockResult`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` Flock`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`shop`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`purchase`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`FlockShopItemId`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`GEM_PACK`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`).`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`completed`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` bought`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`error_code`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`() `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`==`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"shop.insufficient_funds\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` show_not_enough_coins`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`() `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Your own UI.`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Server codes are named by feature (`,_jsx(_components.code,{children:`shop.insufficient_funds`}),`, `,_jsx(_components.code,{children:`player.invalid_login_credentials`}),`). The\nSDK’s own codes start with `,_jsx(_components.code,{children:`flock.`}),`, so a log line says which side found the problem:`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Code`}),_jsx(_components.th,{children:`Meaning`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`flock.network_unreachable`})}),_jsx(_components.td,{children:`The request never reached the server.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`flock.timeout`})}),_jsx(_components.td,{children:`No answer came in time. An unreachable server usually shows up this way too.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`flock.invalid_response`})}),_jsx(_components.td,{children:`An answer came but could not be read, or lacked what it should hold.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`flock.not_initialized`})}),_jsx(_components.td,{children:`The SDK could not start, or a generated class was used before it started.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`flock.not_signed_in`})}),_jsx(_components.td,{children:`The call needs a signed-in player, and there is none.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`flock.player_already_signed_in`})}),_jsxs(_components.td,{children:[`A local player (`,_jsx(_components.code,{children:`Flock.add_local_player()`}),`, for several players on one machine) tried to sign in as a player already signed in here.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`flock.invalid_argument`})}),_jsx(_components.td,{children:`An argument was refused before anything was sent.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`flock.cancelled`})}),_jsx(_components.td,{children:`The call was cancelled.`})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`flock.asset_url_expired`}),`, `,_jsx(_components.code,{children:`flock.asset_decode_failed`}),`, `,_jsx(_components.code,{children:`flock.asset_not_saved`})]}),_jsx(_components.td,{children:`An asset download’s link expired, its file was not the kind asked for, or it could not be saved on the device.`})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`flock.unauthorized`}),`, `,_jsx(_components.code,{children:`flock.payment_required`}),`, `,_jsx(_components.code,{children:`flock.forbidden`}),`, `,_jsx(_components.code,{children:`flock.not_found`}),`, `,_jsx(_components.code,{children:`flock.conflict`}),`, `,_jsx(_components.code,{children:`flock.validation_failed`}),`, `,_jsx(_components.code,{children:`flock.rate_limited`}),`, `,_jsx(_components.code,{children:`flock.server_error`})]}),_jsx(_components.td,{children:`An answer with that HTTP status and no Flock code of its own. Every failure Flock’s game API sends carries a code, so these came from something in between (a proxy, a network login page, an API URL that points at another server), and the fix says so.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`flock.unknown`})}),_jsx(_components.td,{children:`Anything else.`})]})]})]}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[`The fix is written for `,_jsx(_components.strong,{children:`you`}),`, not your players — it names SDK calls, settings and dashboard steps.\nShow it in your own logs or debug overlay, and write separate copy for your players.\nIn GDScript, `,_jsx(_components.code,{children:`FlockErrorHints.for_code(code)`}),` gives a code’s own advice, or an empty string when it\nhas none.`]})}),`\n`,_jsx(Tip,{children:_jsxs(_components.p,{children:[`The full API reference and a guide per feature live in the\n`,_jsx(_components.a,{href:`https://github.com/QwackStack/FlockGodotSDK#readme`,children:`SDK README`}),`.`]})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Godot SDK","description":"Add Flock to your Godot game with the official addon — from GDScript or C#.","href":"/sdk/godot"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Requirements","slug":"requirements","depth":2,"children":[]},{"title":"Setup","slug":"setup","depth":2,"children":[]},{"title":"Your first call","slug":"your-first-call","depth":2,"children":[]},{"title":"Initialization","slug":"initialization","depth":2,"children":[]},{"title":"GDScript and C#","slug":"gdscript-and-c#","depth":2,"children":[]},{"title":"Authenticate a player","slug":"authenticate-a-player","depth":2,"children":[]},{"title":"Work with your game data","slug":"work-with-your-game-data","depth":2,"children":[{"title":"Checking in CI","slug":"checking-in-ci","depth":3,"children":[]}]},{"title":"Explore features","slug":"explore-features","depth":2,"children":[]},{"title":"Advanced settings","slug":"advanced-settings","depth":2,"children":[]},{"title":"Platform notes","slug":"platform-notes","depth":2,"children":[]},{"title":"Error handling","slug":"error-handling","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/qwacks/05763fd4e1d53e37/lang-toggle.js"],"subdomain":"qwacks","siteName":"Qwacks","title":"Godot SDK - Qwacks","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{"en":{"href":"/sdk/godot","matchLevel":0},"ar":{"href":"/ar/sdk/godot","matchLevel":1}}},"lastModified":"2026-12-01T23:07:45.605Z","originalFileLocation":"sdk/godot.mdx","locale":"en"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=\"dark\";if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"dark\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Add Flock to your Godot game with the official addon — from GDScript or C#.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Qwacks\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/qwacks/UqcSWN8cDTjx2Nmd/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/qwacks/UqcSWN8cDTjx2Nmd/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/qwacks/UqcSWN8cDTjx2Nmd/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/qwacks/UqcSWN8cDTjx2Nmd/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/qwacks/UqcSWN8cDTjx2Nmd/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/qwacks/UqcSWN8cDTjx2Nmd/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/qwacks/UqcSWN8cDTjx2Nmd/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/qwacks/UqcSWN8cDTjx2Nmd/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/qwacks/UqcSWN8cDTjx2Nmd/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Godot SDK - Qwacks\">\u003cmeta data-mint-head property=\"og:description\" content=\"Add Flock to your Godot game with the official addon — from GDScript or C#.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Qwacks\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.qwacks.com/sdk/godot\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://qwacks.mintlify.site/_mintlify/api/og/v2?division=Getting+Started\u0026amp;title=Godot+SDK\u0026amp;description=Add+Flock+to+your+Godot+game+with+the+official+addon+%E2%80%94+from+GDScript+or+C%23.\u0026amp;theme=7cf102a658812adb3feebdf0\u0026amp;signature=5d5e293a8111fb7b1ab95014e6a710ef57ba0fdaea14d1229f1ddc1f1e10f52c\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Godot SDK - Qwacks\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Add Flock to your Godot game with the official addon — from GDScript or C#.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://qwacks.mintlify.site/_mintlify/api/og/v2?division=Getting+Started\u0026amp;title=Godot+SDK\u0026amp;description=Add+Flock+to+your+Godot+game+with+the+official+addon+%E2%80%94+from+GDScript+or+C%23.\u0026amp;theme=7cf102a658812adb3feebdf0\u0026amp;signature=5d5e293a8111fb7b1ab95014e6a710ef57ba0fdaea14d1229f1ddc1f1e10f52c\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/qwacks/UqcSWN8cDTjx2Nmd/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Qwacks\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#0099FF\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.qwacks.com/sdk/godot\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/sdk/godot.md\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"en\" href=\"https://docs.qwacks.com/sdk/godot\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"ar\" href=\"https://docs.qwacks.com/ar/sdk/godot\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"x-default\" href=\"https://docs.qwacks.com/sdk/godot\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.qwacks.com/#organization\",\"name\":\"Qwacks\",\"url\":\"https://docs.qwacks.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/qwacks/TGGmq_oWzDacAqHl/icons/qwacks.svg?fit=max\u0026auto=format\u0026n=TGGmq_oWzDacAqHl\u0026q=85\u0026s=2023abb340d6ec576975601525ab2ce9\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.qwacks.com#website\",\"name\":\"Qwacks\",\"url\":\"https://docs.qwacks.com\",\"publisher\":{\"@id\":\"https://docs.qwacks.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.qwacks.com/sdk/godot#webpage\",\"url\":\"https://docs.qwacks.com/sdk/godot\",\"name\":\"Godot SDK\",\"description\":\"Add Flock to your Godot game with the official addon — from GDScript or C#.\",\"dateModified\":\"2026-12-01T23:07:45.605Z\",\"isPartOf\":{\"@id\":\"https://docs.qwacks.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.qwacks.com/sdk/godot#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.qwacks.com/sdk/godot#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Getting Started\",\"item\":\"https://docs.qwacks.com/introduction\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Godot SDK\",\"item\":\"https://docs.qwacks.com/sdk/godot\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.qwacks.com/sdk/godot#article\",\"headline\":\"Godot SDK\",\"name\":\"Godot SDK\",\"description\":\"Add Flock to your Godot game with the official addon — from GDScript or C#.\",\"url\":\"https://docs.qwacks.com/sdk/godot\",\"mainEntityOfPage\":{\"@id\":\"https://docs.qwacks.com/sdk/godot#webpage\"},\"dateModified\":\"2026-12-01T23:07:45.605Z\",\"publisher\":{\"@id\":\"https://docs.qwacks.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.qwacks.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Qwacks\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Qwacks\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/sdk/godot.md","siteName":"Qwacks","nav":{"global":null,"languages":[{"language":"en","default":true,"tabs":[{"tab":"Qwacks","icon":"https://mintlify.s3.us-west-1.amazonaws.com/qwacks/icons/qwacks.svg","pages":[{"title":"Qwacks","href":"/welcome"}]},{"tab":"Flock","icon":"https://mintlify.s3.us-west-1.amazonaws.com/qwacks/icons/flock.svg","groups":[{"group":"Getting Started","pages":[{"title":"Flock","href":"/introduction"},{"title":"Quickstart","href":"/quickstart"},{"title":"Authentication","href":"/authentication"},{"title":"Unity SDK","href":"/sdk/unity"},{"title":"Unreal SDK","description":"Add Flock to your Unreal Engine game with the official plugin — from C++ or Blueprint.","href":"/sdk/unreal"},{"title":"Godot SDK","href":"/sdk/godot"}]},{"group":"Concepts","pages":[{"title":"Studios \u0026 Games","description":"The two top-level objects every Flock integration is built around.","href":"/concepts/studios-and-games"},{"title":"Versions","href":"/concepts/versions"},{"title":"Players","href":"/concepts/players"}]},{"group":"Features","pages":[{"group":"Players","pages":[{"title":"Sign-in","href":"/guides/players-and-auth"},{"title":"Linking Accounts","href":"/guides/account-linking"},{"title":"Player Data","href":"/guides/player-data"},{"title":"Bans","href":"/guides/bans"}]},{"group":"Progress","pages":[{"title":"Achievements","href":"/guides/achievements"},{"title":"Leaderboards","href":"/guides/leaderboards"}]},{"group":"Economy and Payments","pages":[{"title":"Currencies and Wallets","href":"/guides/currencies-and-wallets"},{"title":"Shops and Inventory","href":"/guides/shops-and-inventory"},{"title":"In-App Purchases","href":"/guides/real-money-purchases"},{"title":"Web Payments","href":"/guides/web-checkout"}]},{"group":"Game Content","pages":[{"title":"Remote Config","href":"/guides/remote-config"},{"title":"Game Patches","href":"/guides/game-patches"},{"title":"Game Files","href":"/guides/assets"}]},{"group":"Reaching Players","pages":[{"title":"Player Segments","href":"/guides/segments"},{"title":"Notifications","href":"/guides/notifications"}]},{"group":"Insights","pages":[{"title":"Analytics and Events","href":"/guides/analytics-and-events"},{"title":"Metric Definitions","href":"/guides/metric-definitions"},{"title":"Developer Alerts","href":"/guides/developer-alerts"}]},{"group":"Multiplayer","pages":[{"title":"Multiplayer","sidebarTitle":"Overview","href":"/guides/multiplayer"},{"title":"Parties","href":"/guides/parties"},{"title":"Matchmaking","href":"/guides/matchmaking"},{"title":"Sessions","href":"/guides/sessions"},{"title":"Connecting Players","href":"/guides/connecting-players"}]}]},{"group":"Reference","pages":[{"title":"Changelog","href":"/changelog"}]}]},{"tab":"Protokite","icon":"https://mintlify.s3.us-west-1.amazonaws.com/qwacks/icons/protokite.svg","pages":[{"title":"Protokite","href":"/protokite/getting-started"}]},{"tab":"Data Duck","icon":"https://mintlify.s3.us-west-1.amazonaws.com/qwacks/icons/data-duck.svg","pages":[{"title":"Data Duck","href":"/data-duck/getting-started"}]}]},{"language":"ar","navbar":{"links":[{"href":"https://www.qwacks.com/pricing","label":"الأسعار"},{"href":"https://github.com/QwackStack/FlockUnitySdk/releases","label":"حزمة Unity"},{"href":"https://github.com/QwackStack/FlockUnrealSdk/releases","label":"حزمة Unreal"},{"href":"https://github.com/QwackStack/FlockGodotSDK/releases","label":"حزمة Godot"}],"primary":{"type":"button","label":"لوحة التحكم","href":"https://flock-saas.qwacks.com"}},"pages":[{"title":"ar","href":"/ar/sdk/godot"}]}]},"basePath":"","title":"Godot SDK - Qwacks","deploymentId":"dpl_4dgnk6TA5fUgboKHTvWWyeqm3idh","buildId":"dpl_4dgnk6TA5fUgboKHTvWWyeqm3idh","dynamics":["07c022d89b","a74be98ba7"],"chunks":["Frame-BhbIEdST.js","DynamicMarkdown-DoPsKgYC.js","zoom-image-lightbox-D-vTqM_C.js","lightbox-handle-r17bVUz3.js"]}