Skip to main content

UpgatherConfig

Upgather SDK


Upgather SDK / UpgatherConfig

Interface: UpgatherConfig

Configuration required to bootstrap an UpgatherService instance.

Properties

logConfig?

optional logConfig: LoggerConfig

Logging configuration. Only used if logger is not provided.

Remarks

This configuration is ignored if a custom logger is provided via the logger property. Use this for simple logging configuration without external dependencies.

Examples

Configure log level:

const upgather = new UpgatherService({
url: "https://cms.example.com",
token: process.env.STRAPI_TOKEN,
logConfig: {
level: 'warn',
prefix: 'my-app',
},
});

Disable all logging:

const upgather = new UpgatherService({
url: "https://cms.example.com",
token: process.env.STRAPI_TOKEN,
logConfig: { level: 'silent' },
});

logger?

optional logger: LoggerInterface

Custom logger implementation. If not provided, uses DefaultLogger. Set logConfig.level to 'silent' to disable all logging.

Remarks

This allows integration with external logging libraries like Winston or Pino. The logger will be used throughout the SDK for all logging operations including API requests, errors, retries, and vector store operations.

Example

Using a custom logger:

import winston from 'winston';
import { UpgatherService, LoggerInterface } from '@upgather/sdk';

const winstonLogger = winston.createLogger({ level: 'debug' });
const logger: LoggerInterface = {
debug: (msg, ...meta) => winstonLogger.debug(msg, ...meta),
info: (msg, ...meta) => winstonLogger.info(msg, ...meta),
warn: (msg, ...meta) => winstonLogger.warn(msg, ...meta),
error: (msg, ...meta) => winstonLogger.error(msg, ...meta),
};

const upgather = new UpgatherService({
url: "https://cms.example.com",
token: process.env.STRAPI_TOKEN,
logger,
});

openAiKey?

optional openAiKey: string

Optional OpenAI key to use when no key can be resolved from the API. It is only used as a fallback – explicit keys passed to vector store methods or keys stored on the related Organization always take precedence.


token?

optional token: string

Optional API token for authenticated API requests. If omitted, requests are made without the Authorization header.


url

url: string

Base URL of your API instance.

Example

"https://cms.example.com"