Godot SDK

Native GDScript

Godot SDK

Godot SDK 2.2.0 provides the same licensing operations as the other eight official clients, using Godot's native HTTP/TLS and ECDSA implementation. The game needs no .NET edition, GDExtension binary, Python installation or external cryptography package. Use Godot 4.7+; the release evidence identifies the actual editor and export versions tested.

Install the add-on

Download the Godot source ZIP. Copy addons/permitcore/ into your project's res://addons/permitcore/ and import the project in Godot. Enabling the editor plugin is optional. The self-contained Godot demo already contains the add-on: open project.godot and run its main scene.

Validate and activate

Supply your vendor's verified API origin and the expected product ID. Configure public-key trust through your application's trusted release channel. Keep keys out of logs, exported source and URL query strings. Call network methods with await from Godot's SceneTree thread; native HTTP polling yields frames while the request is in progress.

GDScript
extends Node
# Copy addons/permitcore into res://addons/permitcore first.
const PermitClient = preload("res://addons/permitcore/permitcore_client.gd")
var client = PermitClient.new("http://localhost:5127", {
    "trusted_public_keys": ["YOUR_TENANT_SPKI_BASE64_PUBLIC_KEY"],
    "cache_directory": "user://permitcore"
})

func can_use_pro_features(key: String, product_id: String) -> bool:
    var result = await client.validate(key, "1.0.0", product_id)
    return result.is_valid and result.has_feature("pro")

func register_installation(key: String, product_id: String) -> bool:
    var result = await client.activate(key, "", "My Godot app", "1.0.0", product_id)
    return result.is_valid

Validation does not consume a device seat. Explicit activation fetches a nonce and registers the installation. Reuse the same stable device identity later. has_feature checks feature names without case sensitivity; your application enforces the result at the protected operation. No client-side check provides tamper-proof DRM.

Complete operation reference

MethodResult and boundary
await validate(key, version, product)LicenseResult; product-scoped status without activation.
await activate(key, device, name, version, product)LicenseResult; fresh nonce, single activation POST.
await deactivate(tenant, key, activation_id)Only HTTP 204 confirms removal. Portal OTP/account protection still applies.
await meter(key, event, quantity, meta)Only JSON recorded:true confirms recording; quantity below one becomes one.
await checkout(key, device, name)FloatingSession; no offline fallback.
await heartbeat(session_token)Renewed FloatingSession or failure with no returned credentials.
await try_checkin(session_token)Boolean confirmation of HTTP 204. checkin is the best-effort variant.
get_hardware_id()Private hashed installation identifier using a persisted seed; not clone attestation.
verify_offline_token(token, public_key)Local signature/deadline primitive, with explicit caller-managed trust.
verify_grace_cache_token(token, public_key)Local grace-token signature/deadline primitive.
activate_offline(token, device, product)Configured trust and context checks; stores only original signed proof.
validate_offline(device, product)Reverifies saved original proof on every read.
await verify_offline_online(token)Server token verification and revocation status; requires connectivity.
result.has_feature(name)Case-insensitive feature membership.

Results, offline trust and recovery

LicenseResult exposes validity, product identity, features, custom fields, device capacity, expiry/maintenance, trial/version bounds, vendor warning and payment/grace metadata. Use error_code for branching and message for display. TokenResult exposes is_valid and a signed payload dictionary; signed dictionary fields retain their camelCase wire names.

Automatic grace fallback requires independently configured trusted_public_keys and matching license hash, product, device and signed deadline. Activation fallback also needs signed existing-activation evidence. No pins means no trusted cache. Offline proof cannot discover later revocation, device removal or payment changes; its signed deadline remains binding. Removing a device attempts to discard that key's local grace cache.

The default cache is user://permitcore. Set an application-specific cache_directory and, where appropriate, a stable device_id. Invalid constructor options populate configuration_error and make network operations fail without a request. An optional tls_ca_file loads your own independently trusted PEM CA for self-hosting; hostname verification stays enabled.

SDK request settings

A slow or unavailable license server must not leave your application waiting indefinitely. All nine SDKs default to a 10-second timeout for each attempt and two additional attempts for safe requests. The usual backoff is 250 milliseconds, then 500 milliseconds. This is not a single 10-second deadline for the complete operation: activation also fetches a nonce.

  • License validation, nonce/public-key retrieval and floating heartbeat may retry a network failure or HTTP 5xx response. Set the retry count to zero to disable these retries; the range is 0–5.
  • Floating checkout, activation POST, usage reporting, device removal and checkin are sent once. A lost response can follow a successful server change, so retrying these blindly can duplicate work.
  • HTTP 3xx/4xx responses and malformed successful responses do not retry. SDK-owned transports do not follow redirects, so configure the final HTTPS API address directly.

For validate/activate, branch on the server's error code when available. Otherwise HttpError means an HTTP rejection, InvalidResponse means malformed successful license/nonce evidence and RequestFailed means the network/5xx attempts were exhausted without a usable signed cache. Rejection or malformed successful evidence never becomes cached authorization. A network outage can use only a separately trusted, unexpired proof.

SDKConfiguration
GodotConstructor options "timeout_seconds": 10.0, "max_retries": 2. Native frame-polled HTTP keeps the game loop responsive, including while game time is paused.

Timeout mechanisms follow each runtime: Python uses socket I/O timeouts; Unity delegates to its transport. Caller cancellation is separate from retry policy. Unity's default adapter disables redirects; WebGL needs Unity 2021.3 or later for that protection and fails closed on older versions. Portable .NET tests do not certify an Editor, IL2CPP or browser build. Verify your actual target before shipping.

Install the published version for your language using the SDK installation references and follow the offline migration guide when upgrading from 1.x.

Test with the actual engine

The source distribution contains shared vectors and native-engine tests. Run python -m pip install -r tests/requirements.txt, then python tests/run_tests.py --godot /absolute/path/to/godot. Python is test tooling, not a game dependency. Tests exercise real Godot HTTP/TLS, signatures, signed-context attacks, response failures, retries and game-loop responsiveness. Actual editor/export and hosted acceptance remain distinct from loopback fixture evidence.

Verify your own exported target before shipping. Web, mobile and console limitations are platform-specific; do not infer support from a desktop run. Never distribute test signing keys or a development-only success response as production authorization.