How to Call Windows Native APIs in Electron

Calling Windows native APIs in an Electron app feels like wanting to see the ocean but only having a map. After some trial and error, I've found a few paths—writing this article serves as a record and a guide for others who might follow.

Background

When building Electron desktop applications, you inevitably need to interact with the operating system. On Windows, these requirements are quite common:

Calling Windows Store APIs for in-app purchases