Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • ClientFactory

Index

Constructors

constructor

Methods

configure

  • configure(baseUrl: string, appServiceToken: string, appServiceUserId: string): void
  • Configure the factory for generating clients.

    Parameters

    • baseUrl: string

      The base URL to create clients with.

    • appServiceToken: string

      The AS token to use as the access_token

    • appServiceUserId: string

      The AS's user_id

    Returns void

getClientAs

  • getClientAs(userId?: undefined | string, request?: any, urlOverride?: undefined | string, usingE2E?: boolean): any
  • Construct a new Matrix JS SDK Client. Calling this twice with the same args will return the same client instance.

    Parameters

    • Optional userId: undefined | string

      The user_id to scope the client to. A new client will be created per user ID. If this is null, a client scoped to the application service itself will be created.

    • Optional request: any

      The request ID to additionally scope the client to. If set, this will create a new client per user ID / request combo. This factory will dispose the created client instance when the request is resolved.

    • Optional urlOverride: undefined | string
    • Default value usingE2E: boolean = false

    Returns any

setLogFunction

  • setLogFunction(func: (msg: string, error?: undefined | false | true) => void): void
  • Set a function to be called when logging requests and responses.

    Parameters

    • func: (msg: string, error?: undefined | false | true) => void

      The function to invoke. The first arg is the string to log. The second arg is a boolean which is 'true' if the log is an error.

        • (msg: string, error?: undefined | false | true): void
        • Parameters

          • msg: string
          • Optional error: undefined | false | true

          Returns void

    Returns void

Generated using TypeDoc