Game ideas & features

Your next feature

Authentication

Sign in a test player and reuse their session.

Godot
Illustration of Authentication
Your visible result

A test player is signed in. Follow-up requests use their session.

Integrate player sign-in2:02
Open video separately ↗

Prepare the same project

  1. Choose the same project in the dashboard as in your game configuration.

    Authentication →
  2. No additional definition is needed for the first request. An empty result is valid until matching game data exists.

    This example signs in anonymously. Email, Google and Apple are alternatives with separate setup. Run only one sign-in method.

Build this feature

You can preview the guide. Running it requires an active project key. Prepare project

SDK installed and project configuration imported.

Save the GDScript, attach it to a node in the main scene and run it. Check Output.

GDScript
res://scripts/authentication.gd
horizOn callSetup
1# Attach this script to a node in your main scene.
2extends Node
3​
4​
5func _ready() -> void:
6 # Setup: initialize and connect.
7 var connected = await Horizon.connect_to_server()
8 if not connected:
9 print("Failed to connect to horizOn server")
10 return
11​
12 # horizOn: create a player account and sign in.
13 var signed_in: bool = Horizon.auth.isSignedIn()
14 if not signed_in:
15 signed_in = await Horizon.quickSignInAnonymous("TestPlayer")
16 if not signed_in:
17 push_warning("Sign-in failed")
18 return
19 print("Signed in as: ", Horizon.auth.getCurrentUser().displayName)
Open the complete SDK sample ↗

Test your new feature.

A test player is signed in. Follow-up requests use their session.

Choose the same project in the dashboard as in your game configuration.

Endpoints
  • POST/user-management/signup
  • POST/user-management/signin
All endpoints in the API reference
Our suggestion for your next step

Give every round a high score.

Save the score after a round and show who's ahead. Keep using your connection and player session.

Tutorial video

Integrate player sign-inGodot5:36
Open video separately ↗