# Collaboration

Source: https://athas.dev/docs/collaboration

Use Teams workspace invites, roles, channels, presence, calls, and metadata updates.

Collaboration is the Teams workspace layer for using Athas with a small team.

## Availability

Collaboration is available on Teams workspaces. Owners, admins, and accepted
members see the same workspace data in the web dashboard and Athas desktop.

Free, Plus, and Pro accounts see an upgrade prompt instead.

## Dashboard

Open **Dashboard > Settings > Collaboration** to manage the workspace:

- invite teammates and copy invite links
- review members and pending invitations
- change roles or disable members
- create workspace channels
- edit channel notes
- add channel guests
- share workspace projects
- review recent activity
- adjust invite rules, seat limits, and update limits

Owners and admins can manage membership and workspace rules. Members can use
shared projects, channels, and presence where enabled.

## Desktop

Athas desktop shows a compact Collaboration settings tab when the signed-in
account has Teams workspace access.

The desktop tab shows:

- workspace membership summary
- pending invitations
- channels
- active presence state
- current document stream status

Detailed member, channel, invite, and policy changes live in the web dashboard.

## Presence

Desktop can publish a lightweight presence heartbeat with the active file path,
selected channel, and optional follow target. This is metadata only; it does not
sync editor contents.

## Realtime Documents

Desktop can register the active document and append metadata-only update events
for cursor, selection, and viewport state. The server stores document paths,
versions, and event metadata without uploading source contents.

This is the transport foundation for future shared editing. Live co-editing,
automatic merges, and email delivery are not part of this slice yet.

## Realtime Connection

When the account service has realtime rooms enabled, desktop keeps a WebSocket
open to a room for the active document and for the selected channel. Updates to
your cursor and viewport and call setup messages then reach teammates as soon as
they are sent instead of on the next poll. Rooms only relay these messages between
connected members; they do not store them or any file contents.

Joining a room requires a short-lived token that the account service issues
after checking workspace membership. Desktop renews the token while the
connection is open, and the account service checks membership again each time,
so someone removed from the workspace is disconnected within ten minutes. If
rooms are unavailable, desktop falls back to the regular API automatically.

## Voice and Screen Sharing

Members in the same channel can share their microphone and screen from the
Collaboration sidebar. Audio and video go directly between teammates over
WebRTC. To connect teammates on different networks, desktop asks the account
service for STUN and TURN servers; when a direct connection is not possible,
media is relayed through Cloudflare's TURN service.

## Roles

- `owner`: manages the billing-owned workspace
- `admin`: manages members, invitations, and workspace rules
- `member`: uses shared projects, channels, and presence
- `viewer`: read-only workspace access

## Choose the right sharing feature

Use [Share to Web](https://athas.dev/docs/sharing) for a read-only code or conversation link and [Preview links](https://athas.dev/docs/previews) for a running app. Collaboration presence/cursor metadata does not synchronize source contents; keep code changes in Git and do not expect live co-editing.
