// Install: npm install @fingerprintjs/fingerprintjs-pro-server-api
import {
FingerprintJsServerApiClient,
RequestError,
Region,
} from '@fingerprintjs/fingerprintjs-pro-server-api'
const client = new FingerprintJsServerApiClient({
apiKey: 'SERVER_API_KEY', // Replace with your key
region: Region.Global, // Replace with your region
})
const requestId = 'REQUEST_ID' // Replace with your request ID
// Update an event
try {
await client.updateEvent(
{
tag: {
key: 'value',
},
linkedId: 'new_linked_id',
suspect: false,
},
requestId
)
console.log('Event updated')
} catch (error) {
if (error instanceof RequestError) {
console.log(`error ${error.statusCode}: `, error.message)
console.log(error.response.statusText)
} else {
console.log('unknown error: ', error)
}
}