Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface ChatUIInitParams

ChatUI initialization parameters

description

Configuration object for initializing the ChatUI application

example
const initParams: ChatUIInitParams = {
hooks: {
reqUserProfiles: async (userIds) => {
// Fetch user profiles from your backend
return userIds.map(id => ({
userId: id,
name: `User ${id}`,
portraitUri: `https://example.com/avatar/${id}.png`
}));
},
reqGroupProfiles: async (groupIds) => {
// Fetch group profiles from your backend
return groupIds.map(id => ({
groupId: id,
name: `Group ${id}`,
portraitUri: `https://example.com/group/${id}.png`
}));
},
reqSystemProfiles: async (targetIds) => {
// Fetch system channel profiles
return targetIds.map(id => ({
targetId: id,
name: `System ${id}`,
portraitUri: `https://example.com/system/${id}.png`
}));
},
reqGroupMembers: async (groupId) => {
// Fetch group members
return [
{ userId: 'user1', nickname: 'Alice' },
{ userId: 'user2', nickname: 'Bob' }
];
}
},
logLevel: LogLevel.INFO,
language: 'en_US',
allowedToRecallTime: 120,
allowedToReEditTime: 60,
modalContainerId: 'modal-container'
};

Hierarchy

  • ChatUIInitParams

Index

Properties

Service hooks for injecting user/group/system profile data

description

Provides callback functions to fetch profiles from your backend

logLevel?: LogLevel

Log output level, defaults to LogL.WARN(2)

language?: string

Initial language setting

description

If not provided or invalid, uses page lang attribute, defaults to en_US if undefined

allowedToRecallTime?: number

Maximum time allowed to recall sent messages, in seconds

description

Defaults to 120 seconds if not provided or invalid

allowedToReEditTime?: number

Maximum time allowed to re-edit recalled messages, in seconds

description

Defaults to 60 seconds if not provided or invalid

modalContainerId?: string

Modal container DOM element ID

description

Defaults to document.body if not provided