Interface Skill

Commands to interact with your skill backend.

export
interface

Skill

Hierarchy

  • Skill

Index

Methods

onMessage

  • onMessage(callback: (message: any) => void): Skill
  • This function is used to register a listener for incoming messages sent from the skill. The messages received are independent of the messages sent from the HTML application via sendMessage. The message payload can be any JS data type.

    memberof

    Skill

    Parameters

    • callback: (message: any) => void
        • (message: any): void
        • Parameters

          • message: any

          Returns void

    Returns Skill

sendMessage

  • This function allows the HTML application to communicate with the skill that invoked it. The message payload can be any JS data type.

    NOTE: This function is rate limited and calls may not always be successful. To handle the throttling error (or any other error), please supply the optional callback argument to the function. The callback always returns the status of the send and any error will be equivalent to HTTP status code. For example rate limit will be a 429 status and general error will be 500, while a success will be 200.*

    memberof

    Skill

    Parameters

    • message: any
    • Optional callback: undefined | ((response: MessageSendResponse) => void)

      with status of send.

    Returns Skill

2019, Amazon.com, Inc. or its affiliates. All Rights Reserved.