Skip to content

Commit 2673fff

Browse files
oschwaldclaude
andcommitted
Add trackingToken to Device request object
This adds the optional trackingToken field to the Device request object for explicit device linking via the Device Tracking Add-on. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent e670bf8 commit 2673fff

4 files changed

Lines changed: 24 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
CHANGELOG
22
=========
33

4+
8.4.0
5+
------------------
6+
7+
* Added the input `/device/tracking_token`. This is the token generated by
8+
the [Device Tracking Add-on](https://dev.maxmind.com/minfraud/track-devices)
9+
for explicit device linking. You may provide this by providing
10+
`trackingToken` to `Device`.
11+
412
8.3.0 (2026-01-20)
513
------------------
614

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ try {
179179
transaction = new minFraud.Transaction({
180180
device: new minFraud.Device({
181181
ipAddress: "81.2.69.160",
182+
trackingToken: "abc123",
182183
}),
183184
event: new minFraud.Event({
184185
party: minFraud.Constants.EventParty.Customer,

src/request/device.spec.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,12 @@ describe('Device()', () => {
2727
});
2828
}).not.toThrow();
2929
});
30+
31+
it('sets trackingToken correctly', () => {
32+
const device = new Device({
33+
ipAddress: '1.1.1.1',
34+
trackingToken: 'abc123',
35+
});
36+
expect(device.trackingToken).toBe('abc123');
37+
});
3038
});

src/request/device.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ interface DeviceProps {
2626
* identifies a visitor's session on the site.
2727
*/
2828
sessionId?: string;
29+
/**
30+
* The tracking token from the Device Tracking Add-on for explicit device
31+
* linking.
32+
*/
33+
trackingToken?: string;
2934
}
3035

3136
/**
@@ -42,6 +47,8 @@ export default class Device implements DeviceProps {
4247
public sessionAge?: number;
4348
/** @inheritDoc DeviceProps.sessionId */
4449
public sessionId?: string;
50+
/** @inheritDoc DeviceProps.trackingToken */
51+
public trackingToken?: string;
4552

4653
public constructor(device: DeviceProps) {
4754
if (device.ipAddress != null && isIP(device.ipAddress) === 0) {

0 commit comments

Comments
 (0)