Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Namespaces

Enumerations

Interfaces

Type aliases

Variables

Functions

Type aliases

ChatRoomApiStreamEventDetails

CreateWidgetInteractionItemProp

DateTime

DateTime: Date | string | number

IChatMessageRequestPayload

IChatMessageResponsePayload

IChatRoomApiStreamResponse

IChatUserMessageResponsePayload

IChatUserMessageResponsePayload: IMessageResponsePayload | IQuoteMessageResponsePayload

IMessageListIteratorResult

IMessageListIteratorResult: Promise<IteratorResult<{ messages: IChatMessageResponsePayload[] }, { messages: IChatMessageResponsePayload[] }>>

IQuoteMessagePropType

IQuoteMessagePropType: IMessageResponsePayload | Omit<IQuoteMessageResponsePayload, "quote_message" | "reactions">

IQuoteMessageRequestPayload

IQuoteMessageRequestPayload: IQuoteMessagePayload & IMessageRequestPayload

IQuoteMessageResponsePayload

IQuoteMessageResponsePayload: IQuoteMessagePayload & IMessageResponsePayload

InteractiveWidgetKind

InteractiveWidgetKind: typeof interactiveWidgets[number]

ListenerFn

ListenerFn<TEvent, TMessage>: (msg: ListenerEventMessage<TEvent, TMessage>) => void

Type parameters

  • TEvent = any

  • TMessage = any

Type declaration

MessageListenerCallback

MessageListenerCallback: (args: IMessageListenerCallbackArgs) => unknown

Type declaration

MessagePreparationCallback

MessagePreparationCallback: (message: IMessageResponse) => IMessageResponse

Type declaration

ProgramListenerCallback

ProgramListenerCallback: (args: IProgramListenerCallbackArgs) => unknown

Type declaration

ReactionSpaceEventListenerMap

ReactionSpaceEventListenerMap: { reaction-space-updated: ListenerFn<UPDATE_REACTION_SPACE, IReactionSpace>; user-reaction-added: ListenerFn<ADD_REACTION, IUserReaction>; user-reaction-removed: ListenerFn<REMOVE_REACTION, IUserReaction> }

Type declaration

SdkEventListenerMap

SdkEventListenerMap: { INITIALISED: any }

Type declaration

SubscriptionEvent

SubscriptionEventEnums

SubscriptionEventEnums: typeof Events

SubscriptionEventListenerFn

SubscriptionEventListenerFn: ListenerFn<SubscriptionEvent, any>

SubscriptionEventValuesOf

SubscriptionEventValuesOf<E>: E[keyof E]

Type parameters

  • E

VideoRoomEventListenerMap

VideoRoomEventListenerMap<ListenerArgs>: { ERROR: any; PARTICIPANT_JOIN: any; PARTICIPANT_LEFT: any; RECONNECTING: any }

Type parameters

Type declaration

  • ERROR:function
    • ERROR(errorDetails: ListenerArgs["errorDetails"]): void
    • Parameters

      • errorDetails: ListenerArgs["errorDetails"]

      Returns void

  • PARTICIPANT_JOIN:function
    • PARTICIPANT_JOIN(participant: ListenerArgs["participant"]): void
    • Parameters

      • participant: ListenerArgs["participant"]

      Returns void

  • PARTICIPANT_LEFT:function
    • PARTICIPANT_LEFT(participant: ListenerArgs["participant"]): void
    • Parameters

      • participant: ListenerArgs["participant"]

      Returns void

  • RECONNECTING:function
    • RECONNECTING(): void
    • Returns void

WidgetListenerCallback

WidgetListenerCallback: (args: IWidgetListenerCallbackArgs) => unknown

Type declaration

Variables

CHOICE_WIDGET_KIND

CHOICE_WIDGET_KIND: WidgetKind[] = ...

ChatUserMessageEventType

ChatUserMessageEventType: readonly [MESSAGE_CREATED, IMAGE_CREATED, MESSAGE_DELETED, IMAGE_DELETED, CHATROOM_UPDATED] = ...

Events

Events: { ADDED: "reactionadded"; DELETED: "messagedeleted"; FAILED: "messagefailed"; MESSAGES: "messagehistory"; RECEIVED: "messagereceived"; REMOVED: "reactionremoved"; ROOMENTER: "roomentered"; ROOMEXIT: "roomexited"; SENT: "messagesent"; UPDATED: "messageupdated" } = ...

Type declaration

  • ADDED: "reactionadded"
  • DELETED: "messagedeleted"
  • FAILED: "messagefailed"
  • MESSAGES: "messagehistory"
  • RECEIVED: "messagereceived"
  • REMOVED: "reactionremoved"
  • ROOMENTER: "roomentered"
  • ROOMEXIT: "roomexited"
  • SENT: "messagesent"
  • UPDATED: "messageupdated"

InteractableWidgetKind

MessageEvents

