> ## Documentation Index
> Fetch the complete documentation index at: https://docs.manalens.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Traits

> Player traits: the known identity and social traits, such as discord_id, steam_id, email and x, the format each accepts, protected traits and limits.

Traits describe a player, such as their display name, Steam ID or favorite class. Event properties describe one event. Traits stay on the player. A trait comes from:

* an [`identify`](https://docs.manalens.dev/data/events/identify) call with a user ID
* a [`traits`](https://docs.manalens.dev/data/events/traits) call, with or without a user ID (without one, the traits belong to one browser or game install)
* the [player traits API](https://docs.manalens.dev/api/players/update-traits.md)
* an edit on the player profile in the dashboard

The latest value of each trait wins. Send `null` to delete a trait.

## Known traits

Known traits are player identity and social fields, such as the Steam ID, the Discord ID and the display name. They have a label and an icon, are listed first on the player profile's **Traits** tab, and get a light format check on write. Set them as `identify()` traits or in a [`traits` event](https://docs.manalens.dev/data/events/traits) from your game or website. You can also set them with the [player traits API](https://docs.manalens.dev/api/players/update-traits.md) or on the profile in the dashboard. The [protected traits](#protected-traits), such as `email`, come only from your server, the API or the dashboard.

Every other key is a custom trait, such as `supporter` or `favorite_class`. It accepts a string of up to 1024 characters, a finite number, or a boolean.

| Key | Label | Value |
| - | - | - |
| `display_name` | Display name | Text, up to 100 characters |
| `email` | Email | An email address. [Protected](#protected-traits): send it from your server or the API. |
| `avatar` | Avatar | An https URL, up to 1024 characters |
| `discord_id` | Discord ID | A Discord user ID (17 to 19 digits, at most 2^63 - 1) |
| `discord` | Discord | A Discord username, 2 to 37 characters, no spaces |
| `steam_id` | Steam ID | A SteamID64 of a Steam account: 17 digits, from 76561197960265729 to 76561202255233023 |
| `x` | X | A handle or profile URL, no spaces, up to 256 characters |
| `telegram` | Telegram | A handle or profile URL, no spaces, up to 256 characters |
| `github` | GitHub | A handle or profile URL, no spaces, up to 256 characters |
| `youtube` | YouTube | A handle or profile URL, no spaces, up to 256 characters |
| `tiktok` | TikTok | A handle or profile URL, no spaces, up to 256 characters |
| `reddit` | Reddit | A handle or profile URL, no spaces, up to 256 characters |
| `instagram` | Instagram | A handle or profile URL, no spaces, up to 256 characters |
| `linkedin` | LinkedIn | A handle or profile URL, no spaces, up to 256 characters |
| `facebook` | Facebook | A handle or profile URL, no spaces, up to 256 characters |
| `website` | Website | An http or https URL, up to 1024 characters |
| `location` | Location | Text, up to 256 characters |
| `description` | Description | Text, up to 1024 characters |

Known trait values must be strings, including the Discord ID and the Steam ID. A SteamID64 or a Discord ID sent as a JSON number is above 2^53, so JSON parsers change its last digits. Always send them as strings.

## Linked accounts

A valid `steam_id` or `discord_id` shows as a linked account under the player's name on the profile. It links to the public Steam or Discord profile. In the Players filter menu, **Linked account** finds the players with (or without) a Steam or Discord account. Your game reads the SteamID from Steamworks (for example `SteamUser.GetSteamID()`) and sends it in `identify()`:

```gdscript theme={null}
Manalens.identify("player_42", {"steam_id": str(Steam.getSteamID())})
```

A `steam_id` trait is a **claimed** account: nothing checked it. A **verified** account comes from a Steam ticket that Manalens checked. Only a verified account reads ownership and merges game installs. See [verified and claimed](https://docs.manalens.dev/integrations/steam.md#verified-and-claimed).

If your privacy notice covers it, send a Steam or Discord ID. Otherwise do not send one. It is personal data, the same as an email.

## Protected traits

Only a trusted channel can set these traits: server events with the secret key, the [player traits API](https://docs.manalens.dev/api/players/update-traits.md), and the dashboard.

| Key | Why |
| - | - |
| `email` | Matches itch.io purchases and names a player |
| `itch_user_id` | Matches itch.io purchases |
| `stripe_customer_id` | Links Stripe payments to a player |
| `paddle_customer_id` | Links Paddle payments to a player |

A website or a game build holds only the publishable key, so anyone can read it and send any value. So Manalens drops these keys from web and app `identify` and `traits` events, and keeps the other traits of the event. Send `email` from your server or with the API.

## Rules and limits

* `user_id` is the profile key. It is in the path, and it cannot be set or unset as a trait.
* The string `_is_deleted` is refused as a value. Send `null` to delete a trait.

The format checks apply to `identify` and `traits` events, the [player traits API](https://docs.manalens.dev/api/players/update-traits.md) and trait edits in the dashboard. The API and the dashboard refuse a bad value. An event keeps its other traits and drops only the trait that fails its check, so one bad value does not lose the event. A custom key starts with a letter, then has letters, digits, `_`, `.` or `-`, up to 100 characters. In all of them, `null` deletes the trait. Every write has the same limits: at most 50 traits and 8 KB of JSON per player.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.