I am using standard node.js sdk to log an event with the following code:
// ES5 Syntax
const Amplitude = require('@amplitude/node');
// ES6 Syntax
import * as Amplitude from '@amplitude/node';
var client = Amplitude.init(<AMPLITUDE_API_KEY>);
client.logEvent({
event_type: 'Node.js Event',
user_id: 'datamonster@gmail.com',
location_lat: 37.77,
location_lng: -122.39,
ip: '127.0.0.1',
event_properties: {
keyString: 'valueString',
keyInt: 11,
keyBool: true
}
});
// Send any events that are currently queued for sending.
// Will automatically happen on the next event loop.
client.flush();
but though my code is already executed, it still showing listening. can some body help me out with this.