Closed LMatass closed 1 month ago
``It seems that I was importing the wrong package.
Replacing:
// @ts-ignore
import { converse, api } from '@converse/headless/core';
for:
// @ts-ignore
import converse from '@converse/headless/index';
Solved the issue.
To access the api object, inside a converse.plugins.add function simply:
converse.plugins.add('some-plugin', {
initialize: function () {
this.foo(this._converse);
},
foo(_converse: any) {
_converse.api.send(...);
}
}
Hope this can help anyone!
Hello,
I'm trying to integrate @converse/headless in a Angular app, but I have one error when initializing converse.
I have the following error:
Even if I have a valid bosh_service_url url. I have tried this very same configuration, using a static index.html file and pointing to the https://cdn.conversejs.org/10.1.4/dist/converse.min.js.
Here is how im trying to integrate it into angular (might be wrong as the only example I could find on how to integrate @converse/headless was very old).
Basically I have a service, which on constructor makes the initialization.
I have introduced a
console.log()
inside theinitialize()
function innode_modules\@converse\headless\shared\api\public.js
to check whether the settings were arriving as they supposed, and it looks like it, there are the same settings as I pass in the angular service.I'm probably missing something but I couldn't figure it out, some help or examples would be appreciate it