Index

Functions

Functions

Const applyTheme

  • applyTheme Dynamically change the theme

    async
    since

    1.24.0

    Parameters

    Returns Promise<void>


Index

Functions

Functions

Const init

  • init(args: { accessToken?: string; clientId: string; endpoint?: string; logger?: boolean; nickName?: string; publishKey?: string; storageStrategy?: IStorageStrategy; syncStrategy?: Object; theme?: Object }): Promise<unknown>
  • Init function arguments

    Parameters

    • args: { accessToken?: string; clientId: string; endpoint?: string; logger?: boolean; nickName?: string; publishKey?: string; storageStrategy?: IStorageStrategy; syncStrategy?: Object; theme?: Object }
      • Optional accessToken?: string

        The accessToken of a userProfile that is already saved to instantiate the application with

      • clientId: string

        clientId to instantiate the application with

      • Optional endpoint?: string
      • Optional logger?: boolean

        Set true to enable debug console logs

      • Optional nickName?: string

        If userProfile is not already saved, pass a nickName that you want the new userProfile top be instantiated with

      • Optional publishKey?: string

        Key used to enable message sending

      • Optional storageStrategy?: IStorageStrategy

        The storageStrategy is used to get/set accessToken, profile and other objects inside the application. This defaults to local Storage

      • Optional syncStrategy?: Object
      • Optional theme?: Object

    Returns Promise<unknown>


Index

Functions

Const createChatRoom

Const getChatRoom

Const getChatRoomMemberships

Const getProfileChatRoomMemberships

Const joinChatRoom

  • Join chat room by roomId, current user becomes 'member' and is available in chatroom membership list through LiveLike.getChatRoomMemberships().

    async
    since

    1.20

    Parameters

    Returns Promise<boolean>

Const leaveChatRoom

  • Leave chat room by roomId, current user 'member' status removed from chatroom membership list through LiveLike.getChatRoomMemberships().

    async
    since

    1.20

    Parameters

    Returns Promise<boolean>

Const updateChatRoom


Index

Functions

Const getLeaderboard

  • Gets leaderboard detail from leaderboardId.

    async
    since

    1.26.0

    example
    LiveLike.getLeaderboard({leaderboardId: string}).then(leaderboard => console.log(leaderboard))

    Parameters

    Returns Promise<ILeaderboardPayload>

Const getLeaderboardEntries

  • Gets leaderboard entries list from leaderboardId.

    async
    since

    1.26.0

    example
    LiveLike.getLeaderboardEntries({programId: string}).then(response => console.log(response))

    Parameters

    Returns Promise<ILeaderboardEntries>

    Promise

Const getLeaderboardProfileRank

  • Gets leaderboard entry for a given profile in a given leaderboard.

    async
    since

    1.26.0

    example
    LiveLike.getLeaderboardProfileRank({leaderboardId: string, profileId: string}).then(leaderboardEntry => console.log(leaderboardEntry))

    Parameters

    Returns Promise<ILeaderboardRankPayload>

Const getLeaderboards

  • Gets leaderboard list for a given program.

    async
    since

    1.26.0

    example
    LiveLike.getLeaderboards({programId: string}).then(leaderboards => console.log(leaderboards))

    Parameters

    • args: { programId: string }
      • programId: string

    Returns Promise<ILeaderboardPayload[]>


Index

Functions

Const addMessageListener

  • Adds a listener to a chatroom that calls passed callback function when event fires.

    since

    1.18.0

    example
    addMessageListener({roomId: string}, function(e){console.log(e)})

    Parameters

    Returns Promise<void>

Const getMessageCount

  • getMessageCount(roomId: string, time?: { since: string | number | Date }): Promise<IMessageCount>
  • getMessageCount Returns number of messages in chat room

    async
    example
    messageCount('c1f6082c-f7b9-4d1e-b64e-9071a3860ffc', {since: "2020-04-16T16:29:39.158Z"}).then(r => console.log(r.count))

    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

    async
    example
    messageList({roomId: string}).then(list => console.log(list))

    Parameters

    Returns Promise<IMessageListPayload>

Const prepareOutgoingChatMessage

Const removeMessageListener

  • Removes listener from chatroom

    since

    1.18.0

    example
    removeMessageListener({roomId: string}, function(e){console.log(e)})

    Parameters

    Returns Promise<void>

Const sendMessage


Index

Functions

Const createUserProfile

  • createUserProfile(args: { nickname?: string }): Promise<IUserProfile>
  • Creates user profile. If no nickname argument is passed, a random nickname will be generated.

    async
    since

    1.18.0

    example
    createUserProfile({ nickname: 'Test Nickname' }).then(profile => console.log(profile))

    Parameters

    • args: { nickname?: string }
      • Optional nickname?: string

        Optional nickname

    Returns Promise<IUserProfile>

Const getUserProfile

  • getUserProfile(args: { accessToken: string }): Promise<IUserProfile>
  • Gets userProfile from accessToken.

    async
    since

    1.18.0

    example
    getUserProfile({ accessToken }).then(profile => console.log(profile))

    Parameters

    • args: { accessToken: string }
      • accessToken: string

        userProfile access_token

    Returns Promise<IUserProfile>

Const updateUserProfile

  • updateUserProfile(args: { accessToken: string; options?: { custom_data?: string; nickname?: string } }): Promise<IUserProfile>
  • Updates profile by accessToken with optional changed nickname or custom_data.

    async
    since

    1.18.0

    example
    const options = {nickname: 'New Nickname'}
    updateUserProfile({accessToken, options}).then(profile => console.log(profile))

    Parameters

    • args: { accessToken: string; options?: { custom_data?: string; nickname?: string } }
      • accessToken: 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

Const getPostedWidgets

Const getWidget

Const registerWidgetMode

  • registerWidgetMode(name: string, mode: WidgetMode): any
  • Registers a custom widget state transition mode. The name argument is used to pass to one of the widget instantiation methods to choose

    since

    1.18.0

    Parameters

    Returns any


Index

Type aliases

CustomWidgetRenderer

CustomWidgetRenderer: (__namedParameters: { IWidgetPayload: any }) => HTMLElement | Node

Type declaration

    • (__namedParameters: { IWidgetPayload: any }): HTMLElement | Node
    • Parameters

      • __namedParameters: { IWidgetPayload: any }
        • IWidgetPayload: any

      Returns HTMLElement | Node

MessageListenerCallback

MessageListenerCallback: (args: IMessageListenerCallbackArgs) => unknown

Type declaration

MessagePreparationCallback

MessagePreparationCallback: (message: IMessageObject) => IMessageObject

Type declaration

RegisterMenuArgs

RegisterMenuArgs: (message?: Object) => IMessageMenuItem[]

Type declaration

Rewards

Rewards: IRewardsItem[]

WidgetKind

WidgetKind: "alert" | "text-poll" | "image-poll" | "text-quiz" | "image-quiz" | "text-prediction" | "text-prediction-follow-up" | "image-prediction" | "image-prediction-follow-up" | "cheer-meter" | "social-embed" | "image-slider" | "rich-post"

WidgetMode

WidgetMode: (args: IWidgetModeArgs) => void

Type declaration