@lokalise/fastify-extras
Version:
Opinionated set of fastify plugins, commonly used in Lokalise
18 lines • 606 B
JavaScript
import { track } from '@amplitude/analytics-node';
export class Amplitude {
isEnabled;
constructor(isEnabled) {
this.isEnabled = isEnabled;
}
/**
* Sends the given event to Amplitude
*
* @param event Event to send to amplitude. Please check
* [this](https://amplitude.github.io/Amplitude-TypeScript/interfaces/_amplitude_analytics_node.Types.BaseEvent.html)
* to get more info about the BaseEvent type
*/
track(event) {
return this.isEnabled ? track(event) : { promise: Promise.resolve(null) };
}
}
//# sourceMappingURL=Amplitude.js.map