retrieve api key from config alone

improves api key management; no longer retrieving it in different ways from different parts of the application
This commit is contained in:
Sampson committed 2025-07-02 18:07:24 -05:00
1 parent 8f942b9eee
commit 52113e3246
4 files changed
+22 -11

No files matched your search

+2 -2
View File
@@ -1,5 +1,5 @@
import type { Endpoints } from './types.js';
import { BRAVE_API_KEY } from '../constants.js';
import config from '../config.js';
import { checkRateLimit, log, stringify } from '../utils.js';
const typeToPathMap: Record<keyof Endpoints, string> = {
@@ -14,7 +14,7 @@ const typeToPathMap: Record<keyof Endpoints, string> = {
const defaultRequestHeaders: Record<string, string> = {
Accept: 'application/json',
'Accept-Encoding': 'gzip',
'X-Subscription-Token': BRAVE_API_KEY,
'X-Subscription-Token': config.braveApiKey,
};
async function issueRequest<T extends keyof Endpoints>(