Sanity Library Reference Docs
    Preparing search index...

    Interface PresenceLocation

    Somewhere a participant is, as it arrives over the wire.

    Prefer DocumentPresence from getDocumentPresence, which is scoped to one document, flattened for rendering, and types path accurately.

    interface PresenceLocation {
        documentId: string;
        lastActiveAt: string;
        path: string[];
        selection?: PresenceSelection;
        type: "document";
    }
    Index

    Properties

    documentId: string

    The specific document the participant is in, so a draft, published, or version id rather than a bare document id.

    lastActiveAt: string

    When the participant said they were last active, on their clock.

    Fine for display, unreliable for deciding whether someone is still here: it is subject to clock skew between machines. Presence already drops participants that stop announcing, so a session appearing here is one the SDK still considers live.

    path: string[]

    The focused field path, empty when they are in the document but not a field.

    Declared as string[], but segments can also be numbers or {_key: string} objects when the focus is inside an array or a Portable Text field, because that is what other clients send. Guard for those rather than assuming strings. Widening the declared type is a breaking change, so it waits for the next major; DocumentPresence.path is typed correctly today.

    selection?: PresenceSelection

    A Portable Text caret, when the focused field is a Portable Text field.

    type: "document"