-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #143 from fingerprintjs/feat/open-api-v1.3.0
OpenAPI schema sync
- Loading branch information
Showing
31 changed files
with
1,602 additions
and
266 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@fingerprintjs/fingerprintjs-pro-server-api': minor | ||
--- | ||
|
||
**related-visitors**: Add GET `/related-visitors` endpoint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@fingerprintjs/fingerprintjs-pro-server-api': minor | ||
--- | ||
|
||
**visitors**: Add the confidence field to the VPN Detection Smart Signal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"mode": "pre", | ||
"tag": "test", | ||
"initialVersions": { | ||
"@fingerprintjs/fingerprintjs-pro-server-api": "5.1.0", | ||
"fingerprintjs-pro-server-api-node-sdk-example": "1.0.0" | ||
}, | ||
"changesets": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@fingerprintjs/fingerprintjs-pro-server-api': minor | ||
--- | ||
|
||
Deprecate `getVisitorHistory` method. Use `getVisits` instead. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@fingerprintjs/fingerprintjs-pro-server-api': minor | ||
--- | ||
|
||
**events**: Add `antiDetectBrowser` detection method to the `tampering` Smart Signal. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
v1.1.0 | ||
v1.3.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { | ||
FingerprintJsServerApiClient, | ||
Region, | ||
isRelatedVisitorsError, | ||
} from '@fingerprintjs/fingerprintjs-pro-server-api' | ||
import { config } from 'dotenv' | ||
config() | ||
|
||
const apiKey = process.env.API_KEY | ||
const visitorId = process.env.VISITOR_ID | ||
const envRegion = process.env.REGION | ||
|
||
if (!visitorId) { | ||
console.error('Visitor ID not defined') | ||
process.exit(1) | ||
} | ||
|
||
if (!apiKey) { | ||
console.error('API key not defined') | ||
process.exit(1) | ||
} | ||
|
||
let region = Region.Global | ||
if (envRegion === 'eu') { | ||
region = Region.EU | ||
} else if (envRegion === 'ap') { | ||
region = Region.AP | ||
} | ||
|
||
const client = new FingerprintJsServerApiClient({ region, apiKey }) | ||
|
||
try { | ||
const relatedVisitors = await client.getRelatedVisitors({ | ||
visitor_id: visitorId, | ||
}) | ||
|
||
console.log(JSON.stringify(relatedVisitors, null, 2)) | ||
} catch (error) { | ||
if (isRelatedVisitorsError(error)) { | ||
console.log(`error ${error.statusCode}: `, error.message) | ||
// You can also access the raw response | ||
console.log(error.response.statusText) | ||
} else { | ||
console.log('unknown error: ', error) | ||
} | ||
process.exit(1) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.