Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .changeset/cyan-lobsters-look.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
90 changes: 72 additions & 18 deletions .changeset/early-seas-look.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`).
2 changes: 1 addition & 1 deletion .changeset/loud-waves-drive.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
1 change: 0 additions & 1 deletion .changeset/pre.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"cyan-lobsters-look",
"early-seas-look",
"loud-waves-drive",
"ten-chicken-cough",
"witty-lobsters-film"
]
}
5 changes: 0 additions & 5 deletions .changeset/ten-chicken-cough.md

This file was deleted.

2 changes: 1 addition & 1 deletion .changeset/witty-lobsters-film.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
'@fingerprint/node-sdk': minor
---

add `options` parameter to the `getEvent` operation
Added `options` parameter to the `getEvent` operation.
Loading