# The stateManager.getTournamenst() method
This documents the `stateManager.getTournaments()` method.

```ts
function getTournaments(): Tournament[] | undefined {
    // backend logic
}
```
## General usage:
```ts
const tournaments: Tournament[] | undefined = taClient.stateManager.getTournaments();
```

This method will return either an array of the `Tournament` object or undefined. A `Tournament` can be described by the following TypeScript Interface:
```ts
interface Tournament {
    /**
     * @generated from protobuf field: string guid = 1;
     */
    guid: string;
    /**
     * @generated from protobuf field: proto.models.Tournament.TournamentSettings settings = 2;
     */
    settings?: Tournament_TournamentSettings;
    /**
     * @generated from protobuf field: repeated proto.models.User users = 3;
     */
    users: User[];
    /**
     * @generated from protobuf field: repeated proto.models.Match matches = 4;
     */
    matches: Match[];
    /**
     * @generated from protobuf field: repeated proto.models.QualifierEvent qualifiers = 5;
     */
    qualifiers: QualifierEvent[];
    /**
     * @generated from protobuf field: proto.models.CoreServer server = 6;
     */
    server?: CoreServer;
}
```

- For the definition of a Tournament_TournamentSettings please look at the [Modals -> Tournament_TournamentSettings page](/documentation#Modals/4-Tournament_TournamentSettings)
- For the definition of a User please look at the [Modals -> User page](/documentation#Modals/4-User)
- For the definition of a Match please look at the [Modals -> Match page](/documentation#Modals/4-Match)
- For the definition of a QualifierEvent please look at the [Modals -> QualifierEvent page](/documentation#Modals/4-QualifierEvent)
- For the definition of a CoreServer please look at the [Modals -> CoreServer page](/documentation#Modals/4-CoreServer)

A direct implementation:
```ts
// Get tournaments from the client
const tournamentsList = client.stateManager.getTournaments();
```
<div class="info-box">
    <span class="material-icons">info</span>
    <div>
        <strong>Example:</strong> This is an example from the page of ShyyTAUI within the tournament list / select page. 
    </div>
</div>