UpgatherConfig
Upgather SDK / UpgatherConfig
Interface: UpgatherConfig
Defined in: lib/services/UpgatherService.ts:22
Configuration required to bootstrap an UpgatherService instance.
Properties
logConfig?
optionallogConfig:LoggerConfig
Defined in: lib/services/UpgatherService.ts:102
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?
optionallogger:LoggerInterface
Defined in: lib/services/UpgatherService.ts:70
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/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?
optionalopenAiKey:string
Defined in: lib/services/UpgatherService.ts:38
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?
optionaltoken:string
Defined in: lib/services/UpgatherService.ts:32
Optional API token for authenticated API requests. If omitted, requests are made without the Authorization header.
url
url:
string
Defined in: lib/services/UpgatherService.ts:27
Base URL of your API instance.
Example
"https://cms.example.com"