the thing I want to do is to add two notification from this loopedin, but I don’t know how to initializate both, only one, I’m using react, my boss send me this
<script>
var li_sidebar = {
auto_init: false,
};
</script>
<script
type="text/javascript"
src="https://cdn.loopedin.io/js/sidebar.min.js?v=0.1"
defer="defer"
></script>
<script>
var ps_config = {
auto_init: false,
};
</script>
<script
type="text/javascript"
src="https://cdn.loopedin.io/js/widget.min.js?v=0.8"
defer="defer"
></script>
I put it on the index.html and I initializated on a useEffect on a component,
useEffect(() => {
if (userData) {
//notification sidebar
updateUser(userData);
window.li_sidebar = {
email: userData.email,
name: userData.name,
workspace_id: "fb37cec2-edaf-123-123-2111d96da5af",
};
window.ps_sidebar = {
email: userData.email,
name: userData.name,
workspace_id: "3e1b48e3-4eae-123-123-f9c62bb22e42",
};
window.LoopedIn.sidebar.init();
// window.LoopedIn.widget.init();
}
}, [userData]);
this window.LoopedIn.widget.init() don’t work, does any one know how do I initializate this widget?
puting a console.log on console of the window.LoopedIn it brought just the sidebar element, the li_sidebar and ps_sidebar brought the object above
(I changed the id to put here, but in the code is the valid one)
I have tried to read the documentation but I didn’t understand, neither my coworkers know what to do.
that window.LoopedIn.widget.init() give an error on console: Uncaught TypeError: Cannot read properties of undefined (reading ‘init’)
I have tried to initializate on index.html with:
<script>
var ps_config = {
auto_init: true,
workspace_id: "3e1b48e3-4eae-123-123-f9c62bb22e42",
};
</script>
but it doesn’t do anything