Associate an actor with traits (e.g. on registration).
(actor: TelemetryActor, traits: Record<string, unknown>)
| 188 | |
| 189 | /** Associate an actor with traits (e.g. on registration). */ |
| 190 | identifyActor(actor: TelemetryActor, traits: Record<string, unknown>): void { |
| 191 | const client = this.getClient(); |
| 192 | if (!client) { |
| 193 | return; |
| 194 | } |
| 195 | client.identify({ |
| 196 | userId: actor.accountId, |
| 197 | traits, |
| 198 | context: { |
| 199 | app: { environment: telemetryEnvironment, frontendDomain }, |
| 200 | }, |
| 201 | } as unknown as RudderAnalytics.IdentifyParams); |
| 202 | } |
| 203 | |
| 204 | /** Flush buffered events; call on graceful shutdown. */ |
| 205 | async flush(): Promise<void> { |
no test coverage detected