Skip to main content

Contact

Represents a user’s contact with their profile and status information.
export interface Contact {
  id: string
  name: string
  phoneNumber: string
  about: string
  avatarUrl: string
  isOnline: boolean
  lastSeenAt: string
  favorite?: boolean
  pinned?: boolean
}
id
string
required
Unique identifier for the contact
name
string
required
Display name of the contact
phoneNumber
string
required
Contact’s phone number
about
string
required
Contact’s status or about text
avatarUrl
string
required
URL to the contact’s profile picture
isOnline
boolean
required
Whether the contact is currently online
lastSeenAt
string
required
ISO 8601 timestamp of when the contact was last seen online
favorite
boolean
Whether this contact is marked as a favorite
pinned
boolean
Whether this contact is pinned to the top of the chat list

Profile

Represents the current user’s profile information.
export interface Profile {
  id: string
  name: string
  phoneNumber: string
  avatarUrl: string
  about: string
}
id
string
required
Unique identifier for the user
name
string
required
User’s display name
phoneNumber
string
required
User’s phone number
avatarUrl
string
required
URL to the user’s profile picture
about
string
required
User’s status or about text
The Profile type is similar to Contact but represents the current authenticated user rather than another contact.

PresenceMap

Maps contact IDs to their online presence status.
export interface PresenceMap {
  [contactId: string]: {
    isOnline: boolean
    lastSeenAt: string
  }
}
This is a dictionary-style interface where each key is a contact ID and the value contains presence information.
The PresenceMap is useful for efficiently tracking and updating the online status of multiple contacts simultaneously.

Build docs developers (and LLMs) love