const response = await fetch('https://integration-api.userflux.co/event/ingest', {
method: 'POST',
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"userId": "{userId} or null",
"anonymousId": "{anonymousId} or null",
"timestamp": 1690111645853,
"name": "event_name",
"properties": {
"property1": "value",
"property2": 123,
"property3": true,
"property4": null,
"property5": {
"nestedProperty1": "value"
}
}
}),
});
const data = await response.json();