MessageEvents: { added: "reactionadded"; chatroom-updated: "chatroom-updated"; custom-message-created: "messagereceived"; image-created: "messagereceived"; image-deleted: "messagedeleted"; message-created: "messagereceived"; message-deleted: "messagedeleted"; message-sent: "messagesent"; message-updated: "messageupdated"; removed: "reactionremoved" } = ...

Type declaration

  • added: "reactionadded"
  • chatroom-updated: "chatroom-updated"
  • custom-message-created: "messagereceived"
  • image-created: "messagereceived"
  • image-deleted: "messagedeleted"
  • message-created: "messagereceived"
  • message-deleted: "messagedeleted"
  • message-sent: "messagesent"
  • message-updated: "messageupdated"
  • removed: "reactionremoved"

PREDICTION_FOLLOW_UP_TO_PREDICTION

PREDICTION_FOLLOW_UP_TO_PREDICTION: { image-number-prediction-follow-up: WidgetKind; image-prediction-follow-up: WidgetKind; text-prediction-follow-up: WidgetKind } = ...

Type declaration

PREDICTION_FOLLOW_UP_WIDGET_KIND

PREDICTION_FOLLOW_UP_WIDGET_KIND: WidgetKind[] = ...

PREDICTION_ID_PROP

PREDICTION_ID_PROP: { image-number-prediction-follow-up: string; image-prediction-follow-up: string; text-prediction-follow-up: string } = ...

Type declaration

  • image-number-prediction-follow-up: string
  • image-prediction-follow-up: string
  • text-prediction-follow-up: string

PREDICTION_WIDGET_KIND

PREDICTION_WIDGET_KIND: WidgetKind[] = ...

UNSUPPORTED_UPDATE_INTERACTION_WIDGET_KINDS

UNSUPPORTED_UPDATE_INTERACTION_WIDGET_KINDS: WidgetKind[] = ...

WIDGET_RESULTS

WIDGET_RESULTS: { CHEER_METER: "cheer-meter-results"; EMOJI_SLIDER: "emoji-slider-results"; IMAGE_POLL: "image-poll-results"; IMAGE_QUIZ: "image-quiz-results"; TEXT_POLL: "text-poll-results"; TEXT_QUIZ: "text-quiz-results" } = ...

Type declaration

  • CHEER_METER: "cheer-meter-results"
  • EMOJI_SLIDER: "emoji-slider-results"
  • IMAGE_POLL: "image-poll-results"
  • IMAGE_QUIZ: "image-quiz-results"
  • TEXT_POLL: "text-poll-results"
  • TEXT_QUIZ: "text-quiz-results"

WidgetResults

WidgetResults: ("emoji-slider-results" | "cheer-meter-results" | "text-poll-results" | "image-poll-results" | "text-quiz-results" | "image-quiz-results")[] = ...

_$$

_$$: IApiGlobal = ...

_config

_config: { apiDocVersion: string; ready: boolean; version: string } = ...

Type declaration

  • apiDocVersion: string
  • ready: boolean
  • version: string

chatUserMessageEvents

chatUserMessageEvents: ChatMessageEvent[] = ...

interactiveWidgets

subscriptionCoordinator

subscriptionCoordinator: { addListener: (channel: string, callback: SubscriptionEventListenerFn, event?: SubscriptionEvent) => void; initialisePubnub: (pnConfig: IPubnubConfig) => void; listeners: Record<string, SubscriptionEventListenerFn[]>; removeAllListenersForEvent: (channel: string, event: SubscriptionEvent) => Record<string, SubscriptionEventListenerFn[]>; removeListener: (channel: string, callback: SubscriptionEventListenerFn, event?: SubscriptionEvent) => Record<string, SubscriptionEventListenerFn[]>; subscribe: (channel: any) => void; unsubscribe: (channel: any) => void } = ...

Type declaration

userProfile

userProfile: IUserProfile = ...

widgetEndPhase

widgetEndPhase: WidgetPhase[] = ...

widgetKindVote

widgetKindVote: { cheer-meter: string; emoji-slider: string; image-number-prediction: string; image-poll: string; image-prediction: string; image-quiz: string; text-ask: string; text-number-prediction: string; text-poll: string; text-prediction: string; text-quiz: string } = ...

Type declaration

  • cheer-meter: string
  • emoji-slider: string
  • image-number-prediction: string
  • image-poll: string
  • image-prediction: string
  • image-quiz: string
  • text-ask: string
  • text-number-prediction: string
  • text-poll: string
  • text-prediction: string
  • text-quiz: string

Functions

addChatRoomEventListener

  • addChatRoomEventListener<_Event, _EventListener>(chatRoomEvent: _Event, listenerFn: _EventListener, options: IChatRoomEventListenerOptions): Promise<void>

Const addMessageListener

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

    since

    0.1.0

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

    Parameters

    Returns Promise<void>

addNewMemberToChatRoom

  • description

    Add new member to the chat room (requires roomId and profileId)

    async
    since

    0.1.0

    example
    addNewMemberToChatRoom({
    roomId: "9e6f1bc4-9f02-4c57-92b7-7521d0f5b027",
    profileId: "aa7e03fc-01f0-4a98-a2e0-3fed689632d7"
    }).then(membership => console.log(membership))

    Parameters

    Returns Promise<IChatRoomMembership>

    Promise

