Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
f543622
feat(api-v4)!: migrate SDK to APIv4
erayaydin Oct 14, 2025
42cd278
feat: remove accept header for updateEvent
erayaydin Oct 14, 2025
a928611
test: fix update event test expected method
erayaydin Oct 14, 2025
558c352
chore: remove unnecessary commented line
erayaydin Oct 14, 2025
c6a02cd
docs: expand `searchEvents` JSDoc with new filters
erayaydin Oct 15, 2025
696acb3
docs: fix example naming for error handling
erayaydin Oct 15, 2025
3840e16
chore: update OpenAPI schema version
erayaydin Oct 15, 2025
ce2854d
chore: add changeset file for changes
erayaydin Oct 15, 2025
41876b5
docs: update package name for badges
erayaydin Oct 15, 2025
29e8497
docs: use correct package name for installation
erayaydin Oct 15, 2025
8e2343e
chore: remove `getVisitorHistory` example file
erayaydin Oct 22, 2025
174b14d
chore: ignore `fingerprint-server-sdk-smoke-tests`
erayaydin Oct 22, 2025
385b01b
chore: changeset mention about package name change
erayaydin Oct 22, 2025
ef98a92
fix: use correct method for updating event
erayaydin Oct 22, 2025
ba36af2
fix: use response.ok for all success responses
erayaydin Oct 22, 2025
4f21b23
feat: simplify API requests with `callApi`
erayaydin Oct 22, 2025
db81f58
refactor: inline null checks in query serializer
erayaydin Oct 22, 2025
ba552dc
chore: use `EVENT_ID` placeholder example dotenv
erayaydin Oct 22, 2025
60156de
feat: restrict allowed methods via `AllowedMethod`
erayaydin Oct 22, 2025
297d679
fix: normalize HTTP method casing (uppercase)
erayaydin Oct 22, 2025
577660b
feat: add body support to `callApi`
erayaydin Oct 22, 2025
6ff4e05
test: remove unnecessary visitor detail tests
erayaydin Oct 22, 2025
a9d0af3
chore: fix missing quote for linked_id
erayaydin Oct 22, 2025
bfce2df
chore: remove redundant await keyword in callApi
erayaydin Oct 22, 2025
0e4ff4e
refactor: unify response handling and improve type
erayaydin Oct 23, 2025
bbf565b
refactor: simplify error handling
erayaydin Oct 23, 2025
d967cf2
docs: fix webhook example and description
erayaydin Oct 29, 2025
ed6fa01
feat: use Event type instead of EventsGetResponse
erayaydin Oct 29, 2025
c073aeb
refactor: remove unnecessary `ErrorJson` type
erayaydin Oct 29, 2025
c772f6a
build: revert current version to fix changeset
erayaydin Oct 29, 2025
ace5e1c
feat: remove unused `responseUtils`
erayaydin Oct 29, 2025
980ea41
test: add error test cases for serverApiClient
erayaydin Oct 29, 2025
9aeb597
refactor: remove `utils` file
erayaydin Oct 29, 2025
465ae41
test: add error convert coverage
erayaydin Oct 29, 2025
75f7d5e
refactor: remove unnecessary queryString guard
erayaydin Oct 29, 2025
2eb7507
test: add errorTests spec and getRequestPath tests
erayaydin Oct 29, 2025
25fe93c
feat: update openapi schema
erayaydin Feb 19, 2026
67eed4c
chore: update repository URLs to new repo name
erayaydin Feb 23, 2026
b75c554
chore: remove unnecessary `WebhookOperationIds`
erayaydin Feb 23, 2026
3ebae43
feat: add rulesetId support to getEvent
erayaydin Feb 23, 2026
e034873
test: fix linked_id usage in updateEvent tests
erayaydin Feb 23, 2026
4188e2a
chore: add new keyword to type error throw
erayaydin Feb 23, 2026
3e191a9
test: fix grammar typos
erayaydin Feb 23, 2026
1072171
chore: enter to pre-release mode
erayaydin Feb 23, 2026
68869d7
chore: remove duplicated import
erayaydin Feb 23, 2026
a034171
chore: fix inconsistent error message
erayaydin Feb 23, 2026
45c2be5
refactor: move region parameter to inside callApi
erayaydin Feb 24, 2026
7c56c0f
refactor: extract toError utility function
erayaydin Feb 24, 2026
47f3719
docs: add rule_action usage example to getEvent
erayaydin Feb 24, 2026
17862d1
docs: update eventId reference url
erayaydin Feb 24, 2026
799e4fe
docs: fix rule_action handling example
erayaydin Feb 24, 2026
e3b6d59
docs: fix update event example linked_id usage
erayaydin Feb 24, 2026
8b30052
refactor: change rulesetId parameter to options
erayaydin Feb 25, 2026
d8ebee6
chore: remove `signature change` related note
erayaydin Feb 25, 2026
4677ab6
refactor: remove retryAfter TooManyRequestsError
erayaydin Feb 25, 2026
128f963
chore: silence curl output in sync script
erayaydin Feb 25, 2026
5fbe415
refactor: rename createResponse in test utils
erayaydin Feb 25, 2026
7c3b65a
chore: add `RULESET_ID` to .env.example file
erayaydin Feb 25, 2026
c233de2
docs: fix pagination_key usage example
erayaydin Feb 25, 2026
8484c2c
docs: fix ruleset evaluation example in readme
erayaydin Feb 25, 2026
26e1f3e
feat: update OpenAPI schema
erayaydin Feb 25, 2026
0d8d1d6
test: add ruleset evaluation smoke tests
erayaydin Feb 25, 2026
167e25c
refactor: remove retryAfter refs from docs tests
erayaydin Feb 26, 2026
3c7455a
fix: use repeated keys instead of bracket notation
erayaydin Feb 26, 2026
1ff9856
fix: throw on unexpected non-JSON content return
erayaydin Feb 26, 2026
200eddf
refactor!: rename FingerprintJsServerApiClient
erayaydin Feb 26, 2026
5fd1884
fix: check error response shape before throw 429
erayaydin Feb 26, 2026
61cc2c4
chore: fix changeset message for getEvent
erayaydin Feb 26, 2026
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
4 changes: 2 additions & 2 deletions .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"changelog": [
"@fingerprintjs/changesets-changelog-format",
{
"repo": "fingerprintjs/fingerprintjs-pro-server-api-node-sdk"
"repo": "fingerprintjs/node-sdk"
}
],
"commit": false,
Expand All @@ -12,5 +12,5 @@
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": ["fingerprintjs-pro-server-api-node-sdk-example"]
"ignore": ["fingerprint-server-sdk-example", "fingerprint-server-sdk-smoke-tests"]
}
22 changes: 22 additions & 0 deletions .changeset/early-seas-look.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
'@fingerprint/fingerprint-server-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.
5 changes: 5 additions & 0 deletions .changeset/loud-waves-drive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@fingerprint/fingerprint-server-sdk': major
---

