Eitri Shopping Modules are collections of functions complementary to those available in Eitri Bifrost exclusive to Eitri Shopping apps that allow an eitri app to call native code to perform a multitude of operations, such as using the mobile device's camera, manipulating the navigation backstack, sending logs to Firebase, among others.
Provided that you already imported Eitri Bifrost, accessing the modules requires first calling the async modules() method to get the modules descriptor, then checking if the specific module exists (graceful degradation), and finally invoking the desired method.
For example, this is how you would use the logEvent method from the Firebase module:
// Get the modules descriptor
const modules = await Eitri.modules();
// Check if the fb module exists
if (!modules?.fb?.logEvent) {
console.log("Firebase module is not available");
return;
}
// Use the method
await modules.fb.logEvent({eventName: "event", data: {key: "value"}})
Here, the namespace for the Firebase module functions is 'fb', and the method that was called from this group of functions is logEvent