@map-colonies/config
    Preparing search index...

    Function config

    • Retrieves the configuration based on the provided options.

      Type Parameters

      • T extends { "[typeSymbol]": unknown; $id: string }

        The type of the configuration schema.

      Parameters

      • options: {
            configName?: string;
            configServerUrl?: string;
            ignoreServerIsOlderVersionError?: boolean;
            localConfigPath?: string;
            metricsRegistry?: Registry<"text/plain; version=0.0.4; charset=utf-8">;
            offlineMode?: boolean;
            schema: T;
            version?: number | "latest";
        }

        The options for retrieving the configuration.

        • OptionalconfigName?: string

          The name of the remote configuration.

        • OptionalconfigServerUrl?: string

          The URL of the configuration server.

        • OptionalignoreServerIsOlderVersionError?: boolean

          Indicates whether to ignore the error when the server version is older than the requested version.

        • OptionallocalConfigPath?: string

          The path to the local configuration folder.

          './config'
          
        • OptionalmetricsRegistry?: Registry<"text/plain; version=0.0.4; charset=utf-8">

          The registry for the metrics. If not provided, the metrics will not be registered. Depends on the prom-client package being installed.

        • OptionalofflineMode?: boolean

          Indicates whether the configuration should be loaded in offline mode.

        • schema: T

          The schema of the configuration object.

        • Optionalversion?: number | "latest"

          The version of the remote configuration. It can be either 'latest' or a number.

      Returns Promise<ConfigInstance<T[typeof typeSymbol]>>

      • A promise that resolves to the configuration object.