Const addProgramListener

  • Add a program listener to get program updates including widgets published from produce suite

    since

    0.1.0

    example
    function programListener({event, message}){
    // your custom logic
    }
    addProgramListener({
    programId: "<Your program Id>"
    }, programListener)

    Parameters

    Returns Promise<void>

addReactionSpaceEventListener

  • addReactionSpaceEventListener<_Event, _EventListener>(eventArg: IReactionEventArg<_Event>, listenerFn: _EventListener): Promise<void>

addSdkEventListener

  • addSdkEventListener<_Event, ListenerFn>(sdkEvent: _Event, listenerFn: ListenerFn): void
  • description

    Add listener for a given SdkEvent

    since

    0.1.0

    example
    addSdkEventListener(SdkEvent.INITIALISED, function onSdkInitialisation(userProfile){
    console.log(userProfile);
    })

    Type parameters

    Parameters

    • sdkEvent: _Event
    • listenerFn: ListenerFn

    Returns void

addUserProfileEventListener

  • description

    Add listener for the given UserProfileEvent

    since

    0.1.0

    example
    addUserProfileEventListener(UserProfileEvent.BLOCK_PROFILE, function onBlockProfileListener(blockInfo){
    console.log(blockInfo);
    })

    Parameters

    Returns void

addUserReaction

  • description

    Add a user reaction

    async
    since

    0.1.0

    example
    addUserReaction({
    targetId: "target-1",
    reactionSpaceId: "aa7e03fc-01f0-4a98-a2e0-3fed689632d7",
    reactionId: "0fddc166-b8c3-4ce9-990e-848bde12188b"
    }).then(reaction => console.log(reaction))

    Parameters

    Returns Promise<IUserReaction>

Const addWidgetListener

  • Add a widget listener

    since

    0.1.0

    example
    function widgetListener({event, message}){
    // your custom logic
    }
    addWidgetListener({
    widgetId: "<Your widget Id>",
    widgetKind: "<Your widget kind>"
    }, widgetListener)

    Parameters

    Returns Promise<void>

blockProfile

  • description

    Block profile using profile Id

    async
    since

    0.1.0

    example
    blockProfile({profileId: "aa7e03fc-01f0-4a98-a2e0-3fed689632d7"}).then(blockInfo => console.log(blockInfo))
    

    Parameters

    Returns Promise<IBlockInfo>

Const claimPredictionWidgetRewards

  • Claim prediction widget reward for the prediction submitted by the user. This could be used when prediction followup widget is published/rendered

    since

    0.1.0

    async
    example
    claimPredictionWidgetRewards({
    widgetId: "xxxx",
    widgetKind: "<widget kind>"
    }).then(predictionClaim => console.log(predictionClaim))

    Parameters

    Returns Promise<IPredictionClaim>

Const createChatRoom

  • description

    Creates a new chat room

    async
    since

    0.1.0

    • createChatRoom({title: "Chat room name", content_filter: "filtered", visibility: "everyone"})
      

    Parameters

    Returns Promise<IChatRoomPayload>

    Promise

createCommentBoard

  • description

    Create comment board

    async
    since

    2.38.0

    example
     createCommentBoard({'title': 'sd','customId':'postid1','repliesDepth':2,'allowComments':true,'description': 'desc','customData':'abc'}).then(commentBoard => console.log(commentBoard));
    

    Parameters

    Returns Promise<ICommentBoard>

createReactionSpace

  • description

    Create a reaction space

    async
    since

    0.1.0

    example
    createReactionSpace({
    targetGroupId: "target-group-1",
    reactionPackIds: ["aa7e03fc-01f0-4a98-a2e0-3fed689632d7", "0fddc166-b8c3-4ce9-990e-848bde12188b"]
    }).then(reactionSpace => console.log(reactionSpace))

    Parameters

    Returns Promise<IReactionSpace>

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

    0.1.0

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

    Parameters

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

        Optional nickname

    Returns Promise<IUserProfile>

Const createWidgetImpression

  • Create widget impression used for analytics purposes for eg: analyse how many total users a given widget has reached

    since

    0.1.0

    example
    createWidgetImpression({
    widgetId: "<Your widget Id>",
    widgetKind: "<Your widget kind>"
    })

    Parameters

    Returns Promise<IWidgetImpression>

Const createWidgetInteraction

  • Create a widget interaction

    since

    0.1.0

    example
    createWidgetInteraction({
    widgetId: "<Your widget Id>",
    widgetKind: "<widget kind>",
    interactionItem: selectedPollOptionItem
    })

    Parameters

    Returns Promise<IWidgetInteraction>

