Events.js console.log output

I am trying to capture RSVP data to store elsewhere. I created an events.js file in the backend and wrote the simplest code to check the exact format of what it will give me.

export function wixEvents_onRsvpCreated ( event ) {
let eventId = event . eventId ;
console . log ( eventId );
}

My understanding is that I should be able to see this in console in preview mode but the console.log is not appearing. What I am doing wrong here?

Simon.

Hi Simon,
You said u created an events.js file in the backend,

Is that the function u are showing here?

Yes @volkaertskristof . This is all that is in the events.js file as things stand.

I am assuming that this function will be triggered when someone RSVPs to an event. This is not my final code…just making sure I can debug before I start coding.

Trying code is only possible in the backend file itself,
There is a “run” button left of the code at the start of the function.

When trying your code and you run the function from the backend in the front end
the console.log won’t show since its in the backend.

HI Simon, to add to what Kristof shared take a look at this article about how to debug backend events. There is a section where they specifically go through an events.js example.