Use this package to add a widget showing the site members that are currently on your site.
Add a repeater with id onlineUsers inside the repeater you can set: image with id profilePic text with id userName How to Use the Package in your Site In your home page paste the following code:
import { connect } from '@ofird11/presence1';
$w.onReady(() => {
connect({
reportAddtionalInfo: () => {},
onRender: ($item, itemData) => {}
});
});
reportAddtionalInfo - In case you would like to add additional info on the user presence object (it will populate it on the itemData as data property) onRender - render hook in case you would like to render specific UI onto the repeater Content
$w.onReady(async function () {
connect({
reportAddtionalInfo: () => {
return { myData: 'hello' };
},
onRender: ($item, itemData) => {
if (itemData.data) {
$item('#data').text = JSON.stringify(itemData.data);
$item('#data').show();
}
}
});
});