Seems like no one knows how to use any capacitor-community plugin inside wappler mobile

I am really interested to migrate and use wappler for all my projects, but I am getting very confused about how to do several stuff, for example, for wappler mobile apps, it’s using capacitor, which is ok, but there’s no documentation to implement community plugins like bluetooth @capacitor-community/bluetooth-le

I know how to install it, but then how I can call it inside the app? how I can get access to that library and all its capabilities? I guess it’s going the be the same for all community plugins, but there’s no documentation of this.

Can someone help me?

1 Like

Hello, it’s not possible to have documentation for any capacitor plugin available out there.
You can find the documentation of this specific plugin here: https://github.com/capacitor-community/bluetooth-le just follow it, it explains how to use the plugin and its options.

installing is pretty simple, the question is how to use it since their example is based on ES2017 and that’s not supported by wappler? or how I can use that code because I tried it and it does not work, if you can show me an example or few steps about how to do it I will really appreciate it, I am very lost on this.

Does the contributor not have a support link?

You place your js script in a js file and include it then in your app’s html page. The rest is - follow the plugin docs.

I already did that, but does not work, for example, bluetooth library says to do this:

import { BleClient } from '@capacitor-community/bluetooth-le';
await BleClient.initialize({ androidNeverForLocation: true });

I add this in a js file and does not work, looks like import instances are not valid js in wappler, so I feel I need to translate this to the proper way Wappler accepts it.

How is the way to do this? do you have any example I can use and just replicate it?

Thanks for your attention, I really appreciate this

any answer about this? this is the step I always fall, I guess wappler does not support import and await.
I guess I need to do some kind or parser like webpack to convert those js files to a valid js for wappler but I am not sure if that’s the correct path or I should do something different.

Hey @sleeviin, I’m struggling with similar development. I’ve learned that Wappler’s node.js uses CommonJS, which means you need to use require instead of import. ChatGPT is pretty helpful in converting most of it if you need help.

https://nodejs.org/api/modules.html

1 Like

The problem is Wappler mobile apps are not supporting neither import nor require which a lot of Capacitor plugins use. I am also hunting for a solution to this problem.

With mine neither import nor require is working. Both are throwing errors.