QR code based verification.

Properties

flowId: string

Get the unique ID that identifies this QR verification flow, be either a to-device request ID or a room event ID.

otherDeviceId: DeviceId

Get the device ID of the other side.

otherUserId: UserId

Get the user id of the other user that is participating in this verification flow.

roomId: undefined | RoomId

Get the room id if the verification is happening inside a room.

userId: UserId

Get our own user ID.

Methods

  • Cancel the verification flow.

    Returns either an OutgoingRequest which should be sent out, or undefined if the verification is already cancelled.

    Returns any

  • Get info about the cancellation if the verification flow has been cancelled.

    Returns undefined | CancelInfo

  • Cancel the verification.

    This cancels the verification with given code (e.g. m.user).

    Returns either an OutgoingRequest which should be sent out, or undefined if the verification is already cancelled.

    Parameters

    • code: string

    Returns any

  • Confirm that the other side has scanned our QR code.

    Returns either an OutgoingRequest which should be sent out, or undefined if the verification is already confirmed.

    Returns any

  • Returns void

  • Has the scanning of the QR code been confirmed by us?

    Returns boolean

  • Has the QR verification been scanned by the other side.

    When the verification object is in this state it’s required that the user confirms that the other side has scanned the QR code.

    Returns boolean

  • Has the verification flow been cancelled?

    Returns boolean

  • Has the verification flow completed?

    Returns boolean

  • Is this a verification that is verifying one of our own devices?

    Returns boolean

  • Notify the other side that we have successfully scanned the QR code and that the QR verification flow can start.

    This will return some OutgoingContent if the object is in the correct state to start the verification flow, otherwise None.

    Returns any

  • Have we successfully scanned the QR code and are able to send a reciprocation event?

    Returns boolean

  • Register a callback which will be called whenever there is an update to the request

    The callback is called with no parameters.

    Parameters

    • callback: Function

    Returns void

  • Get the current state of this request.

    Returns a QrState.

    Returns QrState

  • Generate a the raw bytes that should be encoded as a QR code is representing this verification flow.

    The to_qr_code method can be used to instead output a QrCode object that can be rendered.

    Returns Uint8ClampedArray<ArrayBufferLike>

  • Generate a QR code object that is representing this verification flow.

    The QrCode can then be rendered as an image or as an unicode string.

    The to_bytes method can be used to instead output the raw bytes that should be encoded as a QR code.

    Returns a QrCode.

    Returns QrCode

  • Did we initiate the verification request?

    Returns boolean