> For the complete documentation index, see [llms.txt](/llms.txt).
> The full corpus is at [llms-full.txt](/llms-full.txt).

# getAnnotation

> **getAnnotation**(`snapshot`, `path`): \{ `node`: `PortableTextObject`; `path`: `Path`; \} \| `undefined`

Defined in: get-annotation.ts:18

Get the annotation at a given path.

Annotations live in `markDefs` on a text block, alongside `children`
rather than inside it, so they aren't reachable through `getNode`.
`getAnnotation` resolves a path of the shape
`[..., {_key: block}, 'markDefs', {_key: annotation}, ...]` to the
annotation node on the enclosing text block.

## Parameters

### snapshot

`TraversalSnapshot`

### path

`Path`

## Returns

\{ `node`: `PortableTextObject`; `path`: `Path`; \} \| `undefined`