# User Data

Store and manage player data to enhance gameplay experience and retain progress.

There are two types of storage: `local_storage` and `platform_internal`. When writing to local storage, data is saved on the player's device. When writing to internal storage, data is saved on the platform's servers.

#### Current Storage Type <a href="#current-storage-type" id="current-storage-type"></a>

Identify the default storage type to understand where data is being saved (local or server).

<figure><img src="https://1088849411-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5ukgSPDBOdbQp4FYtbz1%2Fuploads%2FScxYb6CIFJ0KSvWhgPQx%2FScreenshot%202025-07-11%20at%204.43.52%E2%80%AFPM.png?alt=media&#x26;token=2638338a-0f5b-4dc9-ba93-8cc89736ebe7" alt=""><figcaption></figcaption></figure>

Possible values: `local_storage,` `platform_internal`.

#### Support Check <a href="#support-check" id="support-check"></a>

Verify if the specified storage type is supported on the platform to ensure compatibility.

<figure><img src="https://1088849411-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5ukgSPDBOdbQp4FYtbz1%2Fuploads%2FEitg5twjzl8NBEcQskbZ%2FScreenshot%202025-07-11%20at%204.44.33%E2%80%AFPM.png?alt=media&#x26;token=1678e38b-738c-4daf-a175-8174bf1b3688" alt=""><figcaption></figcaption></figure>

#### Availability Check <a href="#availability-check" id="availability-check"></a>

Check if the specified storage type is currently available for use to manage data storage effectively.

<figure><img src="https://1088849411-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5ukgSPDBOdbQp4FYtbz1%2Fuploads%2FY5ODGN2J2jAnsZzAWD3M%2FScreenshot%202025-07-11%20at%204.45.04%E2%80%AFPM.png?alt=media&#x26;token=c72ee86a-2e9c-47f9-a077-0dc6d87e4c85" alt=""><figcaption></figcaption></figure>

#### <img src="https://1088849411-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5ukgSPDBOdbQp4FYtbz1%2Fuploads%2F9BooaofCI33U9Np5oeif%2FFrame%203%20(1).png?alt=media&#x26;token=0750b56a-a069-4759-bda9-29951f06cd30" alt="" data-size="line"> Load Data <a href="#load-data" id="load-data"></a>

Retrieve stored data based on a key or multiple keys to restore player progress or settings.

<figure><img src="https://1088849411-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5ukgSPDBOdbQp4FYtbz1%2Fuploads%2FumLdxraCuaOFn0GvYESo%2FScreenshot%202025-07-11%20at%204.46.20%E2%80%AFPM.png?alt=media&#x26;token=2bf2cf49-c2ca-406e-85f9-b9078214fe16" alt=""><figcaption></figcaption></figure>

#### <img src="https://1088849411-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5ukgSPDBOdbQp4FYtbz1%2Fuploads%2F9BooaofCI33U9Np5oeif%2FFrame%203%20(1).png?alt=media&#x26;token=0750b56a-a069-4759-bda9-29951f06cd30" alt="" data-size="line"> Save Data <a href="#save-data" id="save-data"></a>

Save data to the specified storage with a key to retain player progress or settings.

<figure><img src="https://1088849411-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5ukgSPDBOdbQp4FYtbz1%2Fuploads%2FKuggrPVFnX6eH4GFV4nB%2FScreenshot%202025-07-11%20at%204.46.26%E2%80%AFPM.png?alt=media&#x26;token=e2dda506-d92c-4fbf-b629-d11f895a4bf9" alt=""><figcaption></figcaption></figure>

#### Delete Data <a href="#delete-data" id="delete-data"></a>

Remove data from the specified storage by key to manage player data and settings effectively.

<figure><img src="https://1088849411-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5ukgSPDBOdbQp4FYtbz1%2Fuploads%2FRjHoYH5bmeScQrhAlpyx%2FScreenshot%202025-07-11%20at%204.46.42%E2%80%AFPM.png?alt=media&#x26;token=cca03cc5-61d9-43fe-9640-03b008cfb455" alt=""><figcaption></figcaption></figure>

All data operations interact with the `default` platform storage. You can specify the storage type as the second argument. Ensure the storage is available before using it.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wiki.playgama.com/playgama/sdk/engines/scratch/user-data.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
