Skip to content

Data Store Module

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

📦 Data Store Module

The Data Store service allows you to store and retrieve data from the Game Jolt servers. This is ideal for saving game progress, user preferences, or global world data.


🛠️ Functions

data_fetch(require_user: bool, key: String) -> Variant

Returns the data contained in a data store key.

  • require_user: If true, fetches from the authenticated user's data. If false, fetches from global game data.
  • key: The name of the key to fetch.

data_get_keys(require_user: bool, pattern: String = "") -> Variant

Returns a list of all the keys in a data store.

  • pattern: (Optional) A string used to filter keys (e.g., "level_*").

data_remove(require_user: bool, key: String) -> Variant

Removes a key and its data from the data store.

  • key: The name of the key to delete.

data_set(require_user: bool, key: String, data: String) -> Variant

Sets the data for a specific key in the data store.

  • data: The string content to save. (If saving integers, convert them using str()).

data_update(require_user: bool, key: String, operation: OPERATION, value: String) -> Variant

Updates an existing data store key by performing a server-side operation.

  • operation: Use the OPERATION enum: ADD, SUBTRACT, MULTIPLY, DIVIDE, APPEND, or PREPEND.
  • value: The value to apply in the operation.

💡 Example Usage

# Saving a global high score value
await GameJoltAPI.data_set(false, "global_record", "5000")

# Incrementing a user's level key
await GameJoltAPI.data_update(true, "user_level", GameJoltAPI.OPERATION.ADD, "1")