deleteChatRoomInvitation

  • description

    Delete chat room invitation

    params

    args of type IDeleteChatRoomInvitation

    async
    since

    0.1.0

    example
    deleteChatRoomInvitation({
    invitationId: "28cc0ceb-8934-48cd-abc5-4d3a3a681c1b",
    }).then(res => console.log(res))

    Parameters

    Returns Promise<void>

    Promise

deleteCommentBoard

  • description

    Delete a comment board

    async
    since

    2.38.0

    example
    deleteCommentBoard({
    commentBoardId: "aa7e03fc-01f0-4a98-a2e0-3fed689632d7",
    })

    Parameters

    Returns Promise<null>

Const deleteMessage

  • description

    Delete a chatroom message using messageId

    since

    0.1.0

    async
    example
    deleteMessage({
    roomId: "a147f914-d474-4cfb-81c6-4099404c435a",
    messageId: "dd810f9f-09d5-4c6b-a0df-e43dee9b2994"
    }).then((res) => console.log(res))

    Parameters

    Returns Promise<void>

deleteReactionSpace

  • description

    Delete a reaction space

    async
    since

    0.1.0

    example
    deleteReactionSpace({
    reactionSpaceId: "aa7e03fc-01f0-4a98-a2e0-3fed689632d7",
    })

    Parameters

    Returns Promise<null>

Const getApplicationBadges

  • description

    Get Application Badges.

    async
    since

    0.1.0

    example
    getApplicationBadges().then(padinatedResponse => console.log(padinatedResponse.results))
    

    Returns Promise<IPaginatedResponse<IBadge>>

Const getApplicationSponsors

  • description

    Get sponsors list for a given application.

    async
    since

    0.1.0

    example
    getApplicationSponsors().then(paginatedSponsors => console.log(paginatedSponsors.results))
    

    Returns Promise<IPaginatedResponse<ISponsorPayload>>

getBadgeProfiles

  • description

    Get profiles for a given badge.

    async
    since

    0.1.0

    example
    getBadgeProfiles({
    badgeId: "dd810f9f-09d5-4c6b-a0df-e43dee9b2994"
    }).then(res => console.log(res))

    Parameters

    • args: { badgeId: string }
      • badgeId: string

    Returns Promise<IPaginatedResponse<IBadgeProfile>>

Const getBadgeProgress

  • getBadgeProgress(args: { badgeIds: string[]; profileId: string }): Promise<IBadgeProgress[]>
  • description

    Get Progress of Badges for a given profileId.

    async
    since

    0.1.0

    example
    getBadgeProgress({
    profileId: "xxxxx",
    badgeIds: [ "yyyyy", "zzzzz" ]
    }).then(res => console.log(res))

    Parameters

    • args: { badgeIds: string[]; profileId: string }
      • badgeIds: string[]
      • profileId: string

    Returns Promise<IBadgeProgress[]>

getBlockInfoList

  • description

    Get Block Info list containing list of block info of all the blocked profile

    async
    since

    0.1.0

    example
    getBlockInfoList().then(paginatedBlockInfo => console.log(paginatedBlockInfo))
    

    Returns Promise<IPaginatedResponse<IBlockInfo>>

getBlockedProfileIds

  • description

    Get list of blocked profile ids, could be used to filter chat messages by blocked profile

    async
    since

    0.1.0

    example
    getBlockedProfileIds().then(profileIds => console.log(profileIds))
    

    Returns Promise<IPaginatedResponse<string>>

Const getChatRoom

  • description

    Gets chat room by roomId

    async
    since

    0.1.0

    getChatRoom({roomId: 'c1f6082c-f7b9-4d1e-b64e-9071a3860ffc'}).then((res) => console.log(res))
    

    Parameters

    Returns Promise<IChatRoomPayload>

    Promise

Const getChatRoomMemberships

Const getChatRoomSponsors

  • description

    Get sponsors list for a given chatroom.

    async
    since

    0.1.0

    example
    getChatRoomSponsors({
    roomId: string
    }).then(paginatedSponsors => console.log(paginatedSponsors.results))

    Parameters

    • args: { roomId: string }
      • roomId: string

    Returns Promise<IPaginatedResponse<ISponsorPayload>>

Const getChatRooms

  • description

    Get all avaliable chat rooms in an application

    async
    since

    0.1.0

    example
    getChatRooms().then(paginatedResponse => console.log(paginatedResponse))
    

    Returns Promise<IPaginatedResponse<IChatRoomPayload>>

    paginated response with results as an array of chat room details

Const getChatUserMutedStatus

  • description

    Gets the muted status of the current user for a given chat room

    async
    since

    0.1.0

    Parameters

    Returns Promise<IMutedResponse>

    Promise - true if muted else false

getCommentBoardDetails

  • description

    Get comment board details

    async
    since

    2.38.0

    example
    getCommentBoardDetails({ commentBoardId: "aa7e03fc-01f0-4a98-a2e0-3fed689632d7"}).then(({results}) => console.log(results))
    

    Parameters

    Returns Promise<ICommentBoard>

getCommentBoards

  • description

    Get list of comment boards in an application

    async
    since

    2.38.0

    example
    getCommentBoards().then(({results}) => console.log(results))
    

    Returns Promise<IPaginatedResponse<ICommentBoard>>

