@sudoplatform/sudo-api-client
    Preparing search index...

    Interface ApiClientManager

    Manages one or more GraphQL client instances that may be shared by multiple service clients, depending on their configuration.

    interface ApiClientManager {
        getApiClientConfig(configNamespace?: string): ApiClientConfig;
        getClient(options?: ClientOptions): GraphQLClient;
        reset(): Promise<void>;
        setAuthClient(authClient: SudoUserClient): ApiClientManager;
        setConfig(config: ApiClientConfig): ApiClientManager;
        unsetConfig(): void;
    }

    Implemented by

    Index

    Methods

    • Returns the default client config associated with the provided configNamespace, or the default configNamespace if none is provided.

      Parameters

      • OptionalconfigNamespace: string

        The namespace of the config to retrieve the default client options for.

      Returns ApiClientConfig

      The default client config associated with the provided configNamespace, or the default configNamespace if none is provided.

    • Set an auth client that contains a jwtToken refresh method called getLatestAuthToken() of type string | (() => string | Promise<string>)

      Parameters

      • authClient: SudoUserClient

      Returns ApiClientManager

      Instance of this client manager