Skip to content

Commit

Permalink
Merge pull request #89 from adzerk/simonramzi/sc-50473/decision-sdk-f…
Browse files Browse the repository at this point in the history
…ire-function-not-working

Added API Key to Fire Function
  • Loading branch information
honeycomb-cheesecake authored Sep 28, 2023
2 parents 4e527d1 + 7551e25 commit 8c5cde3
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,12 @@ class DecisionClient {
logger(
'warn',
'--------------------------------------------------------------\n' +
'--------------!!! WARNING - WARNING - WARNING !!!-------------\n' +
'' +
'You have opted to include explainer details with this request!\n' +
'This will cause performance degradation and should not be done\n' +
'in production environments.\n' +
'--------------------------------------------------------------'
'--------------!!! WARNING - WARNING - WARNING !!!-------------\n' +
'' +
'You have opted to include explainer details with this request!\n' +
'This will cause performance degradation and should not be done\n' +
'in production environments.\n' +
'--------------------------------------------------------------'
);

if (additionalOpts.desiredAds) {
Expand Down Expand Up @@ -331,12 +331,18 @@ class PixelClient {
additionalOpts?: AdditionalOptions
): Promise<PixelFireResponse> {
let logger = this._logger || defaultLogger;

let headersbase = {
'X-Adzerk-Sdk-Version': this._versionString,
'User-Agent': additionalOpts?.userAgent || 'OpenAPI-Generator/1.0/js',
};
let headers = additionalOpts?.apiKey ?
{ ...headersbase, 'X-Kevel-ApiKey': additionalOpts.apiKey } :
headersbase;

let opts: any = {
method: 'GET',
headers: {
'X-Adzerk-Sdk-Version': this._versionString,
'User-Agent': additionalOpts?.userAgent || 'OpenAPI-Generator/1.0/js',
},
headers,
redirect: 'manual',
};

Expand Down

0 comments on commit 8c5cde3

Please sign in to comment.