diff --git a/.changeset/cyan-lobsters-look.md b/.changeset/cyan-lobsters-look.md index 6860fdea..23e7b45a 100644 --- a/.changeset/cyan-lobsters-look.md +++ b/.changeset/cyan-lobsters-look.md @@ -2,4 +2,4 @@ '@fingerprint/node-sdk': patch --- -**perf**: Avoid the overhead of cloning and double-buffering large payloads on success case. +**Performance**: Avoid the overhead of cloning and double-buffering large payloads in the success case. diff --git a/.changeset/early-seas-look.md b/.changeset/early-seas-look.md index 4d502753..e411a2d9 100644 --- a/.changeset/early-seas-look.md +++ b/.changeset/early-seas-look.md @@ -2,21 +2,75 @@ '@fingerprint/node-sdk': major --- -**Server APIv3 -> Server APIv4 migration** - -- Switch all endpoints to `/v4/*`. -- Remove `authenticationMode` option when initializing `FingerprintServerApiClient`. -- Rename `request_id` to `event_id`. -- Use snake_case fields when updating an event. -- Use `PATCH` method when updating an event. -- Examples, tests, and docs updated. - -**BREAKING CHANGES** -- Use new client when initializing: `FingerprintServerApiClient`. -- `authenticationMode` option removed. -- Removed `getVisits()` function. -- Removed `getRelatedVisitors()` function. -- Removed `VisitorHistoryFilter`, `ErrorPlainResponse`, `VisitorsResponse`, `RelatedVisitorsResponse`, -`RelatedVisitorsFilter`, `Webhook`, `EventsUpdateRequest` types. -- Use `tags` instead of `tag` for updating an event. -- Response models changed. +**Server API v3 -> Server API v4 migration** + +- All endpoints switched to `/v4/*`. +- `authenticationMode` option removed from `FingerprintServerApiClient`. +- `request_id` renamed to `event_id`. +- Event updates switched to _snake\_case_ fields and `PATCH` method. +- Response models switched to _snake\_case_ fields. +- **Removed APIs**: `getVisits()`, `getRelatedVisitors()`, and related types (`VisitorHistoryFilter`, + `ErrorPlainResponse`, `VisitorsResponse`, `RelatedVisitorsResponse`, `RelatedVisitorsFilter`, `Webhook`, + `EventsUpdateRequest`). +- **`updateEvent` signature changed**: `(eventId, body)` instead of `(body, eventId)`. + +**Migration Notes:** + +Use new client when initializing: `FingerprintServerApiClient`: + +```diff +- const client = new FingerprintJsServerApiClient(config) ++ const client = new FingerprintServerApiClient(config) +``` + +`authenticationMode` option removed from constructor: + +```diff +const client = new FingerprintServerApiClient({ +- authenticationMode: AuthenticationMode.AuthHeader + // ... +}) +``` + +Use `searchEvents` function instead of `getVisits()`: + +```diff +- client.getVisits('VISITOR_ID', { limit: 1 }) ++ client.searchEvents({ visitor_id: 'VISITOR_ID', limit: 1 }) +``` + +Related visitors API (`getRelatedVisitors()`) is removed: + +```diff +- client.getRelatedVisitors({ visitor_id: 'VISITOR_ID' }) +``` + +Use `tags` instead of `tag` for updating an event: + +```diff +- const body: EventsUpdateRequest = { ++ const body: EventUpdate = { +- tag: { ++ tags: { + key: 'value', + } + } +``` + +`updateEvent` parameter order changed to `(eventId, body)`: + +```diff +- client.updateEvent(body, 'EVENT_ID') ++ client.updateEvent('EVENT_ID', body) +``` + +Use simplified and _snake\_case_ fields for the response: + +```diff + const event = await client.getEvent(eventId) +- console.log(event.products.identification.data.visitorId) ++ console.log(event.identification.visitor_id) +``` + +Remove any usage of the removed types (`VisitorHistoryFilter`, `ErrorPlainResponse`, `VisitorsResponse`, `RelatedVisitorsResponse`, +`RelatedVisitorsFilter`, `Webhook`, `EventsUpdateRequest`). diff --git a/.changeset/loud-waves-drive.md b/.changeset/loud-waves-drive.md index bc432bff..fd1c6e99 100644 --- a/.changeset/loud-waves-drive.md +++ b/.changeset/loud-waves-drive.md @@ -2,4 +2,4 @@ '@fingerprint/node-sdk': major --- -change package name to `@fingerprint/node-sdk` +**Package renamed** from `@fingerprintjs/fingerprintjs-pro-server-api` to `@fingerprint/node-sdk`. diff --git a/.changeset/pre.json b/.changeset/pre.json index 357e937f..e20de97e 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -10,7 +10,6 @@ "cyan-lobsters-look", "early-seas-look", "loud-waves-drive", - "ten-chicken-cough", "witty-lobsters-film" ] } diff --git a/.changeset/ten-chicken-cough.md b/.changeset/ten-chicken-cough.md deleted file mode 100644 index dbc11b2e..00000000 --- a/.changeset/ten-chicken-cough.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@fingerprint/node-sdk': major ---- - -**BREAKING**: `updateEvent` now takes `eventId` as the first parameter and `body` as the second. diff --git a/.changeset/witty-lobsters-film.md b/.changeset/witty-lobsters-film.md index 8d5dca72..ef559ed1 100644 --- a/.changeset/witty-lobsters-film.md +++ b/.changeset/witty-lobsters-film.md @@ -2,4 +2,4 @@ '@fingerprint/node-sdk': minor --- -add `options` parameter to the `getEvent` operation +Added `options` parameter to the `getEvent` operation.