API: utils/config
better-web-search-mcp / utils/config
utils/config#
Interfaces#
AppConfig#
Defined in: src/utils/config.ts:33
Properties#
| Property | Type | Defined in |
|---|---|---|
braveApiKey | string | undefined | src/utils/config.ts:34 |
browserEnabled | boolean | src/utils/config.ts:39 |
cacheEnabled | boolean | src/utils/config.ts:37 |
cachePath | string | src/utils/config.ts:38 |
serpApiKey | string | undefined | src/utils/config.ts:36 |
tavilyApiKey | string | undefined | src/utils/config.ts:35 |
ProviderStatus#
Defined in: src/utils/config.ts:113
Shape for the provider banner (pure, testable).
Properties#
| Property | Type | Defined in |
|---|---|---|
enabled | boolean | src/utils/config.ts:115 |
hint? | string | src/utils/config.ts:117 |
keyless | boolean | src/utils/config.ts:116 |
name | string | src/utils/config.ts:114 |
Functions#
defaultCachePath()#
defaultCachePath(
env?,platform?):string
Defined in: src/utils/config.ts:56
Where the cache lives when nothing overrides it.
The default used to be the relative path data/cache.db, which resolves
against the working directory. An MCP client spawns the server from
wherever it happens to be, so that scattered data/cache.db files around
the filesystem — two were sitting in the home and Downloads folders — and
meant the domain profiles and page cache never accumulated, because every
launch directory got its own empty database. A per-user location is stable
across launches and keeps the writes inside a directory meant for them.
BETTER_WEB_SEARCH_CACHE_PATH still overrides, and a relative override is
still honoured for anyone who wants a project-local cache.
Parameters#
| Parameter | Type | Default value |
|---|---|---|
env | ProcessEnv | process.env |
platform | string | process.platform |
Returns#
string
formatBanner()#
formatBanner(
pkg,cfg):string
Defined in: src/utils/config.ts:143
Parameters#
| Parameter | Type |
|---|---|
pkg | { name: string; version: string; } |
pkg.name | string |
pkg.version | string |
cfg | AppConfig |
Returns#
string
loadConfig()#
loadConfig():
AppConfig
Defined in: src/utils/config.ts:84
Returns#
providerStatuses()#
providerStatuses(
cfg):ProviderStatus[]
Defined in: src/utils/config.ts:120
Parameters#
| Parameter | Type |
|---|---|
cfg | AppConfig |