Wrong environment detected in meteor package
I'm trying to use this library on the client side of a meteor package, but it keeps detecting the environment as NodeJS, which causes some things like require('fs') to fail, and errors appearing in the browser console.
The relevant part from my package.js file for meteor is:
api.addFiles([
'client/lib/libsignal.js',
'client/helper.js',
'client/store.js'
], 'client');
Any idea what could be going wrong?
If it helps, signal-protocol has been made for browser support from the ground up and should be usable as-is.
Yeah, I used it in a regular HTML file, and it works fine. I need to now implement the same thing as a package in meteor, and the only issue is the environment being detected as Node, when it clearly should be detected as web (since its being included in the client environment).
@mrinaldhar That sounds like an issue with signal-protocol. If you'd like, open an issue over there, and we'll see if we can look into why it's not detecting the environment correctly in meteor.
Hi,
@mrinaldhar I have a meteor app that I'd really like to integrate Signal's peer-to-peer encryption into. Could you please guide me into how I can do that? Thanks.
Hey @eminx , sorry for the late response. You can absolutely use this library to do that. I did that as a Google Summer of Code project with Rocket Chat last year, but we ended up not using Signal for some other reasons.
I built this as a simple tool to understand how Signal works, you can take a look at the code to help you with your work: https://mrinaldhar.com/signal/
Thanks @mrinaldhar ! I look into it, but I'd appreciate if you could guide me a little more indeed :)
Is it possible?
@eminx I'm interested in the same thing but completely lost where to start. It almost seems as this library is geared towards setting up your own independent signal service, which is not my interest. I want to use Signal to send automated / service messages to users from the server side of a meteor.js app. These library seems to show how you encrypt/decrypt the message, but completely lost on how you "register" the phone number associated with your service and get the encrypted message to the user's phone or desktop. @mrinaldhar Is this something you did before? Your link is very helpful to understand how the message encryption works, but I can't see the link between a service sender/receiver and an app user sender/receiver.
I'm gonna close this. Meteor is not a supported platform. The forums are a better place to have this kind of conversation: https://whispersystems.discoursehosting.net/