diff --git a/src/server.ts b/src/server.ts index 3c32b4180..030918340 100644 --- a/src/server.ts +++ b/src/server.ts @@ -65,6 +65,7 @@ function _getAmountInLumens(amt: BigNumber) { * @param {boolean} [opts.allowHttp] - Allow connecting to http servers, default: `false`. This must be set to false in production deployments! You can also use {@link Config} class to set this globally. * @param {string} [opts.appName] - Allow set custom header `X-App-Name`, default: `undefined`. * @param {string} [opts.appVersion] - Allow set custom header `X-App-Version`, default: `undefined`. + * @param {string} [opts.authToken] - Allow set custom header `X-Auth-Token`, default: `undefined`. */ export class Server { /** @@ -90,6 +91,9 @@ export class Server { if (opts.appVersion) { customHeaders["X-App-Version"] = opts.appVersion; } + if (opts.authToken) { + customHeaders["X-Auth-Token"] = opts.authToken; + } if (!isEmpty(customHeaders)) { HorizonAxiosClient.interceptors.request.use((config) => { // merge the custom headers with an existing headers @@ -821,6 +825,7 @@ export namespace Server { allowHttp?: boolean; appName?: string; appVersion?: string; + authToken?: string; } export interface Timebounds {