Skip to content

Users Module

Lucas E. da Silva edited this page Apr 13, 2026 · 2 revisions

👤 Users Module

The Users service allows you to authenticate players and retrieve profile information such as usernames, IDs, and avatars.


🛠️ Functions

user_login(username: String, user_token: String) -> bool

The primary function for authentication. It validates the credentials, fetches the unique User ID, and automatically saves the data to user://gj-credentials.dat for future sessions.

  • Returns: true if login and data fetching were successful, false otherwise.

user_auth(username: String, user_token: String) -> Variant

Manually authenticates the user's credentials without performing the full login/save routine.

  • Returns: true if credentials are valid.

username_fetch(username: String) -> Variant

Fetches a user's data using their username.

  • Returns: A dictionary containing user details (ID, Type, Status, Avatar URL, etc.).

user_id_fetch(user_id: int) -> Variant

Fetches a user's data using their unique User ID.

friends_list() -> Variant

Retrieves the list of IDs for every user that is friends with the currently authenticated user.


💡 Example Usage

Simple Authentication

var is_logged = await GameJoltAPI.user_login("Lucas", "my_token_123")
if is_logged:
    print("Welcome back, ", GameJoltAPI.data_user.username)

Clone this wiki locally