getGifs

  • description

    Get list of gifs images

    async
    since

    0.1.0

    example
    getGifs({search: "thank you"}).then(({results}) => console.log(results))
    

    Parameters

    Returns Promise<IPaginatedResponse<IGif>>

    paginated response with results as an array of IGif

Const getLeaderboard

  • description

    Gets leaderboard detail from leaderboardId.

    async
    since

    0.1.0

    example
    getLeaderboard({ leaderboardId: "xxxxxx" }).then(leaderboard => console.log(leaderboard))
    

    Parameters

    Returns Promise<ILeaderboardPayload>

Const getLeaderboardEntries

  • description

    Gets list of leaderboard entries from leaderboardId.

    async
    since

    0.1.0

    example
    getLeaderboardEntries({
    programId: "xxxxx"
    }).then(paginatedResponse => console.log(paginatedResponse.results))

    Parameters

    Returns Promise<IPaginatedResponse<ILeaderboardRankPayload>>

Const getLeaderboardProfileRank

  • description

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

    async
    since

    0.1.0

    example
    getLeaderboardProfileRank({
    leaderboardId: "xxxxx",
    profileId: "yyyyy"
    }).then(leaderboardEntry => console.log(leaderboardEntry))

    Parameters

    Returns Promise<ILeaderboardRankPayload>

Const getLeaderboards

  • description

    Gets leaderboard list for a given program.

    async
    since

    0.1.0

    example
    getLeaderboards({ programId: "xxxxx" }).then(leaderboards => console.log(leaderboards))
    

    Parameters

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

    Returns Promise<ILeaderboardPayload[]>

Const getMessageCount

  • getMessageCount Returns number of messages in chat room

    since

    0.1.0

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

    Parameters

    Returns Promise<IMessageCount>

Const getMessageList

  • getMessageList Returns array of message objects

    since

    0.1.0

    async
    example
    getMessageList(roomId: string).then(list => console.log(list))
    

    Parameters

    Returns Promise<IMessageListPayload>

Const getMilliseconds

  • getMilliseconds(duration: any): number
  • Converts ISO8601 format duration into milliseconds (PYYYYMMDDThhmmss) Example of duration - P3Y6M4DT12H30M5S

    Parameters

    • duration: any

      Time duration in ISO8601 format

    Returns number

    duration in milliseconds

Const getPostedWidgets

  • Get list of widgets that have already been posted.

    async
    since

    0.1.0

    example
    getPostedWidgets({
    programId: "<your program id>"
    }).then((res) => console.log(res))

    Parameters

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

    Returns Promise<IPostedWidgetsPayload>

Const getProfileBadges

  • description

    Get badges for a given userProfile.

    async
    since

    0.1.0

    example
    getProfileBadges({
    profileId: "xxxxxx"
    }).then(paginatedResponse => console.log(paginatedResponse.results))

    Parameters

    • args: { profileId: string }
      • profileId: string

        userProfile ID

    Returns Promise<IPaginatedResponse<IProfileBadge>>

getProfileBlockInfo

  • description

    Get Block Info for given profile id if exists

    async
    since

    0.1.0

    example
    getProfileBlockInfo({profileId: "aa7e03fc-01f0-4a98-a2e0-3fed689632d7"}).then(blockInfo => console.log(blockInfo))
    

    Parameters

    Returns Promise<IBlockInfo | undefined>

Const getProfileChatRoomMemberships

Const getProfileLeaderboardViews

  • description

    Get list of leaderboard views in which a given profile is part of. If no profileId is passed, get current profile leaderboard views.

    async
    since

    0.1.0

    example
    getProfileLeaderboardViews({
    profileId: "<profile-id>"
    }).then(paginatedLeaderboardviews => console.log(paginatedLeaderboardviews))

    Parameters

    Returns Promise<IPaginatedResponse<IProfileLeaderboardView>>

Const getProfileLeaderboards

  • description

    Get list of leaderboard in which a given profile is part of. If no profileId is passed, get current profile leaderboards.

    async
    since

    0.1.0

    example
    getProfileLeaderboards({
    profileId: "<profile-id>"
    }).then(paginatedLeaderboards => console.log(paginatedLeaderboards.results))

    Parameters

    Returns Promise<IPaginatedResponse<IProfileLeaderboard>>

Const getProgramSponsors

  • description

    Get sponsors list for a given program.

    async
    since

    0.1.0

    example
    getProgramSponsors({
    programId: string
    }).then(paginatedSponsors => console.log(paginatedSponsors.results))

    Parameters

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

    Returns Promise<IPaginatedResponse<ISponsorPayload>>

getReactionPackDetail

  • description

    Get reaction pack detail with collection of reactions using a reaction pack Id

    async
    since

    0.1.0

    example
    getReactionPackDetail({
    reactionPackId: "aa7e03fc-01f0-4a98-a2e0-3fed689632d7",
    }).then(reactionPack => console.log(reactionPack))

    Parameters

    Returns Promise<IReactionPack>

