type UUID = string & { _brand: 'UUID' };
type BaseEvent {
organizationId: UUID; // id of the organization for which the event falls under
accountId: UUID; // the id of the specific account within the organization for which the event falls under
projectId: UUID; // the id of the specific project within the account for which the event falls under
widgetConfigurationId: UUID; // the id of the widget configuration that originated the event or the underlying invitation associated with the event
environmentId: UUID; // the id of the environment in which the event occurred
deploymentId: UUID; // the id of the deployment specific to this event
name: string; // the name of the event
timestamp: Date; // the time which the event occurred
platform: string; // the platform (web, ios, android) on which the invitation was initiated
useragent?: string; // the useragent from of the device used to create the event if available
referer?: string; // the full URL of the referer if available
refererDomain?: string; // the domain of the referer if available.
sessionId?: UUID; // the session id, generated by the widget, of a particular session.
foreignUserId?: string; // the id, in your system, of the user that created the event, if available/applicable
segmentation?: Record<string, any>; // segmentation of the event as specified by the widget prop
payload?: Record<string, any>; // any unique information for the specific event type
groups?: Array<{ // the group or groups that the event is related to as defined by your system
type: string;
id: string;
name: string;
}>;
}