@ledgerhq/device-management-kit 0.0.0-develop-20260129001236 → 0.0.0-develop-20260130001250
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 +63 -28
- package/lib/cjs/package.json +1 -1
- package/lib/esm/package.json +1 -1
- package/lib/types/tsconfig.prod.tsbuildinfo +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -21,6 +21,9 @@
|
|
|
21
21
|
- [Executing a device action](#executing-a-device-action)
|
|
22
22
|
- [Open App Device Action](#open-app-device-action)
|
|
23
23
|
- [Example in React](#example-in-react)
|
|
24
|
+
- [Developer tools](#developer-tools)
|
|
25
|
+
- [Web, Node.js or Electron app](#web-nodejs-or-electron-app)
|
|
26
|
+
- [React Native app (with Rozenite)](#react-native-app-with-rozenite)
|
|
24
27
|
|
|
25
28
|
## Description
|
|
26
29
|
|
|
@@ -372,12 +375,19 @@ Check [the sample app](https://github.com/LedgerHQ/device-sdk-ts/tree/develop/ap
|
|
|
372
375
|
|
|
373
376
|
## Developer tools
|
|
374
377
|
|
|
375
|
-
|
|
376
|
-
For now they allow to view logs from the Device Management Kit. They will have more advanced features soon.
|
|
378
|
+
Developer tools are available to help debug your DMK integration:
|
|
377
379
|
|
|
378
|
-
|
|
380
|
+
- **Real-time logging** — View DMK logs with filtering by level and tag
|
|
381
|
+
- **Device session inspector** — Monitor connected devices and their states
|
|
382
|
+
- **Device discovery** — Discover and connect to devices from the dashboard
|
|
383
|
+
- **APDU sender** — Send raw APDU commands to devices
|
|
384
|
+
- **DMK configuration** — View and modify settings like the My Ledger API provider
|
|
379
385
|
|
|
380
|
-
|
|
386
|
+
### Web, Node.js or Electron app
|
|
387
|
+
|
|
388
|
+
For web apps, Node.js apps, Electron apps, or any JavaScript runtime with WebSocket support (including React Native), use the WebSocket-based devtools with the Electron dashboard app.
|
|
389
|
+
|
|
390
|
+
> **React Native users:** This setup also works for React Native apps. However, if you have [Rozenite](https://www.rozenite.dev/) set up in your app, we recommend the [Rozenite-based devtools](#react-native-app-with-rozenite) instead — it provides a more integrated experience directly within the React Native DevTools, with less setup required.
|
|
381
391
|
|
|
382
392
|
#### Set up
|
|
383
393
|
|
|
@@ -388,24 +398,33 @@ Install those packages:
|
|
|
388
398
|
- `@ledgerhq/device-management-kit-devtools-websocket-connector`
|
|
389
399
|
|
|
390
400
|
```ts
|
|
391
|
-
import {
|
|
401
|
+
import {
|
|
402
|
+
DevToolsLogger,
|
|
403
|
+
DevToolsDmkInspector,
|
|
404
|
+
} from "@ledgerhq/device-management-kit-devtools-core";
|
|
392
405
|
import { DEFAULT_CLIENT_WS_URL } from "@ledgerhq/device-management-kit-devtools-websocket-common";
|
|
393
|
-
import {
|
|
406
|
+
import { DevToolsWebSocketConnector } from "@ledgerhq/device-management-kit-devtools-websocket-connector";
|
|
394
407
|
|
|
395
|
-
//
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
url: DEFAULT_CLIENT_WS_URL,
|
|
400
|
-
});
|
|
401
|
-
return new DevToolsLogger(devToolsWebSocketConnector);
|
|
402
|
-
}
|
|
408
|
+
// Create the connector (shared between logger and inspector)
|
|
409
|
+
const connector = DevToolsWebSocketConnector.getInstance().connect({
|
|
410
|
+
url: DEFAULT_CLIENT_WS_URL,
|
|
411
|
+
});
|
|
403
412
|
|
|
404
|
-
//
|
|
405
|
-
new
|
|
413
|
+
// Create the logger (before DMK is built)
|
|
414
|
+
const devToolsLogger = new DevToolsLogger(connector);
|
|
415
|
+
|
|
416
|
+
// Build the DMK with the logger
|
|
417
|
+
const dmk = new DeviceManagementKitBuilder()
|
|
406
418
|
//...
|
|
407
|
-
.addLogger(
|
|
419
|
+
.addLogger(devToolsLogger)
|
|
408
420
|
.build();
|
|
421
|
+
|
|
422
|
+
// Optional: Enable inspector for device sessions and DMK interaction
|
|
423
|
+
// This must be done AFTER the DMK is built
|
|
424
|
+
const inspector = new DevToolsDmkInspector(connector, dmk);
|
|
425
|
+
|
|
426
|
+
// Clean up when done (e.g., on app unmount)
|
|
427
|
+
// inspector.destroy();
|
|
409
428
|
```
|
|
410
429
|
|
|
411
430
|
#### Usage
|
|
@@ -427,24 +446,40 @@ Install those packages:
|
|
|
427
446
|
- `@ledgerhq/device-management-kit-devtools-rozenite`
|
|
428
447
|
|
|
429
448
|
```ts
|
|
430
|
-
import {
|
|
431
|
-
|
|
449
|
+
import {
|
|
450
|
+
DevToolsLogger,
|
|
451
|
+
DevToolsDmkInspector,
|
|
452
|
+
} from "@ledgerhq/device-management-kit-devtools-core";
|
|
453
|
+
import {
|
|
454
|
+
RozeniteConnector,
|
|
455
|
+
useRozeniteConnector,
|
|
456
|
+
} from "@ledgerhq/device-management-kit-devtools-rozenite";
|
|
432
457
|
|
|
433
|
-
//
|
|
434
|
-
|
|
435
|
-
const connector = RozeniteConnector.getInstance();
|
|
436
|
-
return new DevToolsLogger(connector);
|
|
437
|
-
}
|
|
458
|
+
// Create the connector (shared between logger and inspector)
|
|
459
|
+
const connector = RozeniteConnector.getInstance();
|
|
438
460
|
|
|
439
|
-
//
|
|
440
|
-
new
|
|
461
|
+
// Create the logger (before DMK is built)
|
|
462
|
+
const devToolsLogger = new DevToolsLogger(connector);
|
|
463
|
+
|
|
464
|
+
// Build the DMK with the logger
|
|
465
|
+
const dmk = new DeviceManagementKitBuilder()
|
|
441
466
|
//...
|
|
442
|
-
.addLogger(
|
|
467
|
+
.addLogger(devToolsLogger)
|
|
443
468
|
.build();
|
|
469
|
+
|
|
470
|
+
// Optional: Enable inspector for device sessions and DMK interaction
|
|
471
|
+
// This must be done AFTER the DMK is built
|
|
472
|
+
const inspector = new DevToolsDmkInspector(connector, dmk);
|
|
473
|
+
|
|
474
|
+
// Clean up when done (e.g., on app unmount)
|
|
475
|
+
// inspector.destroy();
|
|
476
|
+
|
|
477
|
+
// At the root of your React app, call this hook to initialise the connection
|
|
478
|
+
useRozeniteConnector();
|
|
444
479
|
```
|
|
445
480
|
|
|
446
481
|
#### Usage
|
|
447
482
|
|
|
448
483
|
1. Run your React Native app
|
|
449
484
|
2. [Open the React Native DevTools](https://reactnative.dev/docs/react-native-devtools)
|
|
450
|
-
3. Navigate to the DMK
|
|
485
|
+
3. Navigate to the DMK DevTools tab
|
package/lib/cjs/package.json
CHANGED
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
"watch:builds": "pnpm ldmk-tool watch --entryPoints index.ts,src/**/*.ts --tsconfig tsconfig.prod.json",
|
|
65
65
|
"watch:types": "concurrently \"tsc --watch -p tsconfig.prod.json\" \"tsc-alias --watch -p tsconfig.prod.json\""
|
|
66
66
|
},
|
|
67
|
-
"version": "0.0.0-develop-
|
|
67
|
+
"version": "0.0.0-develop-20260130001250"
|
|
68
68
|
}
|
package/lib/esm/package.json
CHANGED
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
"watch:builds": "pnpm ldmk-tool watch --entryPoints index.ts,src/**/*.ts --tsconfig tsconfig.prod.json",
|
|
65
65
|
"watch:types": "concurrently \"tsc --watch -p tsconfig.prod.json\" \"tsc-alias --watch -p tsconfig.prod.json\""
|
|
66
66
|
},
|
|
67
|
-
"version": "0.0.0-develop-
|
|
67
|
+
"version": "0.0.0-develop-20260130001250"
|
|
68
68
|
}
|