0

I am migrating working code from regular dweet.io to dweetpro.io

In the javascript API documentation for dweetpro, it says to initialize using

var dweetClient = require("dweetio-client");
var dweetio = new dweetClient("username", "password");

But "require" is not supported in client side javascript. What do I need to do?

vimuth
  • 5,064
  • 33
  • 79
  • 116

1 Answers1

0

For client-side usage, you'd need to use a 3rd party package in order to require packages the same way you would in node. You can take a look at requirejs or browserify.

Another way is to use this package, not sure if this is the same package that you mentioned in your question, but you can use it client-side.

Update: According to dweet.io, this is the official javascript package if you want to use it client-side

  • The javascript packages pointed out above are for regular dweet and not for dweetpro, I believe. – sunilmeister Jul 11 '22 at 02:47
  • The package I am using is As per the official API documentation at https://github.com/buglabs/dweetio-client-v2 (Official) All very confusing … – sunilmeister Jul 11 '22 at 03:19
  • Mamdouh - is the package you mention for dweet or dweetpro? Because I see that the arguments for listen_for are missing the "my-key" argument ... – sunilmeister Jul 11 '22 at 13:11