Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Type Aliases

PaginationIterator: AsyncIterator<Object, Function, Function>

Functions

  • Add a widget listener

    since

    2.4.0

    Parameters

    Returns any

  • description

    Create Alert widget

    async
    since

    2.52.0

    example
    createAlertWidget({
    programId: "<program id>",
    title: "<alert title>",
    text: "<alert text>",
    imageUrl: "<your image url>",
    linkUrl: "<link url to include on alert widget>",
    linkLabel: "<link label to show on alert widget>",
    }).then(alertWidget => console.log(alertWidget))

    Parameters

    Returns Promise<IAlertWidget>

  • description

    Create Image Poll widget

    async
    since

    2.52.0

    example
    createImagePollWidget({
    question: "<widget question>",
    programId: "xxxx",
    option: [{
    description: "<option description>",
    imageUrl: "<url>"
    }],
    }).then(imagePollWidget => console.log(imagePollWidget))

    Parameters

    Returns Promise<IImagePollWidget>

  • description

    Create Image Prediction widget

    async
    since

    2.52.0

    example
    createImagePredictionWidget({
    question: "<widget question>",
    programId: "xxxx",
    options: [{
    description: "<option description>",
    imageUrl: "<url>"
    }],
    }).then(widget => console.log(widget))

    Parameters

    Returns Promise<IImagePredictionWidget>

  • description

    Create Prediction followup widget using prediction widget id, widget kind and correct option Id

    async
    since

    2.52.0

    example
    createPredictionFollowUpWidget({
    widgetId: "yyyyy",
    widgetKind: WidgetKind.TEXT_PREDICTION,
    correctOptionId: "zzzz"
    }).then(followUpWidget => console.log(followUpWidget))

    Parameters

    Returns Promise<IPredictionFollowUpWidget>

  • description

    Create Text Poll widget

    async
    since

    2.52.0

    example
    createTextPollWidget({
    question: "<widget question>",
    programId: "xxxx",
    option: [{
    description: "<option description>"
    }],
    }).then(textPollWidget => console.log(textPollWidget))

    Parameters

    Returns Promise<ITextPollWidget>

  • description

    Create Text Prediction widget

    async
    since

    2.52.0

    example
    createTextPredictionWidget({
    question: "<widget question>",
    programId: "xxxx",
    options: [{
    description: "<option description>"
    }],
    }).then(widget => console.log(widget))

    Parameters

    Returns Promise<ITextPredictionWidget>

  • description

    Delete a widget

    async
    since

    2.52.0

    example
    deleteWidget({
    widgetId: "<widget question>",
    widgetKind: WidgetKind.TEXT_POLL,
    }).then(res => console.log(res))

    Parameters

    Returns Promise<void>

  • getPaginatedUnclaimedRewards(args: { programId: string }): Promise<AsyncIterator<Object, Function, Function>>
  • Parameters

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

    Returns Promise<AsyncIterator<Object, Function, Function>>

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

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

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

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

    Parameters

    Returns Promise<IWidgetKindInteractionsMap>

  • description

    Fetch paginated List of Widgets filtered by widget status and kind

    since

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

  • description

    Publish a widget based on publish delay duration that would schedule a widget to be published after a given duration. When no publish duration is passed, widget would be instantly published.

    async
    since

    2.52.0

    example
    publishWidget({
    widgetId: "<widget question>",
    widgetKind: WidgetKind.TEXT_POLL,
    delayDuration: "P0DT00H05M00S" // publish widget after 5 mins
    }).then(res => console.log(res))

    Parameters

    Returns Promise<IPublishWidgetRes>

  • 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

  • Remove widget listener

    since

    2.4.0

    Parameters

    Returns void

  • description

    Update Image Prediction widget option

    async
    since

    2.52.0

    example
    updateImagePredictionWidgetOption({
    widgetId: "xxxx",
    optionId: "<widget option id>",
    rewardItemId: "yyy-ccvv-qqqq",
    rewardItemAmount: 100,
    description: "<updated description>",
    isCorrect: true,
    imageUrl: "<url for option image>"
    }).then(widget => console.log(widget))

    Parameters

    Returns Promise<IImagePredictionWidgetOption>

  • description

    Update Text Prediction widget option

    async
    since

    2.52.0

    example
    updateTextPredictionWidgetOption({
    widgetId: "xxxx",
    optionId: "<widget option id>",
    rewardItemId: "yyy-ccvv-qqqq",
    rewardItemAmount: 100,
    description: "<updated description>",
    isCorrect: true
    }).then(widget => console.log(widget))

    Parameters

    Returns Promise<ITextPredictionWidgetOption>

Legend

  • Namespace
  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Interface
  • Interface with type parameter
  • Enumeration

Generated using TypeDoc