Skip to content

Commit f4cca70

Browse files
oschwaldclaude
andcommitted
Update README with usage documentation
Add installation, usage examples (basic, ad-blocker bypass, WebGL disable), error handling guide, and API reference. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 2a41944 commit f4cca70

File tree

1 file changed

+58
-7
lines changed

1 file changed

+58
-7
lines changed

README.md

Lines changed: 58 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,69 @@
11
# MaxMind Device Tracking Add-On
22

3+
A thin loader package for MaxMind's [minFraud device tracking](https://dev.maxmind.com/minfraud/track-devices)
4+
system. This package dynamically loads the device fingerprinting module from
5+
MaxMind's servers at runtime, ensuring you always get the latest version without
6+
updating the npm package.
7+
8+
The package itself contains no fingerprinting logic — it validates inputs, loads
9+
the remote module, and returns the tracking token.
10+
311
## Installation
412

513
```bash
614
npm install @maxmind/device-tracking
715
```
816

9-
## License
17+
## Usage
18+
19+
```typescript
20+
import { trackDevice } from '@maxmind/device-tracking';
21+
22+
const result = await trackDevice({ accountId: 123456 });
23+
console.log(result.trackingToken);
24+
```
25+
26+
### Ad-blocker bypass
27+
28+
If you proxy MaxMind's device tracking through your own subdomain (to avoid
29+
ad-blockers), pass the `host` option. The module will be loaded from your
30+
custom host, and the host value is passed to the remote module for its own use:
31+
32+
```typescript
33+
const result = await trackDevice({
34+
accountId: 123456,
35+
host: 'tracking.yourdomain.com',
36+
});
37+
```
38+
39+
### Disable WebGL hash
40+
41+
For performance or compatibility, you can disable WebGL hash collection:
42+
43+
```typescript
44+
const result = await trackDevice({
45+
accountId: 123456,
46+
disableWebglHash: true,
47+
});
48+
```
49+
50+
## API reference
51+
52+
### `trackDevice(options: TrackDeviceOptions): Promise<TrackResult>`
53+
54+
Loads the device tracking module (if not already cached) and collects a device
55+
fingerprint.
56+
57+
### `TrackDeviceOptions`
1058

11-
Licensed under either of
59+
| Property | Type | Required | Description |
60+
| ------------------ | --------- | -------- | ----------------------------------------------- |
61+
| `accountId` | `number` | Yes | Your MaxMind account ID (positive integer) |
62+
| `host` | `string` | No | Custom hostname for ad-blocker bypass |
63+
| `disableWebglHash` | `boolean` | No | Disable WebGL hash collection |
1264

13-
- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or
14-
https://www.apache.org/licenses/LICENSE-2.0)
15-
- MIT license ([LICENSE-MIT](LICENSE-MIT) or
16-
https://opensource.org/licenses/MIT)
65+
### `TrackResult`
1766

18-
at your option.
67+
| Property | Type | Description |
68+
| --------------- | -------- | ------------------------------ |
69+
| `trackingToken` | `string` | Opaque device tracking token |

0 commit comments

Comments
 (0)