change package name to `@fingerprint/fingerprint-server-sdk`
10 changes: 10 additions & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"mode": "pre",
"tag": "test",
"initialVersions": {
"@fingerprint/fingerprint-server-sdk": "6.10.0",
"fingerprint-server-sdk-example": "1.0.0",
"fingerprint-server-sdk-smoke-tests": "2.0.0"
},
"changesets": []
}
5 changes: 5 additions & 0 deletions .changeset/witty-lobsters-film.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@fingerprint/fingerprint-server-sdk': minor
---

add `options` parameter to the `getEvent` operation
2 changes: 1 addition & 1 deletion .schema-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v2.12.0
v3.0.1
5 changes: 3 additions & 2 deletions example/.env.example
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
API_KEY=<API_KEY>
VISITOR_ID=<VISITOR_ID>
REQUEST_ID=<REQUEST_ID>
EVENT_ID=<EVENT_ID>
RULESET_ID=<RULESET_ID>
# "eu" or "ap", "us" is the default
REGION=<REGION>
WEBHOOK_SIGNATURE_SECRET=<WEBHOOK_SIGNATURE_SECRET>
BASE64_KEY=<BASE64_KEY>
BASE64_SEALED_RESULT=<BASE64_SEALED_RESULT>
BASE64_SEALED_RESULT=<BASE64_SEALED_RESULT>
4 changes: 2 additions & 2 deletions example/deleteVisitor.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FingerprintJsServerApiClient, Region, RequestError } from '@fingerprintjs/fingerprintjs-pro-server-api'
import { FingerprintServerApiClient, Region, RequestError } from '@fingerprint/fingerprint-server-sdk'
import { config } from 'dotenv'
config()

Expand All @@ -23,7 +23,7 @@ if (envRegion === 'eu') {
region = Region.AP
}

const client = new FingerprintJsServerApiClient({ region, apiKey })
const client = new FingerprintServerApiClient({ region, apiKey })

