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