# chat.yakka.getSnapshot

> Published by [yakka.chat](https://lexicon.garden/identity/did:plc:wpjoy2orkqq5m65vq7gg7liz)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:wpjoy2orkqq5m65vq7gg7liz/chat.yakka.getSnapshot)
- [Documentation](https://lexicon.garden/lexicon/did:plc:wpjoy2orkqq5m65vq7gg7liz/chat.yakka.getSnapshot/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:wpjoy2orkqq5m65vq7gg7liz/chat.yakka.getSnapshot/examples)

## Definitions

### `chat.yakka.getSnapshot`

**Type**: `query`

Everything needed for first paint, in one round trip: the viewer's servers, the active server's channels and roster, and one channel's newest timeline page.

One method rather than five because this is the server-rendered path — every extra round trip here is latency a reader sees before anything appears. Warm navigations do not call it at all; the client's store already holds the answer.

#### Parameters

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `server` | `string` (did) | No | Which server to open. Omit to let the appview choose the viewer's first. |
| `channel` | `string` | No | Which channel's timeline to include. Omit for the server's default. |

#### Output

**Encoding**: `application/json`

### `chat.yakka.getSnapshot#output`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `viewer` | `ref` → `chat.yakka.defs#memberView` | No |  |
| `members` | `array` | Yes |  |
| `servers` | `array` | Yes |  |
| `channels` | `array` | Yes |  |
| `timeline` | `ref` → `chat.yakka.defs#timelinePage` | No |  |
| `readState` | `array` | No |  |
| `activeChannelId` | `string` | No |  |
| `activeServerDid` | `string` (did) | No |  |

## Raw Schema

```json
{
  "id": "chat.yakka.getSnapshot",
  "defs": {
    "main": {
      "type": "query",
      "output": {
        "schema": {
          "ref": "#output",
          "type": "ref"
        },
        "encoding": "application/json"
      },
      "parameters": {
        "type": "params",
        "properties": {
          "server": {
            "type": "string",
            "format": "did",
            "description": "Which server to open. Omit to let the appview choose the viewer's first."
          },
          "channel": {
            "type": "string",
            "description": "Which channel's timeline to include. Omit for the server's default."
          }
        }
      },
      "description": "Everything needed for first paint, in one round trip: the viewer's servers, the active server's channels and roster, and one channel's newest timeline page.\n\nOne method rather than five because this is the server-rendered path — every extra round trip here is latency a reader sees before anything appears. Warm navigations do not call it at all; the client's store already holds the answer."
    },
    "output": {
      "type": "object",
      "required": [
        "servers",
        "channels",
        "members"
      ],
      "properties": {
        "viewer": {
          "ref": "chat.yakka.defs#memberView",
          "type": "ref"
        },
        "members": {
          "type": "array",
          "items": {
            "ref": "chat.yakka.defs#memberView",
            "type": "ref"
          }
        },
        "servers": {
          "type": "array",
          "items": {
            "ref": "chat.yakka.defs#serverView",
            "type": "ref"
          }
        },
        "channels": {
          "type": "array",
          "items": {
            "ref": "chat.yakka.defs#channelView",
            "type": "ref"
          }
        },
        "timeline": {
          "ref": "chat.yakka.defs#timelinePage",
          "type": "ref"
        },
        "readState": {
          "type": "array",
          "items": {
            "ref": "chat.yakka.defs#channelReadState",
            "type": "ref"
          }
        },
        "activeChannelId": {
          "type": "string"
        },
        "activeServerDid": {
          "type": "string",
          "format": "did"
        }
      }
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
