# User Parameters

You can also retrieve various information about the player and their device.

#### Device Type <a href="#device-type" id="device-type"></a>

Determine the type of device (mobile, tablet, desktop, tv) the game is being played on to adjust the game’s interface and performance settings.

```javascript
playgama_bridge_device_type()
```

Returns the type of device the user launched the game from. Possible values: `mobile`, `tablet`, `desktop`, `tv`.

#### Authorization Support <a href="#authorization-support" id="authorization-support"></a>

Check if the platform supports player authorization to enable features that require user authentication, such as saving game progress or accessing social features.

```javascript
playgama_bridge_player_is_authorization_supported()
```

#### Is the Player Currently Authorized <a href="#is-the-player-currently-authorized" id="is-the-player-currently-authorized"></a>

Verify if the player is currently authorized on the platform. This allows you to enable personalized features, such as saving high scores or providing user-specific content.

```javascript
playgama_bridge_player_is_authorized()
```

{% hint style="info" %}
If the player is not authorized, you can still check the player's ID and name, there may be a guest account in use.
{% endhint %}

#### Player ID <a href="#player-id" id="player-id"></a>

Get the player’s unique ID on the platform to manage user-specific data and settings. Use this ID to track player progress, achievements, and purchases

```javascript
playgama_bridge_player_id()
```

If the platform supports authorization and the player is currently authorized, this returns their platform ID. Otherwise, it returns `undefined`.

#### Player Name <a href="#player-name" id="player-name"></a>

Retrieve the player's name to personalize the game experience. Display the name in leaderboards, friend lists, or when sending notifications and messages.

```javascript
playgama_bridge_player_name()
```

If there is no data – `undefined`. If the data is available, the data is in `string` format.

#### Player Extra Fields <a href="#player-authorization" id="player-authorization"></a>

Get platform-specific information (properties may vary depending on the platform).

```javascript
playgama_bridge_player_extra()
```

Use this data to verify authorization. Currently, the Playgama API verification only supports `playgama`, `msn` and `microsoft_store` platforms.

```bash
curl -X POST "https://playgama.com/api/bridge/v1/verify" \
  -H "Content-Type: application/json" \
  -d '{"platform":"<PLATFORM_ID>","type":"authorization","data":{  <...playgama_bridge_player_extra()> }}'
  
#  Response:
#  {
#    success: boolean;
#    errorMessage?: string;

#    -- authorization --
#    playerId?: string;
#    publisherPlayerId?: string;
#  }
```

#### Player Avatar <a href="#player-avatar" id="player-avatar"></a>

Get the count of player avatars available. Use this to manage and display user profile images effectively, such as showing the avatar in multiplayer lobbies or profile screens.

```javascript
var photos = json_parse(playgama_bridge_player_photos())
```

Possible values: an array of player avatars (sorted by increasing resolution), empty array.

#### Player Authorization <a href="#player-authorization" id="player-authorization"></a>

Authorize the player on the platform to access protected features and personalize the game experience. For example, prompting the player to log in to save their progress or unlock social sharing features.

```gml
var options = { }

playgama_bridge_player_authorize(json_stringify(options))

// callback via Async Social Event
if async_load[? "type"] == "playgama_bridge_player_authorize_callback" {
    if async_load[? "success"] {
        // your logic
    }
}
```
