react-session.manager.sk 3.1.1 → 3.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -145,12 +145,17 @@ Storing a token in `localStorage` means the session persists across browser rest
|
|
|
145
145
|
|
|
146
146
|
### Device Fingerprinting
|
|
147
147
|
|
|
148
|
-
On first load the provider uses [
|
|
148
|
+
On first load the provider uses [FingerprintJS](https://github.com/fingerprintjs/fingerprintjs) to generate a browser fingerprint. This value is persisted to `localStorage` as `deviceUID` and is automatically added to every outgoing request as a custom `deviceUID` header. Subsequent loads reuse the cached value.
|
|
149
149
|
|
|
150
150
|
You can also use the fingerprint helper directly in your own code:
|
|
151
151
|
|
|
152
152
|
```js
|
|
153
153
|
import { getDeviceFingerprint } from "react-session.manager.sk";
|
|
154
|
+
|
|
155
|
+
async function sendRequest() {
|
|
156
|
+
const deviceUID = await getDeviceFingerprint();
|
|
157
|
+
// use deviceUID in your request payload/headers
|
|
158
|
+
}
|
|
154
159
|
```
|
|
155
160
|
|
|
156
161
|
### Version Protection
|
|
@@ -207,7 +212,7 @@ Tests live in the `tests/` directory and use Node's built-in `node:test` runner.
|
|
|
207
212
|
| Package | Role |
|
|
208
213
|
|---|---|
|
|
209
214
|
| [react-toastify](https://www.npmjs.com/package/react-toastify) | In-app toast notifications |
|
|
210
|
-
| [
|
|
215
|
+
| [@fingerprintjs/fingerprintjs](https://github.com/fingerprintjs/fingerprintjs) | Browser fingerprinting for `deviceUID` |
|
|
211
216
|
|
|
212
217
|
---
|
|
213
218
|
|