getReactionPacks

  • description

    Get list of reaction packs in an application

    async
    since

    0.1.0

    example
    getReactionPacks().then(({results}) => console.log(results))
    

    Returns Promise<IPaginatedResponse<IReactionPack>>

getReactionSpaceDetail

  • description

    Get reaction space detail from reactionSpaceId or targetGroupId

    async
    since

    0.1.0

    example
    getReactionSpaceDetail({
    reactionSpaceId: "aa7e03fc-01f0-4a98-a2e0-3fed689632d7",
    }).then(reactionSpace => console.log(reactionSpace))

    OR

    getReactionSpaceDetail({
    targetGroupId: "target-group-1",
    }).then(reactionSpace => console.log(reactionSpace))

    Parameters

    Returns Promise<IReactionSpace>

getReactionSpaces

  • description

    Get list of reaction spaces in an application

    async
    since

    0.1.0

    example
    getReactionSpaces().then(({results}) => console.log(results))
    

    Returns Promise<IPaginatedResponse<IReactionSpace>>

getReceivedChatRoomInvitations

  • description

    Get list of chat room invitations received by the current user profile

    params

    args of type IGetInvitationsArgs

    async
    since

    0.1.0

    example
    getReceivedChatRoomInvitations({
    invitationStatus: ChatRoomInvitationStatus.PENDING
    }).then(paginatedInvitations => console.log(paginatedInvitations))

    Parameters

    Returns Promise<IPaginatedResponse<IChatRoomInvitation>>

    Promise<IPaginatedResponse>

getSentChatRoomInvitations

  • description

    Get list of chat room invitations sent by the current user profile

    params

    args of type IGetInvitationsArgs

    async
    since

    0.1.0

    example
    getSentChatRoomInvitations({
    invitationStatus: ChatRoomInvitationStatus.PENDING
    }).then(paginatedInvitations => console.log(paginatedInvitations))

    Parameters

    Returns Promise<IPaginatedResponse<IChatRoomInvitation>>

    Promise<IPaginatedResponse>

getStickerPackDetail

  • description

    Get sticker pack detail with collection of stickers using a stickerPackId

    async
    since

    0.1.0

    example
    getStickerPackDetail({
    stickerPackId: "aa7e03fc-01f0-4a98-a2e0-3fed689632d7",
    }).then(stickerPack => console.log(stickerPack))

    Parameters

    Returns Promise<IStickerPack>

getStickerPacks

  • description

    Get list of sticker packs in an application

    async
    since

    0.1.0

    example
    getStickerPacks().then(({results}) => console.log(results))
    

    Returns Promise<IPaginatedResponse<IStickerPack>>

    paginated response with results as an array of IStickerPack

Const getUnclaimedWidgetInteractionsRewards

  • description

    Get unclamed widget interaction rewards for a given program

    since

    0.1.0

    async
    example
    getUnclaimedWidgetInteractionsRewards({
    programId: "xxxxxx"
    }).then(res => console.log(res))

    Parameters

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

    Returns Promise<IPaginatedResponse<IUnclaimedWidgetInteraction>>

getUpdatedWidgetInteraction

Const getUserProfile

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

    async
    since

    0.1.0

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

    Parameters

    • args: { accessToken?: string; profileId?: string }
      • Optional accessToken?: string
      • Optional profileId?: string

    Returns Promise<IUserProfile>

getUserReactions

  • description

    Get list of user reaction based on argument object filters

    async
    since

    0.1.0

    example
    getUserReactions({
    reactionSpaceId: "aa7e03fc-01f0-4a98-a2e0-3fed689632d7",
    targetId: "0fddc166-b8c3-4ce9-990e-848bde12188b"
    }).then(paginatedReactions => console.log(paginatedReactions))

    Parameters

    Returns Promise<IPaginatedResponse<IUserReaction>>

getUserReactionsCount

  • description

    get count of user reactions for a given collection of target in a reaction space

    async
    since

    0.1.0

    example
    getUserReactionsCount({
    reactionSpaceId: "aa7e03fc-01f0-4a98-a2e0-3fed689632d7",
    targetIds: ["0fddc166-b8c3-4ce9-990e-848bde12188b"],
    }).then(reaction => console.log(reaction))

    Parameters

    Returns Promise<IPaginatedResponse<IReactionsCount>>

Const getWidget

  • Get a widget based on widget kind and widget id

    async
    since

    0.1.0

    example
    getWidget({
    widgetId: "<Your widget Id>",
    widgetKind: "<Your widget kind>"
    }).then(widgetPayload => console.log(widgetPayload))

    Parameters

    Returns Promise<IWidgetPayload>

Const getWidgetInteractions

  • Get widget interactions based on programId, widgetId & widgetKind

    since

    0.1.0

    async
    example
    getWidgetInteractions({
    programId: "<your program Id>",
    widgetId: "xxxx",
    widgetKind: WidgetKind.TEXT_POLL,
    }).then(interactions => console.log(interactions))

    Parameters

    Returns Promise<IWidgetInteraction[]>

