Setup
What is the DMK?
This package contains the core of the Device Management Kit (DMK). It provides a simple interface to handle Ledger devices and features the Device Management Kit’s entry points, classes, types, structures, and models.
Installation
Add the DMK to your project with this command:
npm install @ledgerhq/device-management-kit
Browser Compatibility
This library is compatible with any browser that supports the WebHID API.
Understanding RxJS: A Quick Primer
The DMK uses RxJS to handle asynchronous operations. If you’re new to RxJS, here’s what you need to know:
- Observables: Most DMK functions return “Observables” instead of Promises
- Subscription: You need to “subscribe” to an Observable to get its data
Basic example:
dmk.someFunction().subscribe({
next: (data) => console.log("Data received:", data),
error: (error) => console.error("Error:", error),
complete: () => console.log("Operation completed"),
});
What’s Next?
Now that you have the DMK installed, proceed to the next guide to learn how to initialize it in your application.