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?: string, request?: Request<unknown>, urlOverride?: 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: 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: Request<unknown>

      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: string
    • usingE2E: boolean = false

    Returns any

setLogFunction

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

    Parameters

    • func: (msg: string, error?: boolean) => 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?: boolean): void
        • Parameters

          • msg: string
          • Optional error: boolean

          Returns void

    Returns void

Generated using TypeDoc