light-mode-image
Learn
Variables

utils

Members

generateChallenge

Generates a challenge string using the window.crypto API.

function utils.generateChallenge(): string

Returns string.

A URL-safe base64 encoded string representing the challenge.

getVersion

Returns the value that is being set in the x-mattr-sdk-version header

function utils.getVersion(): string

Returns string.

unwrap

A utility function to get the value from a Result or throw if there was an error

function utils.unwrap(
  result: Result<T, unknown>,
  errMessage?: string
): T

Parameters

Prop

Type

Returns T.

Allows you to get the value of a result directly or handle an error Result as an exception

How would you rate this page?

On this page