You may want to differentiate between invited users and guests who access a space using a guestLink. Maybe you want to record metadata based on who is taking actions within a space.
The context of every event that fires will list the actorId of the user who is present or initiated behavior in a space. A guest will have an actorId like us_g_1234
, whereas a user will have an actorId like us_usr_1234
. This would allow you to listen for that actorId and do something based on the kind of Id that is returned.
listener.on("commit:created", async (event: FlatfileEvent) => {
const {actorId, spaceId} = event.context;
console.log(actorId);
//Add metadata to space
});