Index
Functions
Functions
Const applyTheme
-
Parameters
-
t: IThemeObject
Returns Promise<void>
-
Index
Functions
Functions
Const init
-
Init function arguments
Parameters
-
args: { accessToken?: string; clientId: string; endpoint?: string; logger?: boolean; nickName?: string; publishKey?: string; storageStrategy?: IStorageStrategy; syncStrategy?: Object; theme?: Object }
-
Optional access
Token?: string The accessToken of a userProfile that is already saved to instantiate the application with
-
client
Id: string clientId to instantiate the application with
-
Optional endpoint?: string
-
Optional logger?: boolean
Set true to enable debug console logs
-
Optional nick
Name?: string If userProfile is not already saved, pass a nickName that you want the new userProfile top be instantiated with
-
Optional publish
Key?: string Key used to enable message sending
-
Optional storage
Strategy?: IStorageStrategy The storageStrategy is used to get/set accessToken, profile and other objects inside the application. This defaults to local Storage
-
Optional sync
Strategy?: Object -
Optional theme?: Object
-
Returns Promise<unknown>
-
Index
Functions
Const createChatRoom
-
Creates a new chat room
Parameters
-
args: IChatRoomCreationArgs
Returns Promise<IChatRoomPayload>
-
Const getChatRoom
-
Gets chat room by roomId
Parameters
-
args: IChatRoomArgs
Returns Promise<IChatRoomPayload>
-
Const getChatRoomMemberships
-
Get list of users that are a 'member' of given chatroom.
Parameters
-
args: IChatRoomArgs
Returns Promise<IChatRoomMembershipsResponse>
-
Const getProfileChatRoomMemberships
-
Get list of chat rooms that the current user is a 'member' of.
Returns Promise<IProfileChatRoomMembershipResponse>
Const joinChatRoom
-
Join chat room by roomId, current user becomes 'member' and is available in chatroom membership list through
LiveLike.getChatRoomMemberships()
.Parameters
-
args: IChatRoomArgs
Returns Promise<boolean>
-
Const leaveChatRoom
-
Leave chat room by roomId, current user 'member' status removed from chatroom membership list through
LiveLike.getChatRoomMemberships()
.Parameters
-
args: IChatRoomArgs
Returns Promise<boolean>
-
Const updateChatRoom
-
Updates chat room by id
Parameters
-
roomId: string
-
args: IChatRoomCreationArgs
Returns Promise<IChatRoomPayload>
-
Index
Functions
Const getLeaderboard
-
Gets leaderboard detail from leaderboardId.
Parameters
-
args: ILeaderboardArgs
Returns Promise<ILeaderboardPayload>
-
Const getLeaderboardEntries
-
Gets leaderboard entries list from leaderboardId.
Parameters
-
args: ILeaderboardEntriesArgs
Returns Promise<ILeaderboardEntries>
Promise
-
Const getLeaderboardProfileRank
-
Gets leaderboard entry for a given profile in a given leaderboard.
Parameters
-
args: ILeaderboardRankArgs
Returns Promise<ILeaderboardRankPayload>
-
Const getLeaderboards
-
Gets leaderboard list for a given program.
Parameters
-
args: { programId: string }
-
program
Id: string
-
Returns Promise<ILeaderboardPayload[]>
-
Index
Functions
Const addMessageListener
-
Adds a listener to a chatroom that calls passed callback function when event fires.
Parameters
-
arg: IChatRoomArgs
-
callback: MessageListenerCallback
Returns Promise<void>
-
Const getMessageCount
-
getMessageCount Returns number of messages in chat room
Parameters
-
roomId: string
-
Optional time: { since: string | number | Date }
-
since: string | number | Date
Time to get messages since
-
Returns Promise<IMessageCount>
-
Const getMessageList
-
getMessageList Returns array of message objects
Parameters
-
roomId: string
-
Optional opts: IMessageListOptions
Returns Promise<IMessageListPayload>
-
Const prepareOutgoingChatMessage
-
Parameters
-
roomId: string
-
preparationCallback: MessagePreparationCallback
Returns (message: IMessageObject) => IMessageObject
-
-
Parameters
-
message: IMessageObject
Returns IMessageObject
-
-
-
Const removeMessageListener
-
Removes listener from chatroom
Parameters
-
arg: IChatRoomArgs
-
callback: MessageListenerCallback
Returns Promise<void>
-
Const sendMessage
-
sendMessage Send user message to chat room.
Parameters
-
args: ISendMessageArgs
Returns Promise<any>
-
Index
Functions
Functions
Const createUserProfile
-
Creates user profile. If no nickname argument is passed, a random nickname will be generated.
Parameters
-
args: { nickname?: string }
-
Optional nickname?: string
Optional nickname
-
Returns Promise<IUserProfile>
-
Const getUserProfile
-
Gets userProfile from accessToken.
Parameters
-
args: { accessToken: string }
-
access
Token: string userProfile access_token
-
Returns Promise<IUserProfile>
-
Const updateUserProfile
-
Updates profile by accessToken with optional changed nickname or custom_data.
Parameters
-
args: { accessToken: string; options?: { custom_data?: string; nickname?: string } }
-
access
Token: string userProfile access_token
-
Optional options?: { custom_data?: string; nickname?: string }
-
Optional custom_
data?: string Data saved to profile's custom_data property
-
Optional nickname?: string
The nickname to update the userProfile
-
-
Returns Promise<IUserProfile>
-
Index
Functions
Functions
Const getPostedWidgets
-
Get list of widgets that have already been posted.
Parameters
-
args: IPostedWidgetsArgs
Returns Promise<IPostedWidgetsPayload>
-
Const getWidget
-
Gets widget object from passed kind and id
Parameters
-
args: IWidgetCreationArgs
Returns Promise<IWidgetPayload>
-
Const registerWidgetMode
-
Registers a custom widget state transition mode. The name argument is used to pass to one of the widget instantiation methods to choose
Parameters
-
name: string
-
mode: WidgetMode
Returns any
-
Index
Interfaces
- Chat
Payload Channels - Choice
Item - IChat
Room Args - IChat
Room Creation Args - IChat
Room Membership - IChat
Room Memberships Response - IChat
Room Payload - IChat
Room Response - ILeaderboard
Args - ILeaderboard
Entries - ILeaderboard
Entries Args - ILeaderboard
Payload - ILeaderboard
Rank Args - ILeaderboard
Rank Payload - IMessage
Callback Struct - IMessage
Count - IMessage
List Options - IMessage
List Payload - IMessage
Listener Callback Args - IMessage
Menu Item - IMessage
Object - IMessage
Payload - IMessage
Reactions - IOptional
Mode - IPosted
Widgets Args - IPosted
Widgets Payload - IProfile
Auth - IProfile
Chat Room Membership - IProfile
Chat Room Membership Response - IPubnub
Config - IReaction
Object - IRequest
Options - IRewards
Item - ISend
Message Args - IStorage
Strategy - ITheme
Object - IUser
Profile - IWidget
Creation Args - IWidget
Display Args - IWidget
Life Cycle Args - IWidget
Mode Args - IWidget
Payload - IWidget
Response - IWidget
Timeout Args - Option
Item - Widget
Option Item
Type aliases
Type aliases
CustomWidgetRenderer
Type declaration
-
-
Parameters
-
__namedParameters: { IWidgetPayload: any }
-
IWidget
Payload: any
-
Returns HTMLElement | Node
-
-
MessageListenerCallback
Type declaration
-
-
Parameters
Returns unknown
-
MessagePreparationCallback
Type declaration
-
-
Parameters
-
message: IMessageObject
Returns IMessageObject
-
-
RegisterMenuArgs
Type declaration
-
-
Parameters
-
Optional message: Object
Returns IMessageMenuItem[]
-
-
Rewards
WidgetKind
WidgetMode
Type declaration
-
-
Parameters
-
args: IWidgetModeArgs
Returns void
-
-
applyTheme Dynamically change the theme
1.24.0