How to install
Add@fingerprint/node-sdk as a dependency to your application via npm, yarn, or pnpm.
TypeScript
Migration guide for Node SDK v7
Version 7 migrates the SDK from Server API v3 to v4. This is a breaking change. This section summarizes the most important changes from previous versions.Package rename
The package changed from@fingerprintjs/fingerprintjs-pro-server-api to @fingerprint/node-sdk.
TypeScript
Client construction
The client class was renamed fromFingerprintJsServerApiClient to FingerprintServerApiClient, and the authenticationMode option was removed.
TypeScript
Get an event
requestId is now called the event ID, and the event data structure is flatter.
Response fields are now snake_case, and identification and Smart Signals data moved from products.<signal>.data to the top level.
TypeScript
getVisits replaced by searchEvents
getVisits() and getRelatedVisitors() have been removed. Use searchEvents with visitor_id to get the events for a visitor.
TypeScript
Update an event
TheupdateEvent parameter order changed from (body, eventId) to (eventId, body), and the tag field was renamed to tags.
TypeScript
Handling sealed client results from a v3 JavaScript agent
Node SDK v7 will fail to deserialize the decrypted payload of a sealed client result sent by a v3 JavaScript agent into anEvent because the payload is an EventsGetResponse (i.e., the v3 event format), not an Event.
To upgrade to Node SDK v7 without requiring a concurrent upgrade to the v4 JavaScript agent, you can fall back to using the Server API if unsealing the sealed client results fails.
To enable this fallback path, your frontend must send the event ID alongside the sealed client results, as recommended by the sealed client results guide.
Both unsealEventsResponse and client.getEvent return an Event, so the fallback returns the same type.
TypeScript