(
eventName: string,
metadata: Record<string, number | boolean | undefined> = {},
)
| 215 | * @param metadata - Additional metadata for the event (intentionally no strings, to avoid accidentally logging code/filepaths) |
| 216 | */ |
| 217 | export function logEventTo1P( |
| 218 | eventName: string, |
| 219 | metadata: Record<string, number | boolean | undefined> = {}, |
| 220 | ): void { |
| 221 | if (!is1PEventLoggingEnabled()) { |
| 222 | return |
| 223 | } |
| 224 | |
| 225 | if (!firstPartyEventLogger || isSinkKilled('firstParty')) { |
| 226 | return |
| 227 | } |
| 228 | |
| 229 | // Fire and forget - don't block on metadata enrichment |
| 230 | void logEventTo1PAsync(firstPartyEventLogger, eventName, metadata) |
| 231 | } |
| 232 | |
| 233 | /** |
| 234 | * GrowthBook experiment event data for logging |
no test coverage detected