# chat.yakka.getSession

> 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.getSession)
- [Documentation](https://lexicon.garden/lexicon/did:plc:wpjoy2orkqq5m65vq7gg7liz/chat.yakka.getSession/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:wpjoy2orkqq5m65vq7gg7liz/chat.yakka.getSession/examples)

## Definitions

### `chat.yakka.getSession`

**Type**: `query`

Who the caller is signed in as. The session cookie carries an opaque id and nothing else (ADR 0034 §2), so this is how a client learns its own DID — it cannot read one out of the cookie, by design. Answers 200 with `signedIn: false` rather than 401 for an anonymous caller: not being signed in is an ordinary state of the application, not an error in the request.

#### Output

**Encoding**: `application/json`

### `chat.yakka.getSession#output`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `viewer` | `ref` → `chat.yakka.defs#memberView` | No |  |
| `signedIn` | `boolean` | Yes |  |

## Raw Schema

```json
{
  "id": "chat.yakka.getSession",
  "defs": {
    "main": {
      "type": "query",
      "output": {
        "schema": {
          "ref": "#output",
          "type": "ref"
        },
        "encoding": "application/json"
      },
      "description": "Who the caller is signed in as. The session cookie carries an opaque id and nothing else (ADR 0034 §2), so this is how a client learns its own DID — it cannot read one out of the cookie, by design. Answers 200 with `signedIn: false` rather than 401 for an anonymous caller: not being signed in is an ordinary state of the application, not an error in the request."
    },
    "output": {
      "type": "object",
      "required": [
        "signedIn"
      ],
      "properties": {
        "viewer": {
          "ref": "chat.yakka.defs#memberView",
          "type": "ref"
        },
        "signedIn": {
          "type": "boolean"
        }
      }
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
