I am trying to retrieve Wix event data so I can create my own events “repeater” but I cannot figure out how.
I have installed the Wix Events app and have set up some events.
On the page that I want to display a list of events I am using the code below that I found on the Wix velo guide, but it does not work. For starters it doesn’t recognise the 1st line. It says:
"‘wixEvents’ is declared but its value is never read.
Cannot find module ‘wix-events-backend’ or its corresponding type declarations"
----CODE-----------------
import { wixEvents } from “wix-events-backend”;
export function myQueryEventFunction() {
return wixEvents.queryEvents()
.hasSome(“status”, [“SCHEDULED”])
.descending(“createdDate”)
.find()
.then((results) => {
const items = results.items;
const firstItem = items[0];
return firstItem;
console.log(“I found an event item”);
})
.catch((error) => {
console.error(error);
});
}
If anyone has the code to open and loop through events data that would be appreciated!
Many thanks!