Skip to content

AutoDiscovery

Defined in: src/autodiscovery.ts:65

Utilities for automatically discovery resources, such as hubs for users to log in to.

new AutoDiscovery(): AutoDiscovery

AutoDiscovery

readonly static ALL_ERRORS: AutoDiscoveryError[]

Defined in: src/autodiscovery.ts:91


readonly static ERROR_GENERIC_FAILURE: GenericFailure = AutoDiscoveryError.GenericFailure

Defined in: src/autodiscovery.ts:73


readonly static ERROR_INVALID: Invalid = AutoDiscoveryError.Invalid

Defined in: src/autodiscovery.ts:71


readonly static ERROR_INVALID_HUB: InvalidHub = AutoDiscoveryError.InvalidHub

Defined in: src/autodiscovery.ts:77


readonly static ERROR_INVALID_HUB_BASE_URL: InvalidHubBaseUrl = AutoDiscoveryError.InvalidHubBaseUrl

Defined in: src/autodiscovery.ts:75


readonly static ERROR_INVALID_IDENTITY_SERVER: InvalidIdentityServer = AutoDiscoveryError.InvalidIdentityServer

Defined in: src/autodiscovery.ts:81


readonly static ERROR_INVALID_IS: InvalidIs = AutoDiscoveryError.InvalidIs

Defined in: src/autodiscovery.ts:83


readonly static ERROR_INVALID_IS_BASE_URL: InvalidIsBaseUrl = AutoDiscoveryError.InvalidIsBaseUrl

Defined in: src/autodiscovery.ts:79


readonly static ERROR_INVALID_JSON: InvalidJson = AutoDiscoveryError.InvalidJson

Defined in: src/autodiscovery.ts:87


readonly static ERROR_MISSING_WELLKNOWN: MissingWellknown = AutoDiscoveryError.MissingWellknown

Defined in: src/autodiscovery.ts:85


readonly static ERROR_UNSUPPORTED_HUB_SPEC_VERSION: UnsupportedHubSpecVersion = AutoDiscoveryError.UnsupportedHubSpecVersion

Defined in: src/autodiscovery.ts:89


readonly static FAIL_ERROR: FAIL_ERROR = AutoDiscoveryAction.FAIL_ERROR

Defined in: src/autodiscovery.ts:97

The auto discovery failed. The client is expected to communicate the error to the user and refuse logging in.


readonly static FAIL_PROMPT: FAIL_PROMPT = AutoDiscoveryAction.FAIL_PROMPT

Defined in: src/autodiscovery.ts:106

The auto discovery failed, however the client may still recover from the problem. The client is recommended to that the same action it would for PROMPT while also warning the user about what went wrong. The client may also treat this the same as a FAIL_ERROR state.


readonly static PROMPT: PROMPT = AutoDiscoveryAction.PROMPT

Defined in: src/autodiscovery.ts:113

The auto discovery didn’t fail but did not find anything of interest. The client is expected to prompt the user for more information, or fail if it prefers.


readonly static SUCCESS: SUCCESS = AutoDiscoveryAction.SUCCESS

Defined in: src/autodiscovery.ts:118

The auto discovery was successful.

static findClientConfig(domain): Promise<ClientConfig>

Defined in: src/autodiscovery.ts:304

Attempts to automatically discover client configuration information prior to logging in. Such information includes the hub URL and identity server URL the client would want. Additional details may also be discovered, and will be transparently included in the response object unaltered.

string

The hub domain to perform discovery on. For example, “matrix.org”.

Promise<ClientConfig>

Promise which resolves to the discovered configuration, which may include error states. Rejects on unexpected failure, not when discovery fails.


static fromDiscoveryConfig(wellknown?): Promise<ClientConfig>

Defined in: src/autodiscovery.ts:132

Validates and verifies client configuration information for purposes of logging in. Such information includes the hub URL and identity server URL the client would want. Additional details may also be included, and will be transparently brought into the response object unaltered.

IClientWellKnown

The configuration object itself, as returned by the .well-known auto-discovery endpoint.

Promise<ClientConfig>

Promise which resolves to the verified configuration, which may include error states. Rejects on unexpected failure, not when verification fails.


static getRawClientConfig(domain?): Promise<IClientWellKnown>

Defined in: src/autodiscovery.ts:371

Gets the raw discovery client configuration for the given domain name. Should only be used if there’s no validation to be done on the resulting object, otherwise use findClientConfig().

string

The domain to get the client config for.

Promise<IClientWellKnown>

Promise which resolves to the domain’s client config. Can be an empty object.


static setFetchFn(fetchFn): void

Defined in: src/autodiscovery.ts:425

{(input, init?): Promise<Response>; (input, init?): Promise<Response>; }

void