openwallet-foundation / credo-ts

Typescript framework for building decentralized identity and verifiable credential solutions
https://credo.js.org
Apache License 2.0
277 stars 202 forks source link

Web app support #441

Closed afrancoc2000 closed 3 years ago

afrancoc2000 commented 3 years ago

Hi, Will flutter be included in the roadmap? or how would you create an aries agent based on flutter?

afrancoc2000 commented 3 years ago

What I mean is how to create a micro-frontend that can be embeded in flutter, like using angular or react, to create an aries agent

afrancoc2000 commented 3 years ago

Ok, what I mean is, can this project be used for a browser based app?

jakubkoci commented 3 years ago

Hi, @afrancoc2000. Yes and no. You can use it to build a web-based desktop app with Electron. But you can't build a web app running in a regular browser.

The reason is that AJF depends on the natively built library libindy. That's currently built only for Node.js and React Native environments.

One option would be to use WebAssembly. The libindy library is written in Rust, so we could compile it with WebAssembly, and then consume it from a browser via WASM API. However, this is just an idea and it's not on a roadmap.

TimoGlastra commented 3 years ago

Sadly it's not possible to build libindy for the browser and I don't think it will in the near future.

Libindy depends on libzmq for interacting with an indy ledger. ZMQ uses direct TCP for communication, which is not possible in the browser. Until browsers allow direct TCP connections, or ZMQ/Indy do not use direct TCP connections anymore Indy is not going to run in a browser...

https://stackoverflow.com/a/61131849

afrancoc2000 commented 3 years ago

Hi, @jakubkoci and @TimoGlastra. Thank you for your answers. What I'm looking for really is to run my app from flutter embeding a site build in vue, angular or react. In that case it wouldn't be running from a browser, instead, it would run from a mobile device, like React Native or Electron in the desktop. Being that the case, would it be possible to create an app using the AJF and libindy that would run on flutter?

berendsliedrecht commented 3 years ago

I think that wrapping AFJ for dart might in theory be possible with package:js, however this is not on the roadmap.

afrancoc2000 commented 3 years ago

@blu3beri Thank you for the info