Pinging @bghgary, the BabylonNative architect and overlord.
In my experience, I’ve found The N-API Resource | to be a good resource in learning how to initialize NAPI functions with c++ implementation, and a more complex sample: The N-API Resource | (inspiredware.com) is another good resource in learning the syntax for how NAPI passes data b/w javascript and c++.
I’m not sure if we have a great story in how to add your own NAPI-based additions to be ran from the javascript side, but hopefully this gets you started with the basics of using NAPI.
From there, you should be able to pass a reference of the javascript environment to your NAPI initialization logic, similarily to our sample application in how we setup the NAPI wrappers and environment modification for the other BabylonNative plugins on initialization:
After initialization, you should be able to call your functions as expected from your experience.js, as you’ve setup the javascript function definitions.
With all that out of the way, what are you hoping to speed up with a C++ search implementation? passing data to and from the javascript engine is the slowest part of these type of solutions, but there may be gains to be had if we use this properly.