XMPP strophe file transfer

I am developing an ionic-cordova application with chat by Openfire.
I can’t get the strophe.si-filetransfer.js plugin to work
This the declaration in index, html:

  <script src="/assets/xmpp/strophe.si-filetransfer.js"></script>
  <script src="/assets/xmpp/strophe.ibb.js"></script>

and this in file .ts:

 import { Strophe } from 'strophe.js';


but connection.si_filetransfer’ and ‘connection.ibb’ are always ‘undefined’

i tried installing ‘npm strophejs-plugins’ but it doesn’t help

Can anyone help me?

Hi, first of all beware importing js files like this , even if your are loading this js file in async mode you should really think about it since it will impact your app booting time.

You should install that strophe.js through npm if you want to import that package, otherwise you could try replacing your import { Strophe } from ‘strophe.js’ and do something like:

(supposing Strophe.js is exporting the object strophe, I’m pretty sure it’s case sensitive)

declare var strophe;

and then you use your object’s methods, for example:


Thanks for your help,
if I understand correctly you advise me to use the npm packages.

Do you know if SI File Transfer in https://www.npmjs.com/package/strophejs-plugins
should works?

because using npm packages connection.si_filetransfer is still undefined
how can I import it?

I’n sorry to be late
it was a problem of include plugin from node module, this code works:

import { Strophe } from 'strophe.js';

thank for all help