@fingerprintjs/fingerprintjs-pro-server-api
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -47,3 +47,3 @@ "use strict"; | ||
} | ||
const url = this.authenticationMode === types_1.AuthenticationMode.QueryParameter ? (0, urlUtils_1.getVisitorsUrl)(this.region, visitorId, filter).concat(`&token=${this.apiToken}`) : (0, urlUtils_1.getVisitorsUrl)(this.region, visitorId, filter); | ||
const url = this.authenticationMode === types_1.AuthenticationMode.QueryParameter ? (0, urlUtils_1.getVisitorsUrl)(this.region, visitorId, filter, this.apiToken) : (0, urlUtils_1.getVisitorsUrl)(this.region, visitorId, filter); | ||
const headers = this.authenticationMode === types_1.AuthenticationMode.AuthHeader ? { 'Auth-Token': this.apiToken } : undefined; | ||
@@ -50,0 +50,0 @@ return (0, node_fetch_1.default)(url, { |
import { Region, VisitorHistoryFilter } from "./types"; | ||
export declare function getVisitorsUrl(region: Region, visitorId: string, filter?: VisitorHistoryFilter): string; | ||
export declare function getVisitorsUrl(region: Region, visitorId: string, filter?: VisitorHistoryFilter, token?: string): string; |
@@ -11,5 +11,9 @@ "use strict"; | ||
const globaRegionUrl = "https://api.fpjs.io/"; | ||
function getVisitorsUrl(region, visitorId, filter) { | ||
function getVisitorsUrl(region, visitorId, filter, token) { | ||
const queryStringParameters = filter !== null && filter !== void 0 ? filter : {}; | ||
if (token) { | ||
queryStringParameters.token = token; | ||
} | ||
const serverApiPath = getVisitorsPath(region, visitorId); | ||
const queryString = filter ? querystring_1.default.stringify(filter) : ''; | ||
const queryString = queryStringParameters ? querystring_1.default.stringify(queryStringParameters) : ''; | ||
if (queryString === '') { | ||
@@ -16,0 +20,0 @@ return serverApiPath; |
{ | ||
"name": "@fingerprintjs/fingerprintjs-pro-server-api", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
19914
287