try {
await client.deleteVisitorData(visitorId)
Expand Down
22 changes: 16 additions & 6 deletions example/getEvent.mjs
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { FingerprintJsServerApiClient, Region, RequestError } from '@fingerprintjs/fingerprintjs-pro-server-api'
import { FingerprintServerApiClient, Region, RequestError } from '@fingerprint/fingerprint-server-sdk'
import { config } from 'dotenv'
config()

const apiKey = process.env.API_KEY
const requestId = process.env.REQUEST_ID
const eventId = process.env.EVENT_ID
const rulesetId = process.env.RULESET_ID
const envRegion = process.env.REGION

if (!requestId) {
console.error('Request ID not defined')
if (!eventId) {
console.error('Event ID not defined')
process.exit(1)
}

Expand All @@ -23,11 +24,20 @@ if (envRegion === 'eu') {
region = Region.AP
}

const client = new FingerprintJsServerApiClient({ region, apiKey })
const client = new FingerprintServerApiClient({ region, apiKey })

try {
const event = await client.getEvent(requestId)
const event = await client.getEvent(eventId, { ruleset_id: rulesetId })
console.log(JSON.stringify(event, null, 2))

if (rulesetId && event.rule_action) {
const { type, ruleset_id, rule_id, rule_expression } = event.rule_action
console.log(`Rule action: ${type} (ruleset: ${ruleset_id}, rule: ${rule_id}, expression: ${rule_expression})`)

if (type === 'block') {
console.log(`Block response: ${event.rule_action.status_code} ${event.rule_action.body}`)
}
}
} catch (error) {
if (error instanceof RequestError) {
console.log(`error ${error.statusCode}: `, error.message)
Expand Down
53 changes: 0 additions & 53 deletions example/getVisitorHistory.mjs

This file was deleted.

4 changes: 2 additions & 2 deletions example/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "fingerprintjs-pro-server-api-node-sdk-example",
"name": "fingerprint-server-sdk-example",
"version": "1.0.0",
"description": "",
"main": "index.mjs",
Expand All @@ -10,7 +10,7 @@
"author": "",
"license": "MIT",
"dependencies": {
"@fingerprintjs/fingerprintjs-pro-server-api": "workspace:*",
"@fingerprint/fingerprint-server-sdk": "workspace:*",
"dotenv": "^16.4.5"
}
}
43 changes: 0 additions & 43 deletions example/relatedVisitors.mjs

This file was deleted.

6 changes: 3 additions & 3 deletions example/searchEvents.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FingerprintJsServerApiClient, Region, RequestError } from '@fingerprintjs/fingerprintjs-pro-server-api'
import { FingerprintServerApiClient, Region, RequestError } from '@fingerprint/fingerprint-server-sdk'
import { config } from 'dotenv'
config()

Expand All @@ -17,15 +17,15 @@ if (envRegion === 'eu') {
region = Region.AP
}

const client = new FingerprintJsServerApiClient({ region, apiKey })
const client = new FingerprintServerApiClient({ region, apiKey })

const filter = {
limit: 10,
// pagination_key: '<pagination_key>',
// bot: 'all',
// visitor_id: 'TaDnMBz9XCpZNuSzFUqP',
// ip_address: '192.168.0.1/32',
// linked_id: '<linked_id>,
// linked_id: '<linked_id>',
//start: 1620000000000,
//end: 1630000000000,
//reverse: true,
Expand Down
2 changes: 1 addition & 1 deletion example/unsealResult.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { unsealEventsResponse, DecryptionAlgorithm } from '@fingerprintjs/fingerprintjs-pro-server-api'
import { unsealEventsResponse, DecryptionAlgorithm } from '@fingerprint/fingerprint-server-sdk'
import { config } from 'dotenv'
config()

Expand Down
16 changes: 8 additions & 8 deletions example/updateEvent.mjs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { FingerprintJsServerApiClient, RequestError, Region } from '@fingerprintjs/fingerprintjs-pro-server-api'
import { FingerprintServerApiClient, RequestError, Region } from '@fingerprint/fingerprint-server-sdk'
import { config } from 'dotenv'

config()

const apiKey = process.env.API_KEY
const requestId = process.env.REQUEST_ID
const eventId = process.env.EVENT_ID
const envRegion = process.env.REGION

if (!requestId) {
console.error('Request ID not defined')
if (!eventId) {
console.error('Event ID not defined')
process.exit(1)
}

Expand All @@ -24,18 +24,18 @@ if (envRegion === 'eu') {
region = Region.AP
}

const client = new FingerprintJsServerApiClient({ region, apiKey })
const client = new FingerprintServerApiClient({ region, apiKey })

try {
await client.updateEvent(
{
tag: {
tags: {
key: 'value',
},
linkedId: 'new_linked_id',
linked_id: 'new_linked_id',
suspect: false,
},
requestId
eventId
)

console.log('Event updated')
Expand Down
2 changes: 1 addition & 1 deletion example/validateWebhookSignature.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isValidWebhookSignature } from '@fingerprintjs/fingerprintjs-pro-server-api'
import { isValidWebhookSignature } from '@fingerprint/fingerprint-server-sdk'

/**
* Webhook endpoint handler example
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@fingerprintjs/fingerprintjs-pro-server-api",
"name": "@fingerprint/fingerprint-server-sdk",
"version": "6.10.0",
"description": "Node.js wrapper for FingerprintJS Sever API",
"description": "Node.js wrapper for Fingerprint Server API",
"main": "dist/index.cjs",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
Expand All @@ -15,7 +15,7 @@
},
"repository": {
"type": "git",
"url": "https://github.com/fingerprintjs/fingerprintjs-pro-server-api-node-sdk"
"url": "https://github.com/fingerprintjs/node-sdk"
},
"engines": {
"node": ">=18.17.0"
Expand Down
4 changes: 2 additions & 2 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading