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

# Friends

> Read this player's friends, who is online, and who is in your game right now.

One line gives you the list:

```rust theme={null}
let friends = client.friends().list()?;
# Ok::<(), arcane_sdk::SdkError>(())
```

```c theme={null}
char json[8192];
arcane_sdk_friends_json(json, sizeof(json));
```

Each entry is the signed-in player's friend on Arcane, with their presence right now:

| Field | Type | Notes |
| - | - | - |
| `user_id` | `String` | The friend's Arcane account id |
| `pseudo` | `String` | Their display name on Arcane |
| `online` | `bool` | Signed in to Arcane right now |
| `in_game` | `bool` | Playing **this** title right now |

```rust theme={null}
for friend in client.friends().list()?.friends {
    match (friend.online, friend.in_game) {
        (_, true) => show(&friend.pseudo, "In game"),
        (true, false) => show(&friend.pseudo, "Online"),
        (false, false) => show(&friend.pseudo, "Offline"),
    }
}
# Ok::<(), arcane_sdk::SdkError>(())
```

## `in_game` is about your title

`in_game` is `true` when the friend is playing the same `game_id` as this client — the id Arcane Powered launched you with. A friend playing something else on Arcane is `online`, not `in_game`. That presence is set by the Arcane desktop app when a game opens its [play session](/sdk/sdk/concepts/session), so it costs your game nothing.

`false` is never a guess about your own title: the client always knows its `game_id`, so `in_game` is `false` only when the friend is playing something else, or nothing at all.

## `stale`

The Arcane desktop app caches the list for 15 seconds. When it is offline it serves that cache and says so:

```rust theme={null}
let list = client.friends().list()?;
if list.stale {
    // Usable, just possibly a few minutes old. Dim the presence dots, don't hide them.
}
# Ok::<(), arcane_sdk::SdkError>(())
```

`stale: true` is a **success**, not an error. The SDK keeps no list of its own: every call asks the desktop app, and the desktop app decides what to answer with.

<Warning>
  `list()` is **synchronous**: one loopback round trip to the Arcane desktop app, on your thread, on the order of a millisecond. Call it when a friends menu opens, or on a timer of your own of a few seconds — never per frame.
</Warning>

## What stays in the launcher

This is a read of presence, and only that. **Friend requests, accepting or removing a friend, chat and the in-game overlay stay in the Arcane Powered desktop app.** A game does not send friend requests on the player's behalf, and there is nothing to call for it.

## Errors

| Code | When |
| - | - |
| `not_authenticated` | Nobody is signed in to the Arcane desktop app |
| `feature_unavailable` | The Arcane desktop app predates the friends route — update it |
| `arcane_unavailable` | The desktop app is not running |
| `network_required` | `ARCANE_OFFLINE_ONLY` is set — raised before any call |

Full table and what to do about each: [Errors](/sdk/sdk/concepts/errors).

## In C

```c theme={null}
char json[8192];
if (arcane_sdk_friends_json(json, sizeof(json)) > 0) {
  /* {"friends":[{"user_id":"…","pseudo":"…","online":true,"in_game":false}],
      "stale":false} */
}
```

Same call, same round trip. A `-4` means it failed — read `arcane_sdk_last_error_json` for the code. Size the buffer to the player's friend list (a few hundred bytes per friend); a short buffer gives `-3` and an empty string, never a truncated one. Details: [C ABI](/sdk/sdk/reference/c-abi).

## Next steps

* [Session](/sdk/sdk/concepts/session) — the play session that makes your player "in game" for their friends
* [Achievements](/sdk/sdk/concepts/achievements) — `unlock("first_blood")`, one line, idempotent
* [Errors](/sdk/sdk/concepts/errors) — every code, and its fix
* [Rust API](/sdk/sdk/reference/rust-api) · [C ABI](/sdk/sdk/reference/c-abi)


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