Subscriptions
Live data subscriptions via realtime.subscribe
Import a query function from @start-chat/sdk/queries and pass it to
realtime.subscribe. Your callback fires immediately with current data, then
again whenever the data changes.
realtime.subscribe returns a Subscription object:
| Property | Description |
|---|---|
.data | Current data snapshot (updates on each callback) |
.unsubscribe() | Stop listening for updates |
serverById
Get server details by ID.
| Parameter | Type | Required | Description |
|---|---|---|---|
serverId | string | Yes |
serverMembers
List members of a server.
| Parameter | Type | Required | Description |
|---|---|---|---|
serverId | string | Yes | |
limit | number | No | |
search | string | No | |
cursorValue | number | No | |
cursorDir | 'forward' | 'backward' | No | forward, backward |
userServers
List servers the authenticated user belongs to.
| Parameter | Type | Required | Description |
|---|---|---|---|
userId | string | No |
searchJoinableServers
Search for public servers the user can join.
| Parameter | Type | Required | Description |
|---|---|---|---|
userId | string | No | |
search | string | No | |
limit | number | No |
channelsByServer
List all channels in a server.
| Parameter | Type | Required | Description |
|---|---|---|---|
serverId | string | Yes |
channelById
Get channel details by ID.
| Parameter | Type | Required | Description |
|---|---|---|---|
channelId | string | Yes |
channelMessages
Fetch messages in a channel. Supports cursor-based pagination, filtering, and limit control.
| Parameter | Type | Required | Description |
|---|---|---|---|
serverId | string | Yes | |
channelId | string | Yes | |
fromOrder | string | No | |
around | 'before' | 'after' | No | before, after |
limit | number | No | |
solo | boolean | No | |
channelFilter | 'thread' | 'chat' | 'app' | 'pinned' | No | thread, chat, app, pinned |
appendingFromOrder | string | No |
messageById
Get a single message by ID.
| Parameter | Type | Required | Description |
|---|---|---|---|
messageId | string | Yes |
threadWithMessages
Get a thread and all its messages.
| Parameter | Type | Required | Description |
|---|---|---|---|
threadId | string | Yes | |
serverId | string | Yes |
threadById
Get thread metadata by ID.
| Parameter | Type | Required | Description |
|---|---|---|---|
threadId | string | Yes |
userById
Get user profile by ID.
| Parameter | Type | Required | Description |
|---|---|---|---|
userId | string | Yes |