validateEvent
Upgather Analytics / validateEvent
Function: validateEvent()
validateEvent(
client,eventId):Promise<{reason:string;valid:boolean; }>
Extended event validation with both format and existence check.
Parameters
client
ApiClient
The API client to use for the request
eventId
string
The event ID to validate
Returns
Promise<{ reason: string; valid: boolean; }>
Promise resolving to validation result with reason if invalid
Remarks
This function performs both local format validation and a remote existence check. It returns a detailed validation result including a reason if validation fails.
Example
const result = await validateEvent(apiClient, 'homepage-visit');
if (result.valid) {
console.log('Event is valid');
} else {
console.log(`Event is invalid: ${result.reason}`);
}