# useCollaboration

**Kind:** Function

**Source:** [`atloria-monorepo/apps/web/src/hooks/useCollaboration.ts`](https://github.com/sherkety/atloria/blob/main/atloria-monorepo/apps/web/src/hooks/useCollaboration.ts#L138)

Hook for real-time document collaboration using Yjs

## Signature

```ts
function useCollaboration(documentId: string | null | undefined, userId: string | null | undefined, userName: string | null | undefined, options: UseCollaborationOptions): UseCollaborationReturn
```

## Parameters

| Name | Type |
|---|---|
| `documentId` | `string | null | undefined` |
| `userId` | `string | null | undefined` |
| `userName` | `string | null | undefined` |
| `options` | `UseCollaborationOptions` |

**Returns:** `UseCollaborationReturn`
