A Verifier is responsible for performing the verification using a particular method, such as via QR code or SAS (emojis).

A verifier object can be created by calling VerificationRequest.beginVerification; one is also created automatically when a m.key.verification.start event is received for an existing VerificationRequest.

Once a verifier object is created, the verification can be started by calling the Verifier#verify method.

interface Verifier {
    get hasBeenCancelled(): boolean;
    get userId(): string;
    addListener<T extends EventEmitterEvents | VerifierEvent>(
        event: T,
        listener: Listener<VerifierEvent, VerifierEventHandlerMap, T>,
    ): this;
    cancel(e: Error): void;
    emit<T extends VerifierEvent>(
        event: T,
        ...args: Parameters<VerifierEventHandlerMap[T]>,
    ): boolean;
    emit<T extends VerifierEvent>(
        event: T,
        ...args: Parameters<VerifierEventHandlerMap[T]>,
    ): boolean;
    emitPromised<T extends VerifierEvent>(
        event: T,
        ...args: Parameters<VerifierEventHandlerMap[T]>,
    ): Promise<boolean>;
    emitPromised<T extends VerifierEvent>(
        event: T,
        ...args: Parameters<VerifierEventHandlerMap[T]>,
    ): Promise<boolean>;
    getReciprocateQrCodeCallbacks(): null | ShowQrCodeCallbacks;
    getShowSasCallbacks(): null | ShowSasCallbacks;
    listenerCount(event: EventEmitterEvents | VerifierEvent): number;
    listeners(event: EventEmitterEvents | VerifierEvent): Function[];
    off<T extends EventEmitterEvents | VerifierEvent>(
        event: T,
        listener: Listener<VerifierEvent, VerifierEventHandlerMap, T>,
    ): this;
    on<T extends EventEmitterEvents | VerifierEvent>(
        event: T,
        listener: Listener<VerifierEvent, VerifierEventHandlerMap, T>,
    ): this;
    once<T extends EventEmitterEvents | VerifierEvent>(
        event: T,
        listener: Listener<VerifierEvent, VerifierEventHandlerMap, T>,
    ): this;
    prependListener<T extends EventEmitterEvents | VerifierEvent>(
        event: T,
        listener: Listener<VerifierEvent, VerifierEventHandlerMap, T>,
    ): this;
    prependOnceListener<T extends EventEmitterEvents | VerifierEvent>(
        event: T,
        listener: Listener<VerifierEvent, VerifierEventHandlerMap, T>,
    ): this;
    rawListeners(event: EventEmitterEvents | VerifierEvent): Function[];
    removeAllListeners(event?: EventEmitterEvents | VerifierEvent): this;
    removeListener<T extends EventEmitterEvents | VerifierEvent>(
        event: T,
        listener: Listener<VerifierEvent, VerifierEventHandlerMap, T>,
    ): this;
    verify(): Promise<void>;
}

Hierarchy (View Summary)

Implemented by

Accessors

  • get hasBeenCancelled(): boolean
  • Returns true if the verification has been cancelled, either by us or the other side.

    Returns boolean

Methods

  • Get the details for reciprocating QR code verification, if one is in progress

    Returns null, unless this verifier is for reciprocating a QR-code-based verification (ie, the other user has already scanned our QR code), and we are waiting for the user to confirm.

    Returns null | ShowQrCodeCallbacks

  • Start the key verification, if it has not already been started.

    This means sending a m.key.verification.start if we are the first responder, or a m.key.verification.accept if the other side has already sent a start event.

    Returns Promise<void>

    Promise which resolves when the verification has completed, or rejects if the verification is cancelled or times out.