# Presence: get() method

> The get() method of the Presence interface returns a player's presence entry.

The **`get()`** method of the [`Presence`](/docs/room/presence) interface returns a player's presence entry.

## Syntax

```ts
get(player)
```

### Parameters

`player`
: The player ID.

### Return value

The player's [`PresenceEntry`](/docs/room/presence-entry), or `undefined` when the player has none.

## Description

A player's entry exists from before `onJoin` runs for its first connection until its presence ends, so it's there in `onLeave`, and in [`onPlayerLeave`](/docs/room/room-definition/onplayerleave) until the hook first awaits. While the player has no open connection, `connected` is `false`.

## Examples

### Saying goodbye by name

`onPlayerLeave` runs once a player's presence ends, with the entry still there until the hook first awaits, so it can read the player's name.

```ts
// goodbye.ts
import { defineRoom } from "@irtio/room";

export default defineRoom({
  onPlayerLeave(room, player) {
    const name = room.presence.get(player)?.name || "A player";
    room.broadcast({ type: "left", text: `${name} left the table` });
  },
});
```

## See also

- [`Presence.set()`](/docs/room/presence/set)
- [`PresenceEntry`](/docs/room/presence-entry)