Const getWidgets

  • description

    Get paginated list of widgets filtered by widget status and kind

    since

    0.1.0

    example
    getWidgets({
    programId: "xxxx",
    status: "pending",
    widgetKinds: ["text-poll"],
    ordering: "recent",
    interactive: true,
    since: "2022-05-26T12:41:27.463Z"
    }).then(res => console.log(res));

    Parameters

    Returns Promise<IPaginatedResponse<IWidgetPayload>>

Const getWidgetsInteractions

  • Get collection of widget interactions based on interaction url or an array of widget id or an array of widget kinds

    since

    0.1.0

    async
    example
    getWidgetsInteractions({
    interactionUrl: "<url>"
    }).then(interactions => console.log(interactions))

    // OR
    getWidgetsInteractions({
    programId: "<program-id>",
    widgets: [{
    kind: WidgetKind.TEXT_POLL,
    id: "<widget-id>"
    }]
    }).then(interactions => console.log(interactions))

    // OR
    getWidgetsInteractions({
    programId: "<program-id>",
    widgetKinds: [ WidgetKind.TEXT_POLL, WidgetKind.TEXT_PREDICTION ]
    }).then(interactions => console.log(interactions))

    Parameters

    Returns Promise<IWidgetKindInteractionsMap>

hasDebugLogger

  • hasDebugLogger(): boolean
  • Returns boolean

init

isChatMessageResponsePayload

isChatUserMessageResponsePayload

isCustomMessageResponsePayload

isNumberPredictionItem

isQuoteMessagePayload

isSliderInteractionItem

isTextAskInteractionItem

isWidgetChoiceItem

isWidgetOptionItem

Const joinChatRoom

  • description

    Join chat room by roomId, current user becomes 'member' and is available in chatroom membership list

    async
    since

    0.1.0

    example
    joinChatRoom({roomId: 'c1f6082c-f7b9-4d1e-b64e-9071a3860ffc'})
    

    Parameters

    Returns Promise<IChatRoomMembership>

    Promise

Const leaveChatRoom

  • description

    Leave chat room by roomId, current user 'member' status removed from chatroom membership list

    async
    since

    0.1.0

    example
    leaveChatRoom({roomId: 'c1f6082c-f7b9-4d1e-b64e-9071a3860ffc'})
    

    Parameters

    Returns Promise<boolean>

    Promise - true if leaved else false

Const prepareOutgoingChatMessage

removeChatRoomEventListener

  • removeChatRoomEventListener<_Event, _EventListener>(chatRoomEvent: _Event, listenerFn: _EventListener, options: IChatRoomEventListenerOptions): Promise<void>

Const removeMessageListener

  • Removes listener from chatroom

    since

    0.1.0

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

    Parameters

    Returns Promise<void>

Const removeProgramListener

  • Remove a program listenerFn

    since

    0.1.0

    example
    function programListener({event, message}){
    // your custom logic
    }
    removeProgramListener({
    programId: "<Your program Id>"
    }, programListener)

    Parameters

    Returns Promise<void>

removeReactionSpaceEventListener

  • removeReactionSpaceEventListener<_Event, _EventListener>(eventArg: IReactionEventArg<_Event>, listenerFn?: _EventListener): Promise<void>

removeSdkEventListener

  • removeSdkEventListener<_Event, ListenerFn>(sdkEvent: _Event, listenerFn: ListenerFn): void
  • description

    Remove registered listenerFn for the given SdkEvent, when no listener passed, all registered event listener will be removed

    since

    0.1.0

    example
    removeSdkEventListener(SdkEvent.INITIALISED, onSdkInitialisation);
    

    Type parameters

    Parameters

    • sdkEvent: _Event
    • listenerFn: ListenerFn

    Returns void

removeUserProfileEventListener

  • description

    Remove registered listenerFn for the given UserProfileEvent, when no listener passed, all registered event listener will be removed

    since

    0.1.0

    example
    removeUserProfileEventListener(UserProfileEvent.BLOCK_PROFILE, onBlockProfileListener);
    

    Parameters

    Returns void

removeUserReaction

  • description

    Remove a user reaction

    async
    since

    0.1.0

    example
    removeUserReaction({
    reactionSpaceId: "aa7e03fc-01f0-4a98-a2e0-3fed689632d7",
    userReactionId: "0fddc166-b8c3-4ce9-990e-848bde12188b"
    })

    Parameters

    Returns Promise<null>

Const removeWidgetListener

  • Remove widget listener

    since

    0.1.0

    example
    function widgetListener({event, message}){
    // your custom logic
    }
    removeWidgetListener({
    widgetId: "<Your widget Id>",
    widgetKind: "<Your widget kind>"
    }, widgetListener)

    Parameters

    Returns Promise<void>

Const reportMessage

  • description

    Report Chat Message

    since

    0.1.0

    async
    example
    reportMessage({
    roomId: "a147f914-d474-4cfb-81c6-4099404c435a",
    profileId: "c1ca9590-81d9-4da2-8d4f-85b24a35f81f",
    nickname: "Jon Doe",
    messageId: "d145e2f1-36df-4c5a-8157-078cbf366297",
    }).then((res) => console.log(res));

    Parameters

    Returns Promise<IReportChatMessageResponse>

sendChatRoomInviteToProfile

  • description

    Send chat room invite to profile (user)

    params

    args of type ISendChatRoomInviteArgs

    async
    since

    0.1.0

    example
    sendChatRoomInviteToProfile({
    roomId: "9e6f1bc4-9f02-4c57-92b7-7521d0f5b027",
    profileId: "aa7e03fc-01f0-4a98-a2e0-3fed689632d7"
    }).then(chatRoomInvitation => console.log(chatRoomInvitation))

    Parameters

    Returns Promise<IChatRoomInvitation>

    Promise

Const sendCustomMessage

  • sendCustomMessage Send custom message to chat room.

    since

    0.1.0

    async
    example
    sendCustomMessage({custom_data: 'Test message', roomId: 'c1f6082c-f7b9-4d1e-b64e-9071a3860ffc'})
    

    Parameters

    Returns Promise<ICustomMessageResponsePayload>

Const sendMessage

  • sendMessage Send user message to chat room.

    async
    since

    0.1.0

    example
    sendMessage({message: 'Test message', roomId: 'c1f6082c-f7b9-4d1e-b64e-9071a3860ffc'})
    

    Parameters

    Returns Promise<IMessageResponsePayload>

unblockProfile

  • description

    Unblock profile using Block Info id for a given blocked profile, use getProfileBlockInfo or getBlockInfoList to get corresponding profile block info id

    async
    since

    0.1.0

    example
    unblockProfile({blockId: "c327a72c-94e5-4f5a-bcef-16ee84d35077"}).then(response => console.log(response))
    

    Parameters

    Returns Promise<any>

Const updateChatRoom

  • description

    Updates chat room by id

    async
    since

    0.1.0

    updateChatRoom("5c9974ba-2180-4640-b949-eb9501d2f2ff", {
    title: "new title",
    content_filter: "none",
    visibility: "everyone",
    }).then((res) => console.log(res));

    Parameters

    Returns Promise<IChatRoomPayload>

    Promise

updateChatRoomInviteStatus

  • description

    Updates chat room invitation status

    params

    args of type IUpdateChatRoomInvitationStatusArgs

    async
    since

    0.1.0

    example
    updateChatRoomInviteStatus({
    invitationId: "28cc0ceb-8934-48cd-abc5-4d3a3a681c1b",
    invitationStatus: ChatRoomInvitationStatus.ACCEPTED
    }).then(chatRoomInvitation => console.log(chatRoomInvitation))

    Parameters

    Returns Promise<IChatRoomInvitation>

    Promise

updateCommentBoard

  • description

    Update comment board

    async
    since

    2.38.0

    example
    updateCommentBoard({
    commentBoardId: '5f5fea99-569b-42f3-875d-5b3943b64ba0',
    title: "title",
    customId: "postID431",
    repliesDepth: 1,
    allowComments: true,
    description: 'abc',
    customData: 'custom data'
    }).then(commentBoard => console.log(commentBoard))
    ``

    Parameters

    Returns Promise<ICommentBoard>

updateReactionSpace

  • description

    Update a reaction space with reaction pack ids or reaction space name

    async
    since

    0.1.0

    example
    updateReactionSpace({
    reactionSpaceId: "aa7e03fc-01f0-4a98-a2e0-3fed689632d7",
    reactionPackIds: ["aa7e03fc-01f0-4a98-a2e0-3fed689632d7", "0fddc166-b8c3-4ce9-990e-848bde12188b"]
    }).then(reactionSpace => console.log(reactionSpace))

    Parameters

    Returns Promise<IReactionSpace>

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

    0.1.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>

Const updateWidgetInteraction

  • Update a widget interaction

    since

    0.1.0

    example
    updateWidgetInteraction({
    widgetId: "<Your widget Id>",
    widgetKind: "<widget kind>",
    interactionItem: selectedPollOptionItem
    })

    Parameters

    Returns Promise<IWidgetInteraction>

Const uploadImage

  • description

    Upload a image to get image url for sending image message

    since

    0.1.0

    async
    example
    // For Web usage
    // get the image blob data from image uri, uri could be local file uri
    const imageBlob = await fetch(imageUri).then(res => res.blob())
    // create formdata and append "type" and "image" keys
    const imageFormData = new FormData();
    imageFormData.append('type', 'file')
    imageFormData.append('image', imageBlob)

    const { image_url } = await uploadImage({
    roomId: "a147f914-d474-4cfb-81c6-4099404c435a",
    imageFormData: imageFormData
    });

    Parameters

    Returns Promise<IUploadImageResponse>

Legend

  • Property
  • Method

Generated